The branch, v3-6-test has been updated
       via  b5243a5 check_parent_exists() can change errno. Ensure we preserve 
it across calls.
      from  5e6dfd1 BUG 9881: Check for system libtevent.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit b5243a52a237b524b7afb8125c4b75378af622d1
Author: Anand Avati <[email protected]>
Date:   Mon Apr 29 15:21:00 2013 -0700

    check_parent_exists() can change errno. Ensure we preserve it across calls.
    
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Tue Apr 30 11:00:11 CEST 2013 on sn-devel-104
    
    Fix bug #9927 - errno gets overwritten in call to check_parent_exists().

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/filename.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index b2ed239..207b56c 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -445,13 +445,17 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
                if (errno == ENOENT) {
                        /* Optimization when creating a new file - only
-                          the last component doesn't exist. */
+                          the last component doesn't exist.
+                          NOTE : check_parent_exists() doesn't preserve errno.
+                       */
+                       int saved_errno = errno;
                        status = check_parent_exists(ctx,
                                                conn,
                                                posix_pathnames,
                                                smb_fname,
                                                &dirpath,
                                                &start);
+                       errno = saved_errno;
                        if (!NT_STATUS_IS_OK(status)) {
                                goto fail;
                        }
@@ -524,13 +528,16 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                 * Optimization for common case where the wildcard
                 * is in the last component and the client already
                 * sent the correct case.
+                * NOTE : check_parent_exists() doesn't preserve errno.
                 */
+               int saved_errno = errno;
                status = check_parent_exists(ctx,
                                        conn,
                                        posix_pathnames,
                                        smb_fname,
                                        &dirpath,
                                        &start);
+               errno = saved_errno;
                if (!NT_STATUS_IS_OK(status)) {
                        goto fail;
                }


-- 
Samba Shared Repository

Reply via email to