[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Aug 26 19:55:01 UTC 2022


The branch, master has been updated
       via  4ddd277c0b7 smbXcli: Pass negotiate contexts through smbXcli_negprot_send/recv
       via  a4f9f7c825c libsmb: Introduce helper var to cli_tree_connect_*_done()
       via  f3b2c2b5ef8 libsmb: Remove cli_full_connection_creds_sess_start()
       via  c31df02cb23 libsmb: Remove unused code
       via  05267304bd2 libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_qpathinfo2()
       via  ffc9072fc0f libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_getatr()
       via  767eb334803 libsmb: Correctly return ioctl error from cli_readlink()
       via  ba70eb480cb libsmb: Save a few lines in cli_unix_extensions_version()
       via  7b96948e4de libsmb: Add tevent_req_received() to cli_posix_readlink_recv()
       via  1025349ae23 lib: Fix a typo
       via  9fca3007ac9 smbd: Modernize DBG statements in open_fake_file()
       via  c047c6601f7 libsmb: Move static strings to the .text segment
       via  4df36cd170c examples: A tiny bit of README.Coding for teststat.c
       via  6a74546ab8c libsmb: Tab-indent SMBC_module_[init|terminate]()
       via  b93c2d5b372 libsmb: Fix a typo
       via  c53d86594a1 libsmb: Slightly simplify SMBC_parse_path()
       via  7c26512b6da smbd: Adapt np_[read|write]_send() to more recent tevent_req conventions
       via  556e1a5ee4e examples: Make libsmbclient samples look a *bit* less ugly
       via  df4c3f0f28e smbd: Save a line with tevent_req_nomem()
       via  7fe12e79f99 lib: Fix a typo
       via  3aa9d05ee4f dfs_server: Fix typos
       via  281b00a2b97 vfs: Fix a copy&paste error
       via  f05b529b0ea smbd: Adapt a call to setup_dfs_referral() to README.Coding
       via  9a1336024ae libsmbclient: Fix a typo
      from  b7c460b9028 vfs_glusterfs: Implement SMB_VFS_FSTATAT

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4ddd277c0b77c502ed6b11e07c92c91f24ac9c15
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 25 09:54:52 2022 +0200

    smbXcli: Pass negotiate contexts through smbXcli_negprot_send/recv
    
    We already don't allow setting max_credits in the sync wrapper, so
    omit the contexts there as well.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Aug 26 19:54:03 UTC 2022 on sn-devel-184

commit a4f9f7c825c216d25bd14beeb2e547d0fff74c51
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 25 10:43:54 2022 +0200

    libsmb: Introduce helper var to cli_tree_connect_*_done()
    
    README.Coding, makes it easier to debug
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f3b2c2b5ef8657e8d43044a67af866e29ee94f2e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 25 10:31:42 2022 +0200

    libsmb: Remove cli_full_connection_creds_sess_start()
    
    This contained very simple tevent_req logic, hiding that confused the
    code for me when reading. Also, this change saves 3 lines...
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c31df02cb231d4d975bd796020a250dac36a6bf1
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 23 13:13:48 2022 +0200

    libsmb: Remove unused code
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 05267304bd241067d61225f37ab0868b6f5e1ec3
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 23 12:59:50 2022 +0200

    libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_qpathinfo2()
    
    Not used
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ffc9072fc0f03fb7dcb833a098ef4acc66e20821
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 23 12:59:29 2022 +0200

    libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_getatr()
    
    Not used
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 767eb334803158c161a0e86993ff353c86de90d2
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Aug 14 16:13:32 2022 +0200

    libsmb: Correctly return ioctl error from cli_readlink()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ba70eb480cbdf3ceb414208e7d135b6647c99b7b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 13 15:43:47 2022 +0200

    libsmb: Save a few lines in cli_unix_extensions_version()
    
    This is more recent style for sync wrappers
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7b96948e4deb8841984054952efe1ea1222fe12f
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 13 15:42:50 2022 +0200

    libsmb: Add tevent_req_received() to cli_posix_readlink_recv()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1025349ae234cd3bbd43a0e5f911e7da089a5600
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 13 13:30:26 2022 +0200

    lib: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9fca3007ac9822fbf32ddbe425d31c767a1a5d8e
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Aug 12 12:49:07 2022 +0200

    smbd: Modernize DBG statements in open_fake_file()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c047c6601f735c2a89b290a7f10124c5432000b9
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 07:56:18 2022 +0200

    libsmb: Move static strings to the .text segment
    
    We don't need to copy these to the stack, this saves 200 bytes of .text
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4df36cd170c2f25e8b5b6c83b04949563c1303b2
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 11:40:11 2022 +0200

    examples: A tiny bit of README.Coding for teststat.c
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6a74546ab8cee9a60d1b0c317a1de7bd86f44cc2
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 12:08:44 2022 +0200

    libsmb: Tab-indent SMBC_module_[init|terminate]()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b93c2d5b372190bacfe64deeea32822cf4756f51
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 12:07:38 2022 +0200

    libsmb: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c53d86594a115f4b6c9970cbe5486237bd244d32
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 12:03:35 2022 +0200

    libsmb: Slightly simplify SMBC_parse_path()
    
    Don't manually duplicate the talloc_strndup() functionality
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7c26512b6da6b12cbb4f36d40292f9863a4b2536
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 10 08:39:12 2022 +0200

    smbd: Adapt np_[read|write]_send() to more recent tevent_req conventions
    
    We usually don't do "goto post_status;" anymore
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 556e1a5ee4e574679bbcbc13ba6091c17b6c9c51
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 17 10:51:06 2022 +0200

    examples: Make libsmbclient samples look a *bit* less ugly
    
    Remove trailing whitespace, indent to tabs. Yes, this introduces long
    lines, but makes review with "git show -w" trivial.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit df4c3f0f28e2385cfdace905da4ad3cc4a59dd43
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 29 14:57:54 2022 +0200

    smbd: Save a line with tevent_req_nomem()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7fe12e79f99fb590b3fca1b530c153e563856669
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 1 12:30:51 2022 +0200

    lib: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3aa9d05ee4faa81383b5e5af9d387f9fcc8d2338
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 10 08:13:26 2022 +0200

    dfs_server: Fix typos
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 281b00a2b97c49bbccce879f8073e67512e0f079
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 16:26:13 2022 +0200

    vfs: Fix a copy&paste error
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f05b529b0ea18e426d6c3753f05d693c5db3817b
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 14:51:10 2022 +0200

    smbd: Adapt a call to setup_dfs_referral() to README.Coding
    
    Makes it easier to handle in a debugger
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9a1336024aeb5938141ca23715917d6490cc4d0d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 25 10:34:51 2022 +0200

    libsmbclient: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 dfs_server/dfs_server_ad.c                  |    5 +-
 examples/libsmbclient/get_auth_data_fn.h    |  146 ++--
 examples/libsmbclient/testacl.c             |  214 +++---
 examples/libsmbclient/testacl2.c            |   96 +--
 examples/libsmbclient/testacl3.c            |  102 +--
 examples/libsmbclient/testbrowse.c          |  469 ++++++------
 examples/libsmbclient/testbrowse2.c         |  229 +++---
 examples/libsmbclient/testchmod.c           |  114 +--
 examples/libsmbclient/testctx.c             |   42 +-
 examples/libsmbclient/testfstatvfs.c        |  248 +++----
 examples/libsmbclient/testread.c            |  108 +--
 examples/libsmbclient/testsmbc.c            |  306 ++++----
 examples/libsmbclient/teststat.c            |  121 ++--
 examples/libsmbclient/teststat2.c           |   16 +-
 examples/libsmbclient/teststat3.c           |    9 +-
 examples/libsmbclient/teststatvfs.c         |  176 ++---
 examples/libsmbclient/testtruncate.c        |  136 ++--
 examples/libsmbclient/testutime.c           |  134 ++--
 examples/libsmbclient/testwrite.c           |  118 +--
 examples/libsmbclient/tree.c                | 1048 +++++++++++++--------------
 lib/util/charset/util_str.c                 |    9 +-
 libcli/smb/smbXcli_base.c                   |   80 +-
 libcli/smb/smbXcli_base.h                   |    9 +-
 source3/include/libsmbclient.h              |    2 +-
 source3/lib/util_malloc.c                   |    2 +-
 source3/libsmb/cli_smb2_fnum.c              |   15 -
 source3/libsmb/cliconnect.c                 |   43 +-
 source3/libsmb/clidfs.c                     |   23 -
 source3/libsmb/clifile.c                    |    1 +
 source3/libsmb/clifsinfo.c                  |    8 +-
 source3/libsmb/clisymlink.c                 |    5 +
 source3/libsmb/libsmb_context.c             |  143 ++--
 source3/libsmb/libsmb_path.c                |   10 +-
 source3/libsmb/libsmb_xattr.c               |    4 +-
 source3/modules/vfs_dfs_samba4.c            |    4 +-
 source3/rpc_server/srv_pipe_hnd.c           |  102 ++-
 source3/smbd/fake_file.c                    |   16 +-
 source3/smbd/smb1_trans2.c                  |    5 +-
 source3/smbd/smb2_query_directory.c         |    3 +-
 source3/torture/torture.c                   |   11 +-
 source4/libcli/raw/rawnegotiate.c           |    5 +-
 source4/libcli/smb2/connect.c               |    5 +-
 source4/libcli/smb_composite/connect_nego.c |    5 +-
 43 files changed, 2170 insertions(+), 2177 deletions(-)


Changeset truncated at 500 lines:

diff --git a/dfs_server/dfs_server_ad.c b/dfs_server/dfs_server_ad.c
index 7f4384f443e..b97d0882f94 100644
--- a/dfs_server/dfs_server_ad.c
+++ b/dfs_server/dfs_server_ad.c
@@ -70,8 +70,9 @@ static NTSTATUS fill_normal_dfs_referraltype(TALLOC_CTX *mem_ctx,
 	switch (version) {
 	case 4:
 		ref->version = version;
-		/* For the moment there is a bug with XP that don't seems to appriciate much
-		 * level4 so we return just level 3 for everyone
+		/* For the moment there is a bug with XP that doesn't
+		 * seem to appreciate much level4 so we return just
+		 * level 3 for everyone
 		 */
 		ref->referral.v4.server_type = DFS_SERVER_NON_ROOT;
 		/* "normal" referral seems to always include the GUID */
diff --git a/examples/libsmbclient/get_auth_data_fn.h b/examples/libsmbclient/get_auth_data_fn.h
index 5f2be72a633..9adb7451176 100644
--- a/examples/libsmbclient/get_auth_data_fn.h
+++ b/examples/libsmbclient/get_auth_data_fn.h
@@ -10,83 +10,83 @@ get_auth_data_fn(const char * pServer,
                  char * pPassword,
                  int maxLenPassword)
 {
-    char            temp[128];
-    char            server[256] = { '\0' };
-    char            share[256] = { '\0' };
-    char            workgroup[256] = { '\0' };
-    char            username[256] = { '\0' };
-    char            password[256] = { '\0' };
-    char           *ret;
+	char            temp[128];
+	char            server[256] = { '\0' };
+	char            share[256] = { '\0' };
+	char            workgroup[256] = { '\0' };
+	char            username[256] = { '\0' };
+	char            password[256] = { '\0' };
+	char           *ret;
 
-    static int krb5_set = 1;
+	static int krb5_set = 1;
 
-    if (strcmp(server, pServer) == 0 &&
-        strcmp(share, pShare) == 0 &&
-        *workgroup != '\0' &&
-        *username != '\0')
-    {
-        strncpy(pWorkgroup, workgroup, maxLenWorkgroup - 1);
-        strncpy(pUsername, username, maxLenUsername - 1);
-        strncpy(pPassword, password, maxLenPassword - 1);
-        return;
-    }
+	if (strcmp(server, pServer) == 0 &&
+	    strcmp(share, pShare) == 0 &&
+	    *workgroup != '\0' &&
+	    *username != '\0')
+	{
+		strncpy(pWorkgroup, workgroup, maxLenWorkgroup - 1);
+		strncpy(pUsername, username, maxLenUsername - 1);
+		strncpy(pPassword, password, maxLenPassword - 1);
+		return;
+	}
 
-    if (krb5_set && getenv("KRB5CCNAME")) {
-      krb5_set = 0;
-      return;
-    }
+	if (krb5_set && getenv("KRB5CCNAME")) {
+		krb5_set = 0;
+		return;
+	}
 
-    fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
-    ret = fgets(temp, sizeof(temp), stdin);
-    if (ret == NULL) {
-	    return;
-    }
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
-    }
-    
-    fprintf(stdout, "Username: [%s] ", pUsername);
-    ret = fgets(temp, sizeof(temp), stdin);
-    if (ret == NULL) {
-	    return;
-    }
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pUsername, temp, maxLenUsername - 1);
-    }
-    
-    fprintf(stdout, "Password: ");
-    ret = fgets(temp, sizeof(temp), stdin);
-    if (ret == NULL) {
-	    return;
-    }
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pPassword, temp, maxLenPassword - 1);
-    }
+	fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
+	ret = fgets(temp, sizeof(temp), stdin);
+	if (ret == NULL) {
+		return;
+	}
 
