s3:modules/non_posix_acls: only stat if we do not have it cached
authorChristian Ambach <ambi@samba.org>
Tue, 30 Oct 2012 12:43:59 +0000 (13:43 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 4 Feb 2013 11:19:30 +0000 (12:19 +0100)
most probably we already have the stat() information

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/non_posix_acls.c

index 245b5c8d21827df8dd2a9dbb07b3a2a9d07988f1..6c1dfbf3598f219c5b34882564ba911a45a9275f 100644 (file)
@@ -79,10 +79,14 @@ int non_posix_sys_acl_blob_get_fd_helper(vfs_handle_struct *handle,
 
        acl_wrapper.acl_as_blob = acl_as_blob;
 
-       ret = smb_vfs_call_fstat(handle, fsp, &sbuf);
-       if (ret == -1) {
-               TALLOC_FREE(frame);
-               return -1;
+       if (!VALID_STAT(fsp->fsp_name->st)) {
+               ret = smb_vfs_call_fstat(handle, fsp, &sbuf);
+               if (ret == -1) {
+                       TALLOC_FREE(frame);
+                       return -1;
+               }
+       } else {
+               sbuf = fsp->fsp_name->st;
        }
 
        acl_wrapper.owner = sbuf.st_ex_uid;