The branch, v4-3-stable has been updated
       via  6c37399 VERSION: Disable git snapshot for the 4.3.1 release.
       via  b9a7ba8 WHATSNEW: Add release notes for Samba 4.3.1.
       via  9e8a1cb s3:smbstatus: add stream name to share_entry_forall()
       via  60ea0df s3: lsa: lookup_name() logic for unqualified (no DOMAIN\ 
component) names is incorrect.
       via  9f4f2af s3:lib: validate domain name in lookup_wellknown_name()
       via  a83021f s3:locking: initialize lease pointer in 
share_mode_traverse_fn()
       via  46ace5b s4: torture: Add SMB2 access-based enumeration test. Passes 
against Win2k12R2.
       via  fc58a7c lib: cli: Add accessor function smb2cli_tcon_flags() to get 
tcon flags.
       via  52d8aeb s3: smbd: Fix our access-based enumeration on "hide 
unreadable" to match Windows.
       via  617ffc4 smbd: Fix file name buflen and padding in notify repsonse
       via  c84322d vfs_fruit: return value of ad_pack in vfs_fruit.c
       via  dff1fd5 lib: We can do ACCRIGHTS style fdpassing
       via  84d80d6 lib: Support fd passing using the 4.3BSD way
       via  088b7e2 lib: Move some routines around in msghdr.c
       via  d4db166 lib: We only need the fd-passing check once
       via  b6bdeb8 vfs_commit: set the fd on open before calling SMB_VFS_FSTAT
       via  5dceb51 s3:ctdbd_conn: make sure we destroy tevent_fd before 
closing the socket
       via  f1ed825 s4: tests: Fix nss_tests build on Solaris.
       via  e765cf9 kerberos: make sure we only use prompter type when 
available.
       via  26baf7f winbind: Fix 100% loop
       via  51eacb5 s3: smbd: Fix NULL pointer bug introduced by previous 'raw' 
