summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-03 18:14:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:50 -0500
commit775056f8e494b716276c9f6b1c6130587a8df9ec (patch)
treead0c5409e5214b053c5181f10cff5af648478aa8 /source3/smbd
parent3d081be06b1d2b57d7125b98ee0d6c7ef3fe552e (diff)
downloadsamba-775056f8e494b716276c9f6b1c6130587a8df9ec.tar.gz
samba-775056f8e494b716276c9f6b1c6130587a8df9ec.tar.bz2
samba-775056f8e494b716276c9f6b1c6130587a8df9ec.zip
r10693: Fix bug #3129, reported by Adam Porter <sambabugzilla@alphapapa.net>.
Rotten error message caused hours of wasted time. Jeremy. (This used to be commit f391f065b240d5731d178f9d4a46ffc3315117bc)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/service.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index d330e847e2..52f9229ee1 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -272,6 +272,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
SMB_STRUCT_STAT st;
fstring user;
fstring dev;
+ int ret;
*user = 0;
fstrcpy(dev, pdev);
@@ -554,7 +555,6 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
/* Preexecs are done here as they might make the dir we are to ChDir to below */
/* execute any "root preexec = " line */
if (*lp_rootpreexec(snum)) {
- int ret;
pstring cmd;
pstrcpy(cmd,lp_rootpreexec(snum));
standard_sub_conn(conn,cmd,sizeof(cmd));
@@ -584,7 +584,6 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
/* Preexecs are done here as they might make the dir we are to ChDir to below */
/* execute any "preexec = " line */
if (*lp_preexec(snum)) {
- int ret;
pstring cmd;
pstrcpy(cmd,lp_preexec(snum));
standard_sub_conn(conn,cmd,sizeof(cmd));
@@ -629,8 +628,13 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
check during individual operations. To match this behaviour
I have disabled this chdir check (tridge) */
/* the alternative is just to check the directory exists */
- if (SMB_VFS_STAT(conn, conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) {
- DEBUG(0,("'%s' does not exist or is not a directory, when connecting to [%s]\n", conn->connectpath, lp_servicename(snum)));
+ if ((ret = SMB_VFS_STAT(conn, conn->connectpath, &st)) != 0 || !S_ISDIR(st.st_mode)) {
+ if (ret == 0 && !S_ISDIR(st.st_mode)) {
+ DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", conn->connectpath, lp_servicename(snum)));
+ } else {
+ DEBUG(0,("'%s' does not exist or permission denied when connecting to [%s] "
+ "Error was %s\n", conn->connectpath, lp_servicename(snum), strerror(errno) ));
+ }
change_to_root_user();
/* Call VFS disconnect hook */
SMB_VFS_DISCONNECT(conn);