s3-vfs_gpfs: Fix bug #9003, posix acl on gpfs
authorVolker Lendecke <vl@samba.org>
Fri, 22 Jun 2012 13:46:13 +0000 (15:46 +0200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 30 Jun 2012 11:22:25 +0000 (13:22 +0200)
gpfs2smb_acl can leave errno!=0 around even if it returned a correct
result!=NULL. We can only rely on errno being set if another error
condition (in this case result==NULL) indicates an error. If
result!=NULL, errno is undefined and can be anything. This leads to
SAFE_FREE(result) further down even in the success case.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 22 19:27:39 CEST 2012 on sn-devel-104
(cherry picked from commit e7b58146d8576ae8bf4eaf2ec1063fe7697e05b8)

source3/modules/vfs_gpfs.c

index 08e5f556eadab86f7ccf486aee68fc108494ce75..0c86ea8e7e97bb7ceaf0d4ce000b4871047d839b 100644 (file)
@@ -598,8 +598,8 @@ static SMB_ACL_T gpfsacl_get_posix_acl(const char *path, gpfs_aclType_t type)
                   pacl->acl_nace));
 
        result = gpfs2smb_acl(pacl);
-       if (result == NULL) {
-               goto done;
+       if (result != NULL) {
+               errno = 0;
        }
 
  done: