mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Merge Gerry's %G change from 2.2.2.
Jeremy.
(This used to be commit d8262286dd
)
This commit is contained in:
parent
904fca7684
commit
9a903a08a7
@ -167,6 +167,7 @@ void standard_sub_basic(char *str)
|
||||
{
|
||||
char *p, *s;
|
||||
fstring pidstr;
|
||||
struct passwd *pass;
|
||||
|
||||
for (s=str; (p=strchr_m(s, '%'));s=p) {
|
||||
fstring tmp_str;
|
||||
@ -179,6 +180,13 @@ void standard_sub_basic(char *str)
|
||||
strlower(tmp_str);
|
||||
string_sub(p,"%U",tmp_str,l);
|
||||
break;
|
||||
case 'G' :
|
||||
if ((pass = Get_Pwnam(current_user_info.smb_name, False))!=NULL) {
|
||||
string_sub(p,"%G",gidtoname(pass->pw_gid),l);
|
||||
} else {
|
||||
p += 2;
|
||||
}
|
||||
break;
|
||||
case 'D' :
|
||||
fstrcpy(tmp_str, current_user_info.domain);
|
||||
strupper(tmp_str);
|
||||
@ -221,13 +229,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 'G' :
|
||||
if ((pass = Get_Pwnam(user,False))!=NULL) {
|
||||
string_sub(p,"%G",gidtoname(pass->pw_gid),l);
|
||||
} else {
|
||||
p += 2;
|
||||
}
|
||||
break;
|
||||
case 'N' : string_sub(p,"%N", automount_server(user),l); break;
|
||||
case 'H':
|
||||
if ((home = get_user_home_dir(user))) {
|
||||
|
Loading…
Reference in New Issue
Block a user