diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-05-08 10:28:03 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-05-08 10:56:28 +0200 |
commit | f946668b7ad1ecc1990fa8ee0499c63c4aac6ea6 (patch) | |
tree | 38a8000c9b323352444619101a27278a7b0e6798 /source3 | |
parent | 8b2ba64d603dd1ef1afde621f594dc46f2133708 (diff) | |
download | samba-f946668b7ad1ecc1990fa8ee0499c63c4aac6ea6.tar.gz samba-f946668b7ad1ecc1990fa8ee0499c63c4aac6ea6.tar.bz2 samba-f946668b7ad1ecc1990fa8ee0499c63c4aac6ea6.zip |
Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is
Andrew Bartlett
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/util_sock.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index ca355c2709..922213d8f6 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1166,14 +1166,21 @@ int create_pipe_sock(const char *socket_dir, } else { /* Check ownership and permission on existing directory */ if (!S_ISDIR(st.st_mode)) { - DEBUG(0, ("socket directory %s isn't a directory\n", + DEBUG(0, ("socket directory '%s' isn't a directory\n", socket_dir)); goto out_umask; } - if ((st.st_uid != sec_initial_uid()) || - ((st.st_mode & 0777) != dir_perms)) { - DEBUG(0, ("invalid permissions on socket directory " - "%s\n", socket_dir)); + if (st.st_uid != sec_initial_uid()) { + DEBUG(0, ("invalid ownership on directory " + "'%s'\n", socket_dir)); + umask(old_umask); + goto out_umask; + } + if ((st.st_mode & 0777) != dir_perms) { + DEBUG(0, ("invalid permissions on directory " + "'%s': has 0%o should be 0%o\n", socket_dir, + (st.st_mode & 0777), dir_perms)); + umask(old_umask); goto out_umask; } } |