-    strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1);
-    strncpy(username, pUsername, sizeof(username) - 1);
-    strncpy(password, pPassword, sizeof(password) - 1);
+	if (temp[strlen(temp) - 1] == '\n') /* A new line? */
+	{
+		temp[strlen(temp) - 1] = '\0';
+	}
 
-    krb5_set = 1;
+	if (temp[0] != '\0')
+	{
+		strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
+	}
+
+	fprintf(stdout, "Username: [%s] ", pUsername);
+	ret = fgets(temp, sizeof(temp), stdin);
+	if (ret == NULL) {
+		return;
+	}
+
+	if (temp[strlen(temp) - 1] == '\n') /* A new line? */
+	{
+		temp[strlen(temp) - 1] = '\0';
+	}
+
+	if (temp[0] != '\0')
+	{
+		strncpy(pUsername, temp, maxLenUsername - 1);
+	}
+
+	fprintf(stdout, "Password: ");
+	ret = fgets(temp, sizeof(temp), stdin);
+	if (ret == NULL) {
+		return;
+	}
+
+	if (temp[strlen(temp) - 1] == '\n') /* A new line? */
+	{
+		temp[strlen(temp) - 1] = '\0';
+	}
+
+	if (temp[0] != '\0')
+	{
+		strncpy(pPassword, temp, maxLenPassword - 1);
+	}
+
+	strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1);
+	strncpy(username, pUsername, sizeof(username) - 1);
+	strncpy(password, pPassword, sizeof(password) - 1);
+
+	krb5_set = 1;
 }
