diff options
author | Jeremy Allison <jra@samba.org> | 1998-05-07 19:04:14 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-05-07 19:04:14 +0000 |
commit | 1fd8d12ca414066acec71b33eb8a13e16c2acd3a (patch) | |
tree | a178c1124afa017e51240063f6b9ef0cc06bc68a /source/lib/util.c | |
parent | 57b01ad4ffb14ebd600d4e66602b54ed987f6106 (diff) | |
download | samba-1fd8d12ca414066acec71b33eb8a13e16c2acd3a.tar.gz samba-1fd8d12ca414066acec71b33eb8a13e16c2acd3a.tar.xz samba-1fd8d12ca414066acec71b33eb8a13e16c2acd3a.zip |
This should (hopefully :-) be the final fix for the %U %G substitution
problem....
smbpass.c: Removed Luke's dire warning - as some of the functions in here
*need* to be called externally :-).
Jeremy.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index f5cfb974a2d..24161108579 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -4000,16 +4000,32 @@ void standard_sub_basic(char *str) { char *s, *p; char pidstr[10]; + struct passwd *pass; + char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user; for (s = str ; s && *s && (p = strchr(s,'%')); s = p ) { switch (*(p+1)) { + case 'G' : + { + if ((pass = Get_Pwnam(username,False))!=NULL) + { + string_sub(p,"%G",gidtoname(pass->pw_gid)); + } + else + { + p += 2; + } + break; + } + case 'N' : string_sub(p,"%N", automount_server(username)); break; case 'I' : string_sub(p,"%I", client_addr(Client)); break; case 'L' : string_sub(p,"%L", local_machine); break; case 'M' : string_sub(p,"%M", client_name(Client)); 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' : { |