[SCM] Samba Shared Repository - branch v3-6-test updated

Volker Lendecke vlendec at samba.org
Sat Jan 15 12:16:21 MST 2011


The branch, v3-6-test has been updated
       via  313b42a s3: Avoid some calls to cli_errstr
      from  fc8f2fb s3: Convert cli_set_secdesc to cli_trans

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


- Log -----------------------------------------------------------------
commit 313b42aa671517df4b19c7968ecb64d583439e88
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jan 15 16:32:00 2011 +0100

    s3: Avoid some calls to cli_errstr
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sat Jan 15 17:18:54 CET 2011 on sn-devel-104

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

Summary of changes:
 source3/utils/smbcacls.c |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 6a8169d..1ac3731 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -667,22 +667,25 @@ get fileinfo for filename
 static uint16 get_fileinfo(struct cli_state *cli, const char *filename)
 {
 	uint16_t fnum = (uint16_t)-1;
-	uint16 mode;
+	uint16 mode = 0;
+	NTSTATUS status;
 
 	/* The desired access below is the only one I could find that works
 	   with NT4, W2KP and Samba */
 
-	if (!NT_STATUS_IS_OK(cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ,
-                                          0, FILE_SHARE_READ|FILE_SHARE_WRITE,
-                                          FILE_OPEN, 0x0, 0x0, &fnum))) {
-		printf("Failed to open %s: %s\n", filename, cli_errstr(cli));
+	status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ,
+			      0, FILE_SHARE_READ|FILE_SHARE_WRITE,
+			      FILE_OPEN, 0x0, 0x0, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("Failed to open %s: %s\n", filename, nt_errstr(status));
+		return 0;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_qfileinfo_basic(
-				     cli, fnum, &mode, NULL, NULL, NULL,
-				     NULL, NULL, NULL))) {
+	status = cli_qfileinfo_basic(cli, fnum, &mode, NULL, NULL, NULL,
+				     NULL, NULL, NULL);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("Failed to file info %s: %s\n", filename,
-                                                       cli_errstr(cli));
+		       nt_errstr(status));
         }
 
 	cli_close(cli, fnum);
@@ -697,14 +700,16 @@ static struct security_descriptor *get_secdesc(struct cli_state *cli, const char
 {
 	uint16_t fnum = (uint16_t)-1;
 	struct security_descriptor *sd;
+	NTSTATUS status;
 
 	/* The desired access below is the only one I could find that works
 	   with NT4, W2KP and Samba */
 
-	if (!NT_STATUS_IS_OK(cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ,
-                                          0, FILE_SHARE_READ|FILE_SHARE_WRITE,
-                                          FILE_OPEN, 0x0, 0x0, &fnum))) {
-		printf("Failed to open %s: %s\n", filename, cli_errstr(cli));
+	status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ,
+			      0, FILE_SHARE_READ|FILE_SHARE_WRITE,
+			      FILE_OPEN, 0x0, 0x0, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("Failed to open %s: %s\n", filename, nt_errstr(status));
 		return NULL;
 	}
 
@@ -732,11 +737,12 @@ static bool set_secdesc(struct cli_state *cli, const char *filename,
 	/* The desired access below is the only one I could find that works
 	   with NT4, W2KP and Samba */
 
-	if (!NT_STATUS_IS_OK(cli_ntcreate(cli, filename, 0,
-                                          WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS,
-                                          0, FILE_SHARE_READ|FILE_SHARE_WRITE,
-                                          FILE_OPEN, 0x0, 0x0, &fnum))) {
-		printf("Failed to open %s: %s\n", filename, cli_errstr(cli));
+	status = cli_ntcreate(cli, filename, 0,
+			      WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS,
+			      0, FILE_SHARE_READ|FILE_SHARE_WRITE,
+			      FILE_OPEN, 0x0, 0x0, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("Failed to open %s: %s\n", filename, nt_errstr(status));
 		return false;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list