From: Jeremy Allison Date: Tue, 1 Mar 2005 21:26:01 +0000 (+0000) Subject: r5607: Fix for bug #2399 - ensure we use SMB_VFS_STAT instead of stat X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5198 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08aac40e3ac0911673ea7e6ef35ba7fe9822d2fd;p=thirdparty%2Fsamba.git r5607: Fix for bug #2399 - ensure we use SMB_VFS_STAT instead of stat when checking for existance of a pathname. Jeremy. --- diff --git a/source/smbd/service.c b/source/smbd/service.c index f199fe3ade6..bc74a28fafb 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -278,6 +278,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, *user = 0; fstrcpy(dev, pdev); + ZERO_STRUCT(st); if (NT_STATUS_IS_ERR(*status = share_sanity_checks(snum, dev))) { return NULL; @@ -622,7 +623,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, } #else /* the alternative is just to check the directory exists */ - if (stat(conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { + 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(conn)))); change_to_root_user(); yield_connection(conn, lp_servicename(SNUM(conn)));