diff options
author | Gerald Carter <jerry@samba.org> | 2002-01-07 19:19:50 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-01-07 19:19:50 +0000 |
commit | 31b452902b7cb6186a051de5df62908445d59427 (patch) | |
tree | 16850bb5d159438b03770508e44ec6d17b3e9012 | |
parent | 36b6460ea716cba8201ecf7d2f5558e9b192e773 (diff) | |
download | samba-31b452902b7cb6186a051de5df62908445d59427.tar.gz samba-31b452902b7cb6186a051de5df62908445d59427.tar.xz samba-31b452902b7cb6186a051de5df62908445d59427.zip |
fixed infinite recusion bug when +path = %H" is explicitly set in [homes].
HEAD does not suffer from thyis as get_user_heom_dir() does not use the
service path, but only the Get_Pwnam().
However I cannot make that change is 2.2, because it would be fairly
intrusive. due to dependencies.
-rw-r--r-- | source/lib/substitute.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/lib/substitute.c b/source/lib/substitute.c index 8faa48441dc..e171fc7ab05 100644 --- a/source/lib/substitute.c +++ b/source/lib/substitute.c @@ -225,6 +225,7 @@ void standard_sub_basic(char *str) void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, char *str) { char *p, *s, *home; + struct passwd *pw; for (s=str; (p=strchr(s, '%'));s=p) { int l = sizeof(pstring) - (int)(p-str); @@ -232,8 +233,8 @@ void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, c switch (*(p+1)) { case 'N' : string_sub(p,"%N", automount_server(user),l); break; case 'H': - if ((home = get_user_home_dir(user))) { - string_sub(p,"%H",home, l); + if ((pw=Get_Pwnam(user, False)) != NULL) { + string_sub(p,"%H",pw->pw_dir, l); } else { p += 2; } |