diff options
author | Gerald Carter <jerry@samba.org> | 2001-11-05 05:28:03 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2001-11-05 05:28:03 +0000 |
commit | 292a0265a9de7f5fa06140768ecf27056d59f6c1 (patch) | |
tree | d33cb5c3955c1485980f3addb4786a82858d8405 | |
parent | 7c3090fb2017eb08b8785f0b6e4eb98ab9246bbc (diff) | |
download | samba-292a0265a9de7f5fa06140768ecf27056d59f6c1.tar.gz samba-292a0265a9de7f5fa06140768ecf27056d59f6c1.tar.xz samba-292a0265a9de7f5fa06140768ecf27056d59f6c1.zip |
old merge from 2.2
-rw-r--r-- | source/param/loadparm.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c index f9355ed14f0..cf5f31953d0 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -1845,7 +1845,15 @@ from service ifrom. ***************************************************************************/ BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHomedir) { - int i = add_a_service(ServicePtrs[iDefaultService], pszHomename); + int i; + SMB_STRUCT_STAT buf; + + /* if the user's home directory doesn't exist, then don't + add it to the list of available shares */ + if (sys_stat(pszHomedir, &buf)) + return False; + + i = add_a_service(ServicePtrs[iDefaultService], pszHomename); if (i < 0) return (False); @@ -3356,15 +3364,26 @@ does not copy the found service. int lp_servicenumber(const char *pszServiceName) { int iService; - + fstring serviceName; + + for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && ServicePtrs[iService]->szService && - strequal(ServicePtrs[iService]->szService, pszServiceName)) - break; + { + if (VALID(iService) && ServicePtrs[iService]->szService) + { + /* + * The substitution here is used to support %U is + * service names + */ + fstrcpy(serviceName, ServicePtrs[iService]->szService); + standard_sub_basic(serviceName); + if (strequal(serviceName, pszServiceName)) + break; + } + } + if (iService < 0) - DEBUG(7, - ("lp_servicenumber: couldn't find %s\n", - pszServiceName)); + DEBUG(7,("lp_servicenumber: couldn't find %s\n", pszServiceName)); return (iService); } |