[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Sep 27 02:04:10 UTC 2016
The branch, master has been updated
via 71937b1 s3/vfs/nfs4_acls: avoid a stat
from 85a309b s3-rpc_client: use spoolss_driver_version_to_qword in winreg_printer_ver_to_qword
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 71937b16bf167fa1a338cd2563743f87d8688b44
Author: Ralph Boehme <slow at samba.org>
Date: Sun Sep 11 13:30:44 2016 +0200
s3/vfs/nfs4_acls: avoid a stat
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Sep 27 04:03:03 CEST 2016 on sn-devel-144
-----------------------------------------------------------------------
Summary of changes:
source3/modules/nfs4_acls.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 6fe3b11..7488b1c 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -529,11 +529,19 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
{
SMB_STRUCT_STAT sbuf;
struct smbacl4_vfs_params params;
+ SMB_STRUCT_STAT *psbuf = NULL;
DEBUG(10, ("smb_fget_nt_acl_nfs4 invoked for %s\n", fsp_str_dbg(fsp)));
- if (smbacl4_fGetFileOwner(fsp, &sbuf)) {
- return map_nt_error_from_unix(errno);
+ if (VALID_STAT(fsp->fsp_name->st)) {
+ psbuf = &fsp->fsp_name->st;
+ }
+
+ if (psbuf == NULL) {
+ if (smbacl4_fGetFileOwner(fsp, &sbuf)) {
+ return map_nt_error_from_unix(errno);
+ }
+ psbuf = &sbuf;
}
if (pparams == NULL) {
@@ -544,7 +552,7 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
pparams = ¶ms;
}
- return smb_get_nt_acl_nfs4_common(&sbuf, pparams, security_info,
+ return smb_get_nt_acl_nfs4_common(psbuf, pparams, security_info,
mem_ctx, ppdesc, theacl);
}
@@ -558,12 +566,20 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
{
SMB_STRUCT_STAT sbuf;
struct smbacl4_vfs_params params;
+ const SMB_STRUCT_STAT *psbuf = NULL;
DEBUG(10, ("smb_get_nt_acl_nfs4 invoked for %s\n",
smb_fname->base_name));
- if (smbacl4_GetFileOwner(conn, smb_fname, &sbuf)) {
- return map_nt_error_from_unix(errno);
+ if (VALID_STAT(smb_fname->st)) {
+ psbuf = &smb_fname->st;
+ }
+
+ if (psbuf == NULL) {
+ if (smbacl4_GetFileOwner(conn, smb_fname, &sbuf)) {
+ return map_nt_error_from_unix(errno);
+ }
+ psbuf = &sbuf;
}
if (pparams == NULL) {
@@ -574,7 +590,7 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
pparams = ¶ms;
}
- return smb_get_nt_acl_nfs4_common(&sbuf, pparams, security_info,
+ return smb_get_nt_acl_nfs4_common(psbuf, pparams, security_info,
mem_ctx, ppdesc, theacl);
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list