diff --git a/examples/libsmbclient/testacl.c b/examples/libsmbclient/testacl.c
index 0f6e0acb0c3..e0e4eeb24d0 100644
--- a/examples/libsmbclient/testacl.c
+++ b/examples/libsmbclient/testacl.c
@@ -36,105 +36,105 @@ int main(int argc, const char *argv[])
 	poptContext pc;
 	struct stat st;
 	struct poptOption long_options[] =
-	{
-		POPT_AUTOHELP
-		{
-			.longName   = "numeric",
-			.shortName  = 'n',
-			.argInfo    = POPT_ARG_NONE,
-			.arg        = &numeric,
-			.val        = 1,
-			.descrip    = "Don't resolve sids or masks to names"
-		},
-		{
-			.longName   = "debug",
-			.shortName  = 'd',
-			.argInfo    = POPT_ARG_INT,
-			.arg        = &debug,
-			.val        = 0,
-			.descrip    = "Set debug level (0-100)"
-		},
-		{
-			.longName   = "full_time_names",
-			.shortName  = 'f',
-			.argInfo    = POPT_ARG_NONE,
-			.arg        = &full_time_names,
-			.val        = 1,
-			.descrip    = "Use new style xattr names, which include CREATE_TIME"
-		},
-		{
-			.longName   = "delete",
-			.shortName  = 'D',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'D',
-			.descrip    = "Delete an acl",
-			.argDescrip = "ACL"
-		},
-		{
-			.longName   = "modify",
-			.shortName  = 'M',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'M',
-			.descrip    = "Modify an acl",
-			.argDescrip = "ACL"
-		},
-		{
-			.longName   = "add",
-			.shortName  = 'a',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'a',
-			.descrip    = "Add an acl",
-			.argDescrip = "ACL"
-		},
-		{
-			.longName   = "set",
-			.shortName  = 'S',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'S',
-			.descrip    = "Set acls",
-			.argDescrip = "ACLS"
-		},
-		{
-			.longName   = "chown",
-			.shortName  = 'C',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'C',
-			.descrip    = "Change ownership of a file",
-			.argDescrip = "USERNAME"
-		},
-		{
-			.longName   = "chgrp",
-			.shortName  = 'G',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'G',
-			.descrip    = "Change group ownership of a file",
-			.argDescrip = "GROUPNAME"
-		},
-		{
-			.longName   = "get",
-			.shortName  = 'g',
-			.argInfo    = POPT_ARG_STRING,
-			.arg        = NULL,
-			.val        = 'g',
-			.descrip    = "Get a specific acl attribute",
-			.argDescrip = "ACL"
-		},
 		{
-			.longName   = "stat_and_retry",
-			.shortName  = 'R',
-			.argInfo    = POPT_ARG_NONE,
-			.arg        = &stat_and_retry,
-			.val        = 1,
-			.descrip    = "After 'get' do 'stat' and another 'get'"
-		},
-		POPT_TABLEEND
-	};
+			POPT_AUTOHELP
+			{
+				.longName   = "numeric",
+				.shortName  = 'n',
+				.argInfo    = POPT_ARG_NONE,
+				.arg        = &numeric,
+				.val        = 1,
+				.descrip    = "Don't resolve sids or masks to names"
+			},
+			{
+				.longName   = "debug",
+				.shortName  = 'd',
+				.argInfo    = POPT_ARG_INT,
+				.arg        = &debug,
+				.val        = 0,
+				.descrip    = "Set debug level (0-100)"
+			},
+			{
+				.longName   = "full_time_names",
+				.shortName  = 'f',
+				.argInfo    = POPT_ARG_NONE,
+				.arg        = &full_time_names,
+				.val        = 1,
+				.descrip    = "Use new style xattr names, which include CREATE_TIME"
+			},
+			{
+				.longName   = "delete",
+				.shortName  = 'D',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'D',
+				.descrip    = "Delete an acl",
+				.argDescrip = "ACL"
+			},
+			{
+				.longName   = "modify",
+				.shortName  = 'M',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'M',
+				.descrip    = "Modify an acl",
+				.argDescrip = "ACL"
+			},
+			{
+				.longName   = "add",
+				.shortName  = 'a',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'a',
+				.descrip    = "Add an acl",
+				.argDescrip = "ACL"
+			},
+			{
+				.longName   = "set",
+				.shortName  = 'S',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'S',
+				.descrip    = "Set acls",
+				.argDescrip = "ACLS"
+			},
+			{
+				.longName   = "chown",
+				.shortName  = 'C',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'C',
+				.descrip    = "Change ownership of a file",
+				.argDescrip = "USERNAME"
+			},
+			{
+				.longName   = "chgrp",
+				.shortName  = 'G',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'G',
+				.descrip    = "Change group ownership of a file",
+				.argDescrip = "GROUPNAME"
+			},
+			{
+				.longName   = "get",
+				.shortName  = 'g',
+				.argInfo    = POPT_ARG_STRING,
+				.arg        = NULL,
+				.val        = 'g',
+				.descrip    = "Get a specific acl attribute",
+				.argDescrip = "ACL"
+			},
+			{
+				.longName   = "stat_and_retry",
+				.shortName  = 'R',
+				.argInfo    = POPT_ARG_NONE,
+				.arg        = &stat_and_retry,
+				.val        = 1,
+				.descrip    = "After 'get' do 'stat' and another 'get'"
+			},
+			POPT_TABLEEND
+		};
 
 	setbuf(stdout, NULL);
 
