diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/service.c | 40 | ||||
-rw-r--r-- | source3/smbd/uid.c | 1 |
2 files changed, 34 insertions, 7 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 64b638346ae..7b3abe4c3e0 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -152,17 +152,45 @@ bool chdir_current_service(connection_struct *conn) ret = vfs_ChDir(conn, &connectpath_fname); if (ret != 0) { - DEBUG(((errno!=EACCES)?0:3), - ("chdir (%s) failed, reason: %s\n", - conn->connectpath, strerror(errno))); + int saved_errno = errno; + + if (saved_errno == EACCES) { + char *str = utok_string( + talloc_tos(), + conn->session_info->unix_token); + DBG_WARNING("vfs_ChDir(%s) got " + "permission denied, current " + "token: %s\n", + conn->connectpath, str); + TALLOC_FREE(str); + } else { + DBG_ERR("vfs_ChDir(%s) failed: " + "%s!\n", + conn->connectpath, + strerror(saved_errno)); + } return false; } ret = vfs_ChDir(conn, &origpath_fname); if (ret != 0) { - DEBUG(((errno!=EACCES)?0:3), - ("chdir (%s) failed, reason: %s\n", - conn->origpath, strerror(errno))); + int saved_errno = errno; + + if (saved_errno == EACCES) { + char *str = utok_string( + talloc_tos(), + conn->session_info->unix_token); + DBG_WARNING("vfs_ChDir(%s) got " + "permission denied, current " + "token: %s\n", + conn->origpath, str); + TALLOC_FREE(str); + } else { + DBG_ERR("vfs_ChDir(%s) failed: " + "%s!\n", + conn->origpath, + strerror(saved_errno)); + } return false; } diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 5425449d42c..8fa38e459dd 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -445,7 +445,6 @@ static bool change_to_user_internal(connection_struct *conn, if (current_user.need_chdir) { ok = chdir_current_service(conn); if (!ok) { - DBG_ERR("chdir_current_service() failed!\n"); return false; } current_user.done_chdir = true; |