]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5607: Fix for bug #2399 - ensure we use SMB_VFS_STAT instead of stat
authorJeremy Allison <jra@samba.org>
Tue, 1 Mar 2005 21:26:01 +0000 (21:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:50 +0000 (10:55 -0500)
when checking for existance of a pathname.
Jeremy.

source/smbd/service.c

index f199fe3ade6abe5f290de018aa2a846dceacf994..bc74a28fafbf2fed129dbfab5f6a7ab8fe6fa8e4 100644 (file)
@@ -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)));