diff options
-rw-r--r-- | source3/lib/substitute.c | 36 | ||||
-rw-r--r-- | source3/param/loadparm.c | 7 |
2 files changed, 3 insertions, 40 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index eea720c014..439263dd23 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -343,42 +343,6 @@ void standard_sub_conn(connection_struct *conn, char *str) } /**************************************************************************** - Like standard_sub but for a homes share where snum still points to the [homes] - share. No user specific snum created yet so servicename should be the username. -****************************************************************************/ - -void standard_sub_home(int snum, const char *share, - const char *user, const char *homedir, pstring str) -{ - char *p, *s; - - for (s=str; (p=strchr_m(s, '%'));s=p) { - int l = sizeof(pstring) - (int)(p-str); - - switch (*(p+1)) { - case 'H': - string_sub(p,"%H", homedir, l); - break; - - case 'S': - string_sub(p,"%S", share, l); - break; - case 'p': - string_sub(p,"%p", automount_path(user), l); - break; - case '\0': - p++; - break; /* don't run off the end of the string */ - - default: p+=2; - break; - } - } - - standard_sub_advanced(snum, user, "", -1, current_user_info.smb_name, str); -} - -/**************************************************************************** Like standard_sub but by snum. ****************************************************************************/ diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3c0820491d..5be1fb2762 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1902,8 +1902,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, pstrcpy(newHomedir, pszHomedir); } else { pstrcpy(newHomedir, lp_pathname(iDefaultService)); - standard_sub_home(iDefaultService, pszHomename, user, - pszHomedir, newHomedir); + string_sub(newHomedir,"%H", pszHomedir, sizeof(newHomedir)); } string_set(&ServicePtrs[i]->szPath, newHomedir); @@ -1912,7 +1911,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, { pstring comment; slprintf(comment, sizeof(comment) - 1, - "Home directory of %s", pszHomename); + "Home directory of %s", user); string_set(&ServicePtrs[i]->comment, comment); } ServicePtrs[i]->bAvailable = sDefault.bAvailable; @@ -1921,7 +1920,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, DEBUG(3, ("adding home's share [%s] for user %s at %s\n", pszHomename, user, newHomedir)); - + return (True); } |