From a2bddb20ed078c3e1b9cb60a7420b3d107898f52 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 May 1998 01:34:51 +0000 Subject: Fixes for the %U and %G problems people have reported. Essentially, multiple session_setup_and_X's may be done to an smbd. As there is only one global variable containing the requested connection name (sessionsetup_user), then any subsequent sessionsetups overwrite this name (causing %U and %G to get the wrong name). This is particularly common when an NT client does a null session setup to get a browse list after the user has connected, but before a share has been mounted. These changes store the requested_name in the vuid structure (so this only really works for user level and above security) and copies this name back into the global variable before the standard_sub call. Jeremy. (This used to be commit b5187ad6a3b3af9fbbeee8bced0ab16b41e9825b) --- source3/printing/printing.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/printing/printing.c') diff --git a/source3/printing/printing.c b/source3/printing/printing.c index c7db5744e2..bbc0ff6144 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -103,7 +103,7 @@ static char *build_print_command(int cnum, char *command, char *syscmd, char *fi string_sub(syscmd, "%p", tstr); - standard_sub(cnum,syscmd); + standard_sub(cnum,syscmd,UID_FIELD_INVALID); return (syscmd); } @@ -1056,7 +1056,7 @@ int get_printqueue(int snum,int cnum,print_queue_struct **queue, pstrcpy(syscmd,lpq_command); string_sub(syscmd,"%p",printername); - standard_sub(cnum,syscmd); + standard_sub(cnum,syscmd,UID_FIELD_INVALID); sprintf(outfile,"%s/lpq.%08x",tmpdir(),str_checksum(syscmd)); @@ -1147,7 +1147,7 @@ void del_printqueue(int cnum,int snum,int jobid) pstrcpy(syscmd,lprm_command); string_sub(syscmd,"%p",printername); string_sub(syscmd,"%j",jobstr); - standard_sub(cnum,syscmd); + standard_sub(cnum,syscmd,UID_FIELD_INVALID); ret = smbrun(syscmd,NULL,False); DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret)); @@ -1185,7 +1185,7 @@ void status_printjob(int cnum,int snum,int jobid,int status) pstrcpy(syscmd,lpstatus_command); string_sub(syscmd,"%p",printername); string_sub(syscmd,"%j",jobstr); - standard_sub(cnum,syscmd); + standard_sub(cnum,syscmd,UID_FIELD_INVALID); ret = smbrun(syscmd,NULL,False); DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret)); -- cgit