diff options
author | Jeremy Allison <jra@samba.org> | 2009-10-01 10:23:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-10-01 10:23:29 -0700 |
commit | 00ce3e143f0a3dcf93b0d6745c4df6c7ba78a32d (patch) | |
tree | d2efc11a2fa9a3eb48ea1f7778593c717928f0b2 /source3/param | |
parent | 75f90772ce14cfbb8256ac7e897741e38b758e34 (diff) | |
download | samba-00ce3e143f0a3dcf93b0d6745c4df6c7ba78a32d.tar.gz samba-00ce3e143f0a3dcf93b0d6745c4df6c7ba78a32d.tar.bz2 samba-00ce3e143f0a3dcf93b0d6745c4df6c7ba78a32d.zip |
Fix for CVE-2009-2813.
===========================================================
== Subject: Misconfigured /etc/passwd file may share folders unexpectedly
==
== CVE ID#: CVE-2009-2813
==
== Versions: All versions of Samba later than 3.0.11
==
== Summary: If a user in /etc/passwd is misconfigured to have
== an empty home directory then connecting to the home
== share of this user will use the root of the filesystem
== as the home directory.
===========================================================
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b278b9616d..b1f2a4aeb5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6156,6 +6156,11 @@ bool lp_add_home(const char *pszHomename, int iDefaultService, { int i; + if (pszHomename == NULL || user == NULL || pszHomedir == NULL || + pszHomedir[0] == '\0') { + return false; + } + i = add_a_service(ServicePtrs[iDefaultService], pszHomename); if (i < 0) @@ -8127,7 +8132,7 @@ static void lp_add_auto_services(char *str) home = get_user_home_dir(talloc_tos(), p); - if (home && homes >= 0) + if (home && home[0] && homes >= 0) lp_add_home(p, homes, p, home); TALLOC_FREE(home); |