summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-25 18:39:31 +0000
committerJeremy Allison <jra@samba.org>2001-04-25 18:39:31 +0000
commit38df1d94be851f7b534dd7b6e3d20c5052acb42a (patch)
treeae06d0763a4fc4ac7ea8a1e2a694627c25de982f /source3
parent5472466befe19e52a59f892a5e920211fe2952f7 (diff)
downloadsamba-38df1d94be851f7b534dd7b6e3d20c5052acb42a.tar.gz
samba-38df1d94be851f7b534dd7b6e3d20c5052acb42a.tar.bz2
samba-38df1d94be851f7b534dd7b6e3d20c5052acb42a.zip
Fixed %U and %D substitutions. %U is lowercase user name, %D is uppercase
domain name. Jeremy. (This used to be commit 5f005952f6d8c281cf91ac0855e83342a2fd7e45)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/substitute.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 6abdeea114..25be4b030f 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -172,9 +172,21 @@ void standard_sub_basic(char *str)
fstring pidstr;
for (s=str; (p=strchr(s, '%'));s=p) {
+ fstring tmp_str;
+
int l = sizeof(pstring) - (int)(p-str);
switch (*(p+1)) {
+ case 'U' :
+ fstrcpy(tmp_str, sam_logon_in_ssb?samlogon_user:current_user_info.smb_name);
+ strlower(tmp_str);
+ string_sub(p,"%U",tmp_str,l);
+ break;
+ case 'D' :
+ fstrcpy(tmp_str, current_user_info.domain);
+ strupper(tmp_str);
+ string_sub(p,"%D", tmp_str,l);
+ break;
case 'I' : string_sub(p,"%I", client_addr(),l); break;
case 'L' : string_sub(p,"%L", local_machine,l); break;
case 'M' : string_sub(p,"%M", client_name(),l); break;
@@ -212,7 +224,6 @@ void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, c
int l = sizeof(pstring) - (int)(p-str);
switch (*(p+1)) {
- case 'U' : string_sub(p,"%U",sam_logon_in_ssb?samlogon_user:current_user_info.smb_name,l); break;
case 'G' :
if ((pass = Get_Pwnam(user,False))!=NULL) {
string_sub(p,"%G",gidtoname(pass->pw_gid),l);
@@ -220,7 +231,6 @@ void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, c
p += 2;
}
break;
- case 'D' : string_sub(p,"%D", current_user_info.domain,l); break;
case 'N' : string_sub(p,"%N", automount_server(user),l); break;
case 'H':
if ((home = get_user_home_dir(user))) {