do not log chdir with level 0 if reason is access denied
authorChristian Ambach <christian.ambach@de.ibm.com>
Tue, 21 Jul 2009 11:56:17 +0000 (13:56 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 21 Jul 2009 17:05:21 +0000 (10:05 -0700)
this changes the level of logs caused by users trying to access shares
or subdirectories for which they do not have access to in the ACL

this can fill up the samba log even with log level 0 and is more an
expected kind of logs that IMHO should not be logged with such a high
level.

All other errors while chdir() will still be logged with level 0

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
source3/smbd/service.c

index 0124b2b047cbdabf72bd816b5ad8acd5315ad1e6..a043288bc90000bc35686b803ca1ba4985d2c122 100644 (file)
@@ -182,8 +182,8 @@ bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir)
        if (do_chdir &&
            vfs_ChDir(conn,conn->connectpath) != 0 &&
            vfs_ChDir(conn,conn->origpath) != 0) {
        if (do_chdir &&
            vfs_ChDir(conn,conn->connectpath) != 0 &&
            vfs_ChDir(conn,conn->origpath) != 0) {
-               DEBUG(0,("chdir (%s) failed\n",
-                        conn->connectpath));
+                DEBUG(((errno!=EACCES)?0:3),("chdir (%s) failed, reason: %s\n",
+                         conn->connectpath, strerror(errno)));
                return(False);
        }
 
                return(False);
        }