stream fix (bug #11522).
       via  d0e2a34 s3: smbd: fix a crash in unix_convert()
       via  3cea564 net: fix a crash with net ads keytab create
       via  3747699 s3: tests: smbclient test to ensure we can create and see a 
:foobar stream on the top level directory in a share.
       via  1681d0e s3: smbd: Fix opening/creating :stream files on the root 
share directory.
       via  134b9de s3: smbd: Remove unused parameter from build_stream_path().
       via  d768273 s3: smbclient: Move cmd_setmode out of clitar.c and back 
into client.c
       via  e818bae pam_winbind: Fix a segfault if initialization fails
       via  9da6994 s4: torture: Test mkdir race condition.
       via  69c4f43 s3: smbd: Fix mkdir race condition.
       via  d0d61f8 lib/param: fix hiding of FLAG_SYNONYM values
       via  fd48773 s4:lib/messaging: use 'msg.lock' and 'msg.sock' for 
messaging related subdirs
       via  af6fb44 s3:lib/messages: use 'msg.lock' and 'msg.sock' for 
messaging related subdirs
       via  9fdcaed s3:lib/messages: add missing allocation check for priv_path
       via  f003617 s3: dfs: Fix a crash when the dfs targets are disabled.
       via  8aaba4b nss_winbind: fix hang on Solaris on big groups
       via  338bee2 build: use as-needed linker flag also on OpenBSD
       via  a4ec232 VERSION: Bump version up to 4.3.1...
      from  b85f601 VERSION: Release Samba 4.3.0

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                   |   2 +-
 WHATSNEW.txt                              |  85 ++++++++++-
 lib/param/loadparm.c                      |  89 +++++++-----
 libcli/smb/smbXcli_base.c                 |   5 +
 libcli/smb/smbXcli_base.h                 |   1 +
 librpc/idl/notify.idl                     |   4 +-
 nsswitch/pam_winbind.c                    |  19 ++-
 nsswitch/winbind_nss_solaris.c            |   6 +
 selftest/knownfail                        |   2 +
 source3/client/client.c                   | 118 +++++++++++++++
 source3/client/client_proto.h             |   6 +
 source3/client/clitar.c                   | 129 -----------------
 source3/lib/ctdbd_conn.c                  |   6 +-
 source3/lib/messages.c                    |  10 +-
 source3/lib/msghdr.c                      | 176 ++++++++++++++++-------
 source3/lib/unix_msg/unix_msg.c           |  10 +-
 source3/lib/util_wellknown.c              |  13 +-
 source3/libads/kerberos.c                 |  26 ++++
 source3/libads/ldap.c                     |   7 +
 source3/libsmb/clidfs.c                   |   4 +-
 source3/locking/proto.h                   |   3 +-
 source3/locking/share_mode_lock.c         |  21 ++-
 source3/modules/vfs_commit.c              |  11 +-
 source3/modules/vfs_fruit.c               |  14 +-
 source3/passdb/lookup_sid.c               |  31 +++-
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c |  21 ++-
 source3/script/tests/test_smbclient_s3.sh |  36 +++++
 source3/smbd/dir.c                        |  64 ++++++++-
 source3/smbd/filename.c                   |  35 ++++-
 source3/smbd/notify.c                     |  14 +-
 source3/smbd/open.c                       |  19 +++
 source3/utils/status.c                    |   6 +-
 source4/heimdal_build/wscript_configure   |   1 +
 source4/lib/messaging/messaging.c         |   4 +-
 source4/torture/local/nss_tests.c         |   8 ++
 source4/torture/smb2/acls.c               | 230 ++++++++++++++++++++++++++++++
 source4/torture/smb2/create.c             | 151 ++++++++++++++++++++
 wscript                                   |   3 +-
 wscript_configure_system_mitkrb5          |   2 +
 39 files changed, 1114 insertions(+), 278 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 2be8ba8..27e7e84 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=3
-SAMBA_VERSION_RELEASE=0
+SAMBA_VERSION_RELEASE=1
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index c5859b8..5fee372 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,87 @@
                    =============================
+                   Release Notes for Samba 4.3.1
+                         October 20, 2015
+                   =============================
+
+
+This is the latest stable release of Samba 4.3.
+
+
+Changes since 4.3.0:
+--------------------
+
+o   Jeremy Allison <[email protected]>
+    * BUG 10252: s3: smbd: Fix our access-based enumeration on "hide 
unreadable"
+      to match Windows.
+    * BUG 10634: smbd: Fix file name buflen and padding in notify repsonse.
+    * BUG 11486: s3: smbd: Fix mkdir race condition.
+    * BUG 11522: s3: smbd: Fix opening/creating :stream files on the root share
+      directory.
+    * BUG 11535: s3: smbd: Fix NULL pointer bug introduced by previous 'raw'
+    * stream fix (bug #11522).
+    * BUG 11555: s3: lsa: lookup_name() logic for unqualified (no DOMAIN\
+      component) names is incorrect.
+
+o   Ralph Boehme <[email protected]>
+    * BUG 11535: s3: smbd: Fix a crash in unix_convert().
+    * BUG 11543: vfs_fruit: Return value of ad_pack in vfs_fruit.c.
+    * BUG 11549: s3:locking: Initialize lease pointer in
+      share_mode_traverse_fn().
+    * BUG 11550: s3:smbstatus: Add stream name to share_entry_forall().
+    * BUG 11555: s3:lib: Validate domain name in lookup_wellknown_name().
+
+o   Günther Deschner <[email protected]>
+    * BUG 11038: kerberos: Make sure we only use prompter type when available.
+
+o   Volker Lendecke <[email protected]>
+    * BUG 11038: winbind: Fix 100% loop.
+    * BUG 11053: source3/lib/msghdr.c: Fix compiling error on Solaris.
+
+o   Stefan Metzmacher <[email protected]>
+    * BUG 11316: s3:ctdbd_conn: make sure we destroy tevent_fd before closing
+      the socket.
+    * BUG 11515: s4:lib/messaging: Use 'msg.lock' and 'msg.sock' for messaging
+      related subdirs.
+    * BUG 11526: lib/param: Fix hiding of FLAG_SYNONYM values.
+
+o   Björn Jacke <[email protected]>
+    * BUG 10365: nss_winbind: Fix hang on Solaris on big groups.
+    * BUG 11355: build: Use as-needed linker flag also on OpenBSD.
+
+o   Har Gagan Sahai <[email protected]>
+    * BUG 11509: s3: dfs: Fix a crash when the dfs targets are disabled.
+
+o   Andreas Schneider <[email protected]>
+    * BUG 11502: pam_winbind: Fix a segfault if initialization fails.
+
+o   Uri Simchoni <[email protected]>
+    * BUG 11528: net: Fix a crash with 'net ads keytab create'.
+    * BUG 11547: vfs_commit: set the fd on open before calling SMB_VFS_FSTAT.
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Older release notes to follow:
+------------------------------
+
+                   =============================
                    Release Notes for Samba 4.3.0
                            September 8, 2015
                    =============================
@@ -387,7 +470,7 @@ o   Björn Baumbach <[email protected]>
 o   Justin Maggard <[email protected]>
     * BUG 11320: "force group" with local group not working
 
-o   Martin Schwenke <[email protected]
+o   Martin Schwenke <[email protected]>
     * BUG 11424: Build broken with --disable-python
 
 
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 06a9e59..c26442a 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2014,22 +2014,28 @@ void lpcfg_dump_globals(struct loadparm_context 
*lp_ctx, FILE *f,
 
        fprintf(f, "# Global parameters\n[global]\n");
 
-       for (i = 0; parm_table[i].label; i++)
-               if (parm_table[i].p_class == P_GLOBAL &&
-                   (i == 0 || (parm_table[i].offset != parm_table[i - 
1].offset))) {
-                       if (!show_defaults) {
-                               if (lp_ctx->flags && (lp_ctx->flags[i] & 
FLAG_DEFAULT)) {
-                                       continue;
-                               }
+       for (i = 0; parm_table[i].label; i++) {
+               if (parm_table[i].p_class != P_GLOBAL) {
+                       continue;
+               }
 
-                               if (is_default(lp_ctx->globals, i)) {
-                                       continue;
-                               }
+               if (parm_table[i].flags & FLAG_SYNONYM) {
+                       continue;
+               }
+
+               if (!show_defaults) {
+                       if (lp_ctx->flags && (lp_ctx->flags[i] & FLAG_DEFAULT)) 
{
+                               continue;
+                       }
+
+                       if (is_default(lp_ctx->globals, i)) {
+                               continue;
                        }
+               }
 
-                       fprintf(f, "\t%s = ", parm_table[i].label);
-                       lpcfg_print_parameter(&parm_table[i], 
lpcfg_parm_ptr(lp_ctx, NULL, &parm_table[i]), f);
-                       fprintf(f, "\n");
+               fprintf(f, "\t%s = ", parm_table[i].label);
+               lpcfg_print_parameter(&parm_table[i], lpcfg_parm_ptr(lp_ctx, 
NULL, &parm_table[i]), f);
+               fprintf(f, "\n");
        }
        if (lp_ctx->globals->param_opt != NULL) {
                for (data = lp_ctx->globals->param_opt; data;
@@ -2057,34 +2063,45 @@ void lpcfg_dump_a_service(struct loadparm_service * 
pService, struct loadparm_se
                fprintf(f, "\n[%s]\n", pService->szService);
 
        for (i = 0; parm_table[i].label; i++) {
-               if (parm_table[i].p_class == P_LOCAL &&
-                   (*parm_table[i].label != '-') &&
-                   (i == 0 || (parm_table[i].offset != parm_table[i - 
1].offset)))
-               {
-                       if (pService == sDefault) {
-                               if (!show_defaults) {
-                                       if (flags && (flags[i] & FLAG_DEFAULT)) 
{
-                                               continue;
-                                       }
+               if (parm_table[i].p_class != P_LOCAL) {
+                       continue;
+               }
 
-                                       if (is_default(sDefault, i)) {
-                                               continue;
-                                       }
+               if (parm_table[i].flags & FLAG_SYNONYM) {
+                       continue;
+               }
+
+               if (*parm_table[i].label == '-') {
+                       continue;
+               }
+
+               if (pService == sDefault) {
+                       if (!show_defaults) {
+                               if (flags && (flags[i] & FLAG_DEFAULT)) {
+                                       continue;
                                }
-                       } else {
-                               if (lpcfg_equal_parameter(parm_table[i].type,
-                                                         ((char *)pService) +
-                                                         parm_table[i].offset,
-                                                         ((char *)sDefault) +
-                                                         parm_table[i].offset))
+
+                               if (is_default(sDefault, i)) {
                                        continue;
+                               }
+                       }
+               } else {
+                       bool equal;
+
+                       equal = lpcfg_equal_parameter(parm_table[i].type,
+                                                     ((char *)pService) +
+                                                     parm_table[i].offset,
+                                                     ((char *)sDefault) +
+                                                     parm_table[i].offset);
+                       if (equal) {
+                               continue;
                        }
-
-                       fprintf(f, "\t%s = ", parm_table[i].label);
-                       lpcfg_print_parameter(&parm_table[i],
-                                       ((char *)pService) + 
parm_table[i].offset, f);
-                       fprintf(f, "\n");
                }
+
+               fprintf(f, "\t%s = ", parm_table[i].label);
+               lpcfg_print_parameter(&parm_table[i],
+                               ((char *)pService) + parm_table[i].offset, f);
+               fprintf(f, "\n");
        }
        if (pService->param_opt != NULL) {
                for (data = pService->param_opt; data; data = data->next) {
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index c1e9e58..6fe4816 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -5991,6 +5991,11 @@ uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon 
*tcon)
        return tcon->smb2.capabilities;
 }
 
+uint32_t smb2cli_tcon_flags(struct smbXcli_tcon *tcon)
+{
+       return tcon->smb2.flags;
+}
+
 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
                             struct smbXcli_session *session,
                             uint32_t tcon_id,
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index cf93135..e4cfb10 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -442,6 +442,7 @@ bool smb1cli_tcon_set_values(struct smbXcli_tcon *tcon,
                             const char *fs_type);
 uint32_t smb2cli_tcon_current_id(struct smbXcli_tcon *tcon);
 uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon *tcon);
+uint32_t smb2cli_tcon_flags(struct smbXcli_tcon *tcon);
 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
                             struct smbXcli_session *session,
                             uint32_t tcon_id,
diff --git a/librpc/idl/notify.idl b/librpc/idl/notify.idl
index 66422ec..09d06be 100644
--- a/librpc/idl/notify.idl
+++ b/librpc/idl/notify.idl
@@ -93,6 +93,8 @@ interface notify
                uint32 NextEntryOffset;
                FILE_NOTIFY_ACTION Action;
                [value(strlen_m(FileName1)*2)] uint32 FileNameLength;
-               [charset(UTF16),flag(STR_NOTERM)] uint16 
FileName1[FileNameLength];
+               [charset(UTF16),flag(STR_NOTERM)]
+                       uint16 FileName1[strlen_m(FileName1)];
+               DATA_BLOB _pad;
        } FILE_NOTIFY_INFORMATION;
 }
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 1e16741..a2d9f3b 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2489,7 +2489,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
 
        retval = _pam_winbind_init_context(pamh, flags, argc, argv, type, &ctx);
        if (retval) {
-               goto out;
+               return retval;
        }
 
        _PAM_LOG_FUNCTION_ENTER("_pam_delete_cred", ctx);
@@ -2625,7 +2625,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
        retval = _pam_winbind_init_context(pamh, flags, argc, argv,
                                           PAM_WINBIND_AUTHENTICATE, &ctx);
        if (retval) {
-               goto out;
+               return retval;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_authenticate", ctx);
@@ -2777,7 +2777,7 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags,
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_SETCRED, &ctx);
        if (ret) {
-               goto out;
+               return ret;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_setcred", ctx);
@@ -2808,8 +2808,6 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags,
                        break;
        }
 
- out:
-
        _PAM_LOG_FUNCTION_LEAVE("pam_sm_setcred", ctx, ret);
 
        TALLOC_FREE(ctx);
@@ -2833,7 +2831,7 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_ACCT_MGMT, &ctx);
        if (ret) {
-               goto out;
+               return ret;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_acct_mgmt", ctx);
@@ -2929,7 +2927,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_OPEN_SESSION, &ctx);
        if (ret) {
-               goto out;
+               return ret;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_open_session", ctx);
@@ -2938,7 +2936,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
                /* check and create homedir */
                ret = _pam_mkhomedir(ctx);
        }
- out:
+
        _PAM_LOG_FUNCTION_LEAVE("pam_sm_open_session", ctx, ret);
 
        TALLOC_FREE(ctx);
@@ -2956,12 +2954,11 @@ int pam_sm_close_session(pam_handle_t *pamh, int flags,
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_CLOSE_SESSION, &ctx);
        if (ret) {
-               goto out;
+               return ret;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_close_session", ctx);
 
-out:
        _PAM_LOG_FUNCTION_LEAVE("pam_sm_close_session", ctx, ret);
 
        TALLOC_FREE(ctx);
@@ -3043,7 +3040,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_CHAUTHTOK, &ctx);
        if (ret) {
-               goto out;
+               return ret;
        }
 
        _PAM_LOG_FUNCTION_ENTER("pam_sm_chauthtok", ctx);
diff --git a/nsswitch/winbind_nss_solaris.c b/nsswitch/winbind_nss_solaris.c
index 1d0ac90..dfb87e3 100644
--- a/nsswitch/winbind_nss_solaris.c
+++ b/nsswitch/winbind_nss_solaris.c
@@ -259,6 +259,9 @@ _nss_winbind_getgrnam_solwrap(nss_backend_t* be, void* args)
        if(ret == NSS_STATUS_SUCCESS)
                NSS_ARGS(args)->returnval = (void*) result;
 
+       if (NSS_ARGS(args)->erange == ERANGE && ret == NSS_STATUS_TRYAGAIN)
+               return NSS_STATUS_UNAVAIL;
+
        return ret;
 }
 
@@ -278,6 +281,9 @@ _nss_winbind_getgrgid_solwrap(nss_backend_t* be, void* args)
        if(ret == NSS_STATUS_SUCCESS)
                NSS_ARGS(args)->returnval = (void*) result;
 
+       if (NSS_ARGS(args)->erange == ERANGE && ret == NSS_STATUS_TRYAGAIN)
+               return NSS_STATUS_UNAVAIL;
+
        return ret;
 }
 
diff --git a/selftest/knownfail b/selftest/knownfail
index 447544e..0d74933 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -143,9 +143,11 @@
 ^samba4.raw.acls.*.create_file
 ^samba4.smb2.create.*.acldir
 ^samba4.smb2.create.*.impersonation
+^samba4.smb2.create.*.mkdir-dup # bug 11486
 ^samba4.smb2.acls.*.generic
 ^samba4.smb2.acls.*.inheritflags
 ^samba4.smb2.acls.*.owner
+^samba4.smb2.acls.*.ACCESSBASED
 
^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.test_dirsync_deleted_items
 #^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.*
 ^samba4.libsmbclient.opendir.opendir # This requires netbios browsing
diff --git a/source3/client/client.c b/source3/client/client.c
index f49f3ff..034b48a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4656,6 +4656,124 @@ static int cmd_show_connect( void )
        return 0;
 }
 
+/**
+ * set_remote_attr - set DOS attributes of a remote file
+ * @filename: path to the file name
+ * @new_attr: attribute bit mask to use
+ * @mode: one of ATTR_SET or ATTR_UNSET
+ *
+ * Update the file attributes with the one provided.
+ */
+int set_remote_attr(const char *filename, uint16_t new_attr, int mode)
+{
+       extern struct cli_state *cli;
+       uint16_t old_attr;
+       NTSTATUS status;
+
+       status = cli_getatr(cli, filename, &old_attr, NULL, NULL);
+       if (!NT_STATUS_IS_OK(status)) {
+               d_printf("cli_getatr failed: %s\n", nt_errstr(status));
+               return 1;
+       }
+
+       if (mode == ATTR_SET) {
+               new_attr |= old_attr;
+       } else {
+               new_attr = old_attr & ~new_attr;
+       }
+
+       status = cli_setatr(cli, filename, new_attr, 0);
+       if (!NT_STATUS_IS_OK(status)) {
+               d_printf("cli_setatr failed: %s\n", nt_errstr(status));
+               return 1;
+       }
+
+       return 0;
+}
+
+/**
+ * cmd_setmode - interactive command to set DOS attributes
+ *
+ * Read a filename and mode from the client command line and update
+ * the file DOS attributes.
+ */
+int cmd_setmode(void)
+{
+       const extern char *cmd_ptr;
+       char *buf;
+       char *fname = NULL;
+       uint16_t attr[2] = {0};
+       int mode = ATTR_SET;
+       int err = 0;
+       bool ok;
+       TALLOC_CTX *ctx = talloc_new(NULL);
+       if (ctx == NULL) {
+               return 1;
+       }
+
+       ok = next_token_talloc(ctx, &cmd_ptr, &buf, NULL);
+       if (!ok) {
+               d_printf("setmode <filename> <[+|-]rsha>\n");
+               err = 1;
+               goto out;
+       }
+
+       fname = talloc_asprintf(ctx,
+                               "%s%s",
+                               client_get_cur_dir(),
+                               buf);
+       if (fname == NULL) {
+               err = 1;
+               goto out;
+       }
+
+       while (next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
+               const char *s = buf;
+
+               while (*s) {
+                       switch (*s++) {
+                       case '+':
+                               mode = ATTR_SET;
+                               break;
+                       case '-':
+                               mode = ATTR_UNSET;
+                               break;
+                       case 'r':
+                               attr[mode] |= FILE_ATTRIBUTE_READONLY;
+                               break;
+                       case 'h':
+                               attr[mode] |= FILE_ATTRIBUTE_HIDDEN;
+                               break;
+                       case 's':
+                               attr[mode] |= FILE_ATTRIBUTE_SYSTEM;
+                               break;


-- 
Samba Shared Repository

Reply via email to