summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-05-07 19:04:14 +0000
committerJeremy Allison <jra@samba.org>1998-05-07 19:04:14 +0000
commit01df1ed95f880a671ead7bc92b3bcff01a2e2dc0 (patch)
tree7cb5a01b50e86b2e7129aa67e63ef47a24b72a04 /source3/lib
parentd8d9f7723337c267a8740750fe19a6387cfbb1f6 (diff)
downloadsamba-01df1ed95f880a671ead7bc92b3bcff01a2e2dc0.tar.gz
samba-01df1ed95f880a671ead7bc92b3bcff01a2e2dc0.tar.bz2
samba-01df1ed95f880a671ead7bc92b3bcff01a2e2dc0.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. (This used to be commit 1fd8d12ca414066acec71b33eb8a13e16c2acd3a)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index f5cfb974a2..2416110857 100644
--- a/source3/lib/util.c
+++ b/source3/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' :
{