From c53e6401eb3de7fa4abc85c25f8672b624cf2c66 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 18 Oct 2004 19:57:03 +0000 Subject: 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) --- source3/lib/substitute.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/lib') 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); } -- cgit