@@ -210,7 +210,7 @@ int main(int argc, const char *argv[])
 		if (ret < 0)
 		{
 			printf("Could not get attribute list for [%s] %d: %s\n",
-					path, errno, strerror(errno));
+			       path, errno, strerror(errno));
 			return 1;
 		}
 
@@ -247,7 +247,7 @@ int main(int argc, const char *argv[])
 			if (ret < 0)
 			{
 				printf("Could not get attributes for [%s] %d: %s\n",
-						path, errno, strerror(errno));
+				       path, errno, strerror(errno));
 				return 1;
 			}
 
@@ -278,16 +278,16 @@ int main(int argc, const char *argv[])
 
 	case SMB_ACL_CHOWN:
 		snprintf(value, sizeof(value),
-				"system.nt_sec_desc.owner%s:%s",
-				numeric ? "" : "+", the_acl);
+			 "system.nt_sec_desc.owner%s:%s",
+			 numeric ? "" : "+", the_acl);
 		the_acl = value;
 		debugstr = "chown owner";
 		goto do_set;
 
 	case SMB_ACL_CHGRP:
 		snprintf(value, sizeof(value),
-				"system.nt_sec_desc.group%s:%s",
-				numeric ? "" : "+", the_acl);
+			 "system.nt_sec_desc.group%s:%s",
+			 numeric ? "" : "+", the_acl);
 		the_acl = value;
 		debugstr = "change group";
 		goto do_set;
