diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-19 15:33:25 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-19 15:33:25 +0000 |
commit | 54ffd7f5c9251382874d9c47611d5c666f782f6b (patch) | |
tree | 7cfd86da716891798bddbfdce4667f156ba562c2 /source3/lib | |
parent | b0c148793b8ac4b62e9a66ce7e269ab50b90bf8d (diff) | |
download | samba-54ffd7f5c9251382874d9c47611d5c666f782f6b.tar.gz samba-54ffd7f5c9251382874d9c47611d5c666f782f6b.tar.bz2 samba-54ffd7f5c9251382874d9c47611d5c666f782f6b.zip |
Makefile :
added srvparse.o and pipesrvsvc.o
smb.h :
mods to the Net Share Enum stuff
srvparse.c :
Net Share Enum parsing support. more srvsvc pipe parsing to go here...
pipenetlog.c util.c:
modified standard_sub_basic() so that you can set a global boolean
and use a different string for the %U username substitution.
proto.h:
the usual.
(This used to be commit 22b86b6499b2680d16cb4180a736b4e750147409)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 78 |
1 files changed, 47 insertions, 31 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index b69b30d20c..36e9e326ac 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -72,7 +72,12 @@ static enum remote_arch_types ra_type = RA_UNKNOWN; fstring remote_proto="UNKNOWN"; pstring myhostname=""; pstring user_socket_options=""; + pstring sesssetup_user=""; +pstring samlogon_user=""; + +BOOL sam_logon_in_ssb = False; + pstring myname = ""; fstring myworkgroup = ""; char **my_netbios_names; @@ -3603,38 +3608,49 @@ Rewritten by Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> and Paul Rippin <pr3245@nopc.eurostat.cec.be> ********************************************************************/ void standard_sub_basic(char *str) - { - char *s, *p; - char pidstr[10]; - struct passwd *pass; +{ + char *s, *p; + char pidstr[10]; + struct passwd *pass; + char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user; - for (s = str ; (p = strchr(s,'%')) != NULL ; s = p ) - { - switch (*(p+1)) - { - case 'G' : if ((pass = Get_Pwnam(sesssetup_user,False))!=NULL) - string_sub(p,"%G",gidtoname(pass->pw_gid)); - else - p += 2; - break; - case 'I' : string_sub(p,"%I",client_addr()); break; - case 'L' : string_sub(p,"%L",local_machine); break; - case 'M' : string_sub(p,"%M",client_name()); break; - case 'R' : string_sub(p,"%R",remote_proto); break; - case 'T' : string_sub(p,"%T",timestring()); break; - case 'U' : string_sub(p,"%U",sesssetup_user); break; - case 'a' : string_sub(p,"%a",remote_arch); break; - case 'd' : sprintf(pidstr,"%d",(int)getpid()); - string_sub(p,"%d",pidstr); - break; - case 'h' : string_sub(p,"%h",myhostname); break; - case 'm' : string_sub(p,"%m",remote_machine); break; - case 'v' : string_sub(p,"%v",VERSION); break; - case '\0' : p++; break; /* don't run off end if last character is % */ - default : p+=2; break; - } - } - return; + for (s = str ; (p = strchr(s,'%')) != NULL ; s = p ) + { + switch (*(p+1)) + { + case 'G' : + { + if ((pass = Get_Pwnam(sesssetup_user,False))!=NULL) + { + string_sub(p,"%G",gidtoname(pass->pw_gid)); + } + else + { + p += 2; + } + break; + } + case 'I' : string_sub(p,"%I", client_addr()); break; + case 'L' : string_sub(p,"%L", local_machine); break; + case 'M' : string_sub(p,"%M", client_name()); break; + case 'R' : string_sub(p,"%R", remote_proto); break; + case 'T' : string_sub(p,"%T", timestring()); break; + case 'U' : string_sub(p,"%U", username); break; + case 'a' : string_sub(p,"%a", remote_arch); break; + case 'd' : + { + sprintf(pidstr,"%d",(int)getpid()); + string_sub(p,"%d", pidstr); + break; + } + case 'h' : string_sub(p,"%h", myhostname); break; + case 'm' : string_sub(p,"%m", remote_machine); break; + case 'v' : string_sub(p,"%v", VERSION); break; + case '\0': p++; break; /* don't run off end if last character is % */ + default : p+=2; break; + } + } + return; } /******************************************************************* |