diff options
author | Gerald Carter <jerry@samba.org> | 2004-10-18 19:57:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:59 -0500 |
commit | c53e6401eb3de7fa4abc85c25f8672b624cf2c66 (patch) | |
tree | 8577b52d10dc7cc3e03ceffd7f8c7666acb896a1 /source3/lib | |
parent | b0202c7b851bb15f856ba526857e8b2f7cfabfec (diff) | |
download | samba-c53e6401eb3de7fa4abc85c25f8672b624cf2c66.tar.gz samba-c53e6401eb3de7fa4abc85c25f8672b624cf2c66.tar.bz2 samba-c53e6401eb3de7fa4abc85c25f8672b624cf2c66.zip |
r3049: fixing some calls in the printing code to stanard_sub_basic(); fix standard_sub_snum() to use the current user's gid; add some (snum == -1) checks to standard_sub_advanced()
(This used to be commit 8c3fd1908d201e9891878ff4c3259ed9690dff97)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/substitute.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 44e791b790..92eff625f3 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -446,7 +446,8 @@ static void standard_sub_advanced(int snum, const char *user, string_sub(p,"%P", connectpath, l); break; case 'S': - string_sub(p,"%S", lp_servicename(snum), l); + if ( snum != -1 ) + string_sub(p,"%S", lp_servicename(snum), l); break; case 'g': string_sub(p,"%g", gidtoname(gid), l); @@ -463,7 +464,8 @@ static void standard_sub_advanced(int snum, const char *user, * "path =" string in [homes] and so needs the * service name, not the username. */ case 'p': - string_sub(p,"%p", automount_path(lp_servicename(snum)), l); + if ( snum != -1 ) + string_sub(p,"%p", automount_path(lp_servicename(snum)), l); break; case '\0': p++; @@ -797,6 +799,6 @@ void standard_sub_snum(int snum, char *str, size_t len) cached_uid = current_user.uid; } - standard_sub_advanced(snum, cached_user, "", -1, + standard_sub_advanced(snum, cached_user, "", current_user.gid, smb_user_name, str, len); } |