@@ -296,7 +296,7 @@ int main(int argc, const char *argv[])
 		flags = 0;
 		debugstr = "set attributes";
 
-do_set:
+	do_set:
 		if ((p = strchr(the_acl, ':')) == NULL)
 		{
 			printf("Missing value.  ACL must be name:value pair\n");
@@ -309,7 +309,7 @@ do_set:
 		if (ret < 0)
 		{
 			printf("Could not %s for [%s] %d: %s\n",
-					debugstr, path, errno, strerror(errno));
+			       debugstr, path, errno, strerror(errno));
 			return 1;
 		}
 		break;
@@ -319,7 +319,7 @@ do_set:
 		if (ret < 0)
 		{
 			printf("Could not remove attribute %s for [%s] %d:%s\n",
-					the_acl, path, errno, strerror(errno));
+			       the_acl, path, errno, strerror(errno));
 			return 1;
 		}
 		break;
diff --git a/examples/libsmbclient/testacl2.c b/examples/libsmbclient/testacl2.c
index a74a72d794c..ee48b7b3059 100644
--- a/examples/libsmbclient/testacl2.c
+++ b/examples/libsmbclient/testacl2.c
@@ -19,55 +19,55 @@ enum acl_mode
 
 int main(int argc, const char *argv[])
 {
-    int flags;
-    int debug = 0;
-    static char *the_acl = NULL;
-    int ret;
-    const char *debugstr;
-    char value[1024];
-    SMBCCTX *context;
+	int flags;
+	int debug = 0;
+	static char *the_acl = NULL;
+	int ret;
+	const char *debugstr;
+	char value[1024];
+	SMBCCTX *context;
 
-    if (smbc_init(get_auth_data_fn, debug) != 0)
-    {
-        printf("Could not initialize smbc_ library\n");
-        return 1;
-    }
+	if (smbc_init(get_auth_data_fn, debug) != 0)
+	{
+		printf("Could not initialize smbc_ library\n");
+		return 1;
+	}
 
-    context = smbc_set_context(NULL);
-    smbc_setOptionFullTimeNames(context, 1);
-    
-    the_acl = strdup("system.nt_sec_desc.*");
-    ret = smbc_getxattr(argv[1], the_acl, value, sizeof(value));
-    if (ret < 0)
-    {
-        printf("Could not get attributes for [%s] %d: %s\n",
-               argv[1], errno, strerror(errno));
-        return 1;
-    }
-    
-    printf("Attributes for [%s] are:\n%s\n", argv[1], value);
+	context = smbc_set_context(NULL);
+	smbc_setOptionFullTimeNames(context, 1);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list