[SCM] Samba Shared Repository - branch master updated

Douglas Bagnall dbagnall at samba.org
Fri Nov 30 06:08:02 UTC 2018


The branch, master has been updated
       via  f03392a0aef Converted README to markdown
       via  06061d39c10 Add simple tests for net rpc share allowedusers
       via  3d9ba1b7e6c Fix net rpc share allowedusers short description
       via  6af599223c5 net rpc share allowedusers: Allow restricting shares
       via  28aeb86a9fb Fix spelling mistakes
       via  669249ae93b New testcase samba3.blackbox.net_rpc_join_creds
       via  1cf84b6b990 net: Add support for a credentials file
      from  e99402235da s3/testparm: Reduce debug level to 1

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


- Log -----------------------------------------------------------------
commit f03392a0aef9da195b1f9cb2442802d82e2dcb55
Author: Daniel Southward-Ellis <danielsouthwardellis at catalyst.net.nz>
Date:   Fri Nov 30 11:25:42 2018 +1300

    Converted README to markdown
    
    Signed-off-by: Daniel Southward-Ellis <danielsouthwardellis at catalyst.net.nz>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Douglas Bagnall <dbagnall at samba.org>
    Autobuild-Date(master): Fri Nov 30 07:07:36 CET 2018 on sn-devel-144

commit 06061d39c1031b223edc126ccb960ceb4b0b3d59
Author: Olly Betts <olly at survex.com>
Date:   Wed Nov 28 09:09:51 2018 +1300

    Add simple tests for net rpc share allowedusers
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3d9ba1b7e6cbc0833b8ff2f92673c9403b6f9038
Author: Olly Betts <olly at survex.com>
Date:   Tue Oct 23 13:46:38 2018 +1300

    Fix net rpc share allowedusers short description
    
    This command allows one to list allowed users, not modify them.
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6af599223c51b27d5b8b6d72f52e9c273f82768d
Author: Olly Betts <olly at survex.com>
Date:   Tue May 1 14:37:08 2018 +1200

    net rpc share allowedusers: Allow restricting shares
    
    The help already implies that you can specify "targets" for net rpc
    share allowedusers, but actually the tail end of the command line
    is just ignored.
    
    This patch allows a list of shares to be specified, and only those
    shares are checked, which can be much faster if you're only interested
    in a few shares on a server which exports lots.
    
    This subcommand already accepts an optional filename for the output
    of net usersidlist, with a default of stdin.  Typically you'd just pipe
    one command to the other so stdin is most likely what you want.  This
    patch adds support for a filename of "-" to mean stdin so that you can
    specify stdin explicitly when you provide a list of shares, since in
    this case the filename can't be omitted.
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 28aeb86a9fbc102007e3152bc6c574232204803a
Author: Olly Betts <olly at survex.com>
Date:   Wed Nov 28 11:10:17 2018 +1300

    Fix spelling mistakes
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 669249ae93bd492559b25539830773af3fa5cca7
Author: Olly Betts <olly at survex.com>
Date:   Wed Oct 24 11:46:11 2018 +1300

    New testcase samba3.blackbox.net_rpc_join_creds
    
    Tests that you can now use a credentials file with net.
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1cf84b6b99082907596c511c86e4e8c22314b08c
Author: Olly Betts <olly at survex.com>
Date:   Tue May 1 13:19:58 2018 +1200

    net: Add support for a credentials file
    
    Add support for the same -A authfile/--authentication-file authfile
    option that most of the other tools already do.
    
    Signed-off-by: Olly Betts <olly at survex.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 README => README.md                                | 44 +++++++++++-----------
 ctdb/event/event_daemon.c                          |  4 +-
 docs-xml/manpages/net.8.xml                        |  1 +
 lib/addns/dnsmarshall.c                            |  2 +-
 lib/tdb/test/run-marklock-deadlock.c               |  2 +-
 lib/tevent/testsuite.c                             |  2 +-
 libcli/util/tstream.h                              |  4 +-
 python/samba/dbchecker.py                          |  2 +-
 source3/modules/vfs_shadow_copy2.c                 |  2 +-
 source3/passdb/pdb_get_set.c                       |  4 +-
 source3/passdb/py_passdb.c                         |  4 +-
 source3/script/tests/test_net_rpc_join_creds.sh    | 30 +++++++++++++++
 .../tests/test_net_rpc_share_allowedusers.sh       | 30 +++++++++++++++
 source3/selftest/tests.py                          |  9 +++++
 source3/smbd/open.c                                |  4 +-
 source3/smbd/reply.c                               |  2 +-
 source3/utils/net.c                                | 25 ++++++++++++
 source3/utils/net_rpc.c                            | 37 +++++++++++++-----
 source3/utils/net_share.c                          | 17 +++++----
 source3/winbindd/winbindd_ccache_access.c          |  4 +-
 source3/wscript                                    |  2 +-
 source4/dsdb/samdb/ldb_modules/acl.c               |  2 +-
 source4/libnet/libnet_domain.c                     |  4 +-
 source4/torture/basic/base.c                       |  2 +-
 source4/torture/drs/python/getncchanges.py         |  2 +-
 25 files changed, 177 insertions(+), 64 deletions(-)
 rename README => README.md (94%)
 create mode 100755 source3/script/tests/test_net_rpc_join_creds.sh
 create mode 100755 source3/script/tests/test_net_rpc_share_allowedusers.sh


Changeset truncated at 500 lines:

diff --git a/README b/README.md
similarity index 94%
rename from README
rename to README.md
index 14e14b12d57..f56d7db2977 100644
--- a/README
+++ b/README.md
@@ -3,36 +3,36 @@ server and Domain Controller for UNIX and other operating
 systems. Samba is maintained by the Samba Team, who support the
 original author, Andrew Tridgell.
 
->>>> Please read THE WHOLE of this file as it gives important information
->>>> about the configuration and use of Samba.
+**Please read THE WHOLE of this file as it gives important information
+about the configuration and use of Samba.**
 
 NOTE: Installation instructions may be found
       for the file/print server and domain member in:
       docs/htmldocs/Samba3-HOWTO/install.html
 
-      For the AD DC implementation a full HOWTO is provided at:
+For the AD DC implementation a full HOWTO is provided at:
       https://wiki.samba.org/index.php/Samba4/HOWTO
 
 This software is freely distributable under the GNU public license, a
 copy of which you should have received with this software (in a file
-called COPYING). 
+called COPYING).
 
 
 WHAT IS SMB/CIFS?
 =================
 
-This is a big question. 
+This is a big question.
 
 The very short answer is that it is the protocol by which a lot of
 PC-related machines share files and printers and other information
 such as lists of available files and printers. Operating systems that
-support this natively include Windows 9x, Windows NT (and derivatives), 
-OS/2, Mac OS X and Linux.  Add on packages that achieve the same 
-thing are available for DOS, Windows 3.1, VMS, Unix of all kinds, 
-MVS, and more.  Some Web Browsers can speak this protocol as well 
-(smb://).  Alternatives to SMB include Netware, NFS, Appletalk, 
-Banyan Vines, Decnet etc; many of these have advantages but none are 
-both public specifications and widely implemented in desktop machines 
+support this natively include Windows 9x, Windows NT (and derivatives),
+OS/2, Mac OS X and Linux.  Add on packages that achieve the same
+thing are available for DOS, Windows 3.1, VMS, Unix of all kinds,
+MVS, and more.  Some Web Browsers can speak this protocol as well
+(smb://).  Alternatives to SMB include Netware, NFS, Appletalk,
+Banyan Vines, Decnet etc; many of these have advantages but none are
+both public specifications and widely implemented in desktop machines
 by default.
 
 The Common Internet File system (CIFS) is what the new SMB initiative
@@ -46,7 +46,7 @@ WHY DO PEOPLE WANT TO USE SMB?
    with their Unix servers.
 
 2. Others want to integrate their Microsoft (etc) servers with Unix
-   servers. This is a different problem to integrating desktop 
+   servers. This is a different problem to integrating desktop
    clients.
 
 3. Others want to replace protocols like NFS, DecNet and Novell NCP,
@@ -59,11 +59,11 @@ WHAT CAN SAMBA DO?
 Please refer to the WHATSNEW.txt included with this README for
 a list of features in the latest Samba release.
 
-Here is a very short list of what samba includes, and what it does. 
-For many networks this can be simply summarized by "Samba provides 
+Here is a very short list of what samba includes, and what it does.
+For many networks this can be simply summarized by "Samba provides
 a complete replacement for Windows NT, Warp, NFS or Netware servers."
 
-- a SMB server, to provide Windows NT and LAN Manager-style file and print 
+- a SMB server, to provide Windows NT and LAN Manager-style file and print
   services to SMB clients such as Windows 95, Warp Server, smbfs and others.
 
 - a Windows Domain Controller (NT4 and AD) replacement.
@@ -71,7 +71,7 @@ a complete replacement for Windows NT, Warp, NFS or Netware servers."
 - a file/print server that can act as a member of a Windows NT 4.0
   or Active Directory domain.
 
-- a NetBIOS (rfc1001/1002) nameserver, which amongst other things gives 
+- a NetBIOS (rfc1001/1002) nameserver, which amongst other things gives
   browsing support. Samba can be the master browser on your LAN if you wish.
 
 - a ftp-like SMB client so you can access PC resources (disks and
@@ -87,8 +87,8 @@ https://www.samba.org/samba/, and browse the user survey.
 
 Related packages include:
 
-- cifsvfs, an advanced Linux-only filesystem allowing you to mount 
-  remote SMB filesystems from PCs on your Linux box. This is included 
+- cifsvfs, an advanced Linux-only filesystem allowing you to mount
+  remote SMB filesystems from PCs on your Linux box. This is included
   as standard with Linux 2.5 and later.
 
 - smbfs, the previous Linux-only filesystem allowing you to mount remote SMB
@@ -119,7 +119,7 @@ CONTRIBUTIONS
 2. If you want to contribute to the development of the software then
 please join the mailing list. The Samba team accepts patches
 (preferably in "diff -u" format, see https://www.samba.org/samba/devel/
-for more details) and are always glad to receive feedback or 
+for more details) and are always glad to receive feedback or
 suggestions to the address samba at lists.samba.org.  More information
 on the various Samba mailing lists can be found at https://lists.samba.org/.
 
@@ -149,7 +149,7 @@ A list of Samba documentation in languages other than English is
 available on the web page.
 
 If you would like to help with the documentation, please coordinate
-on the samba at samba.org mailing list.  See the next section for details 
+on the samba at samba.org mailing list.  See the next section for details
 on subscribing to samba mailing lists.
 
 
@@ -222,7 +222,7 @@ A Samba WWW site has been setup with lots of useful info. Connect to:
 
 https://www.samba.org/
 
-As well as general information and documentation, this also has searchable 
+As well as general information and documentation, this also has searchable
 archives of the mailing list and a user survey that shows who else is using
 this package.
 
diff --git a/ctdb/event/event_daemon.c b/ctdb/event/event_daemon.c
index 3f9827c6a06..b6c01761e91 100644
--- a/ctdb/event/event_daemon.c
+++ b/ctdb/event/event_daemon.c
@@ -293,13 +293,13 @@ int main(int argc, const char **argv)
 
 	ret = event_config_init(e_state, &e_state->config);
 	if (ret != 0) {
-		D_ERR("Failed to initalize event config\n");
+		D_ERR("Failed to initialize event config\n");
 		goto fail;
 	}
 
 	e_state->ev = tevent_context_init(e_state->mem_ctx);
 	if (e_state->ev == NULL) {
-		D_ERR("Failed to initalize tevent\n");
+		D_ERR("Failed to initialize tevent\n");
 		ret = 1;
 		goto fail;
 	}
diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml
index 499fd4291de..37dfa2af694 100644
--- a/docs-xml/manpages/net.8.xml
+++ b/docs-xml/manpages/net.8.xml
@@ -26,6 +26,7 @@
 		<arg choice="opt">-w|--workgroup workgroup</arg>
 		<arg choice="opt">-W|--myworkgroup myworkgroup</arg>
 		<arg choice="opt">-U|--user user</arg>
+		<arg choice="opt">-A|--authentication-file authfile</arg>
 		<arg choice="opt">-I|--ipaddress ip-address</arg>
 		<arg choice="opt">-p|--port port</arg>
 		<arg choice="opt">-n myname</arg>
diff --git a/lib/addns/dnsmarshall.c b/lib/addns/dnsmarshall.c
index 846fd5bf16a..3205786cbbb 100644
--- a/lib/addns/dnsmarshall.c
+++ b/lib/addns/dnsmarshall.c
@@ -35,7 +35,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
 	result->error = ERROR_DNS_SUCCESS;
 	
 	/*
-	 * Small inital size to excercise the realloc code
+	 * Small initial size to exercise the realloc code
 	 */
 	result->size = 2;
 
diff --git a/lib/tdb/test/run-marklock-deadlock.c b/lib/tdb/test/run-marklock-deadlock.c
index ff03a11d6fb..37e959f069a 100644
--- a/lib/tdb/test/run-marklock-deadlock.c
+++ b/lib/tdb/test/run-marklock-deadlock.c
@@ -171,7 +171,7 @@ static int do_tests(const char *name, int tdb_flags)
 	 * mutex patches, the freelist was already blocked here by the
 	 * allrecord child, which was waiting for the chainlock child to give
 	 * up its chainlock. Make sure that we don't run into this
-	 * deadlock. To excercise the deadlock, just comment out the "ok"
+	 * deadlock. To exercise the deadlock, just comment out the "ok"
 	 * line.
 	 *
 	 * The freelist lock/mutex is independent from the allrecord lock/mutex.
diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c
index b0f58efd093..62a8da3c1a1 100644
--- a/lib/tevent/testsuite.c
+++ b/lib/tevent/testsuite.c
@@ -1719,7 +1719,7 @@ static bool test_multi_tevent_threaded_2(struct torture_context *test,
 	/*
 	 * tevent_re_initialise used to have a bug where it did not
 	 * re-initialise the thread support after taking it
-	 * down. Excercise that code path.
+	 * down. Exercise that code path.
 	 */
 	ret = tevent_re_initialise(ev);
 	torture_assert(test, ret == 0, "tevent_re_initialise failed");
diff --git a/libcli/util/tstream.h b/libcli/util/tstream.h
index 36ae65d9e5b..3bf80f0e925 100644
--- a/libcli/util/tstream.h
+++ b/libcli/util/tstream.h
@@ -51,7 +51,7 @@ typedef NTSTATUS tstream_read_pdu_blob_full_fn_t(void *private_data,
  *
  * @param[in] stream		The stream to read data from.
  *
- * @param[in] inital_read_size	The initial byte count that is needed to workout
+ * @param[in] initial_read_size	The initial byte count that is needed to workout
  *				the full pdu size.
  *
  * @param[in] full_fn		The callback function that will report the size
@@ -69,7 +69,7 @@ typedef NTSTATUS tstream_read_pdu_blob_full_fn_t(void *private_data,
 struct tevent_req *tstream_read_pdu_blob_send(TALLOC_CTX *mem_ctx,
 				struct tevent_context *ev,
 				struct tstream_context *stream,
-				size_t inital_read_size,
+				size_t initial_read_size,
 				tstream_read_pdu_blob_full_fn_t *full_fn,
 				void *full_private);
 /**
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 030bea4b299..bf999ddaab9 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -2163,7 +2163,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                     # (objectClass).
                     if list_attid_from_md[0] != 0:
                         error_count += 1
-                        self.report("ERROR: Not fixing incorrect inital attributeID in '%s' on '%s', it should be objectClass" %
+                        self.report("ERROR: Not fixing incorrect initial attributeID in '%s' on '%s', it should be objectClass" %
                                     (attrname, str(dn)))
 
                 got_repl_property_meta_data = True
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 0ddc01737bb..e5def9669f4 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -333,7 +333,7 @@ static ssize_t shadow_copy2_posix_gmt_string(struct vfs_handle_struct *handle,
  * snapshot at the given timestamp of the input path.
  *
  * In the case of a parallel snapdir (specified with an
- * absolute path), this is the inital portion of the
+ * absolute path), this is the initial portion of the
  * local path of any snapshot file. The complete path is
  * obtained by appending the portion of the file's path
  * below the share root's mountpoint.
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 74a71cbf04b..35181da3a4f 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -237,7 +237,7 @@ const struct dom_sid *pdb_get_group_sid(struct samu *sampass)
 }
 
 /**
- * Get flags showing what is initalised in the struct samu
+ * Get flags showing what is initialised in the struct samu
  * @param sampass the struct samu in question
  * @return the flags indicating the members initialised in the struct.
  **/
@@ -419,7 +419,7 @@ bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_sta
 }
 
 /**
- * Set flags showing what is initalised in the struct samu
+ * Set flags showing what is initialised in the struct samu
  * @param sampass the struct samu in question
  * @param flag The *new* flag to be set.  Old flags preserved
  *             this flag is only added.  
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 3d8012f2c06..40e3a4e13aa 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -3542,7 +3542,7 @@ static PyObject *py_pdb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs
 		return NULL;
 	}
 
-	/* Initalize list of methods */
+	/* Initialize list of methods */
 	status = make_pdb_method_name(&methods, url);
 	if (!NT_STATUS_IS_OK(status)) {
 		PyErr_Format(py_pdb_error, "Cannot load backend methods for '%s' backend (%d,%s)",
@@ -3727,7 +3727,7 @@ static PyMethodDef py_passdb_methods[] = {
 		Return domain SID from secrets database." },
 	{ "reload_static_pdb", py_reload_static_pdb, METH_NOARGS,
 		"reload_static_pdb() -> None\n\n \
-		Re-initalise the static pdb used internally.  Needed if 'passdb backend' is changed." },
+		Re-initialise the static pdb used internally.  Needed if 'passdb backend' is changed." },
 	{ NULL },
 };
 
diff --git a/source3/script/tests/test_net_rpc_join_creds.sh b/source3/script/tests/test_net_rpc_join_creds.sh
new file mode 100755
index 00000000000..f47dce4a1ea
--- /dev/null
+++ b/source3/script/tests/test_net_rpc_join_creds.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ $# -lt 5 ]; then
+cat <<EOF
+Usage: test_net_rpc_join_creds.sh  DOMAIN USERNAME PASSWORD SERVER PREFIX
+EOF
+exit 1;
+fi
+
+DOMAIN="$1"
+USERNAME="$2"
+PASSWORD="$3"
+SERVER="$4"
+PREFIX="$5"
+shift 5
+ADDARGS="$*"
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+mkdir -p $PREFIX/private
+# Test using a credentials file.
+credsfile=$PREFIX/creds.$$
+printf '%s\n' "username=$USERNAME" "password=$PASSWORD" "domain=$DOMAIN" > "$credsfile"
+testit "net_rpc_join_creds" $VALGRIND $BINDIR/net rpc join -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private -A"$credsfile" $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_testjoin_creds" $VALGRIND $BINDIR/net rpc testjoin -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_changetrustpw_creds" $VALGRIND $BINDIR/net rpc changetrustpw -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_testjoin2_creds" $VALGRIND $BINDIR/net rpc testjoin -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+rm -f $credsfile
+
+testok $0 $failed
diff --git a/source3/script/tests/test_net_rpc_share_allowedusers.sh b/source3/script/tests/test_net_rpc_share_allowedusers.sh
new file mode 100755
index 00000000000..5dd382d4c51
--- /dev/null
+++ b/source3/script/tests/test_net_rpc_share_allowedusers.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_net_rpc_share_allowedusers.sh  SERVER USERNAME PASSWORD PREFIX
+EOF
+exit 1;
+fi
+
+SERVER="$1"
+USERNAME="$2"
+PASSWORD="$3"
+PREFIX="$4"
+shift 4
+ADDARGS="$*"
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+mkdir -p $PREFIX/private
+net=$BINDIR/net
+# Check for the SID for group "Everyone" as a basic test things are working.
+testit_grep "net_usersidlist" '^ S-1-1-0$' $VALGRIND $net usersidlist $ADDARGS || failed=`expr $failed + 1`
+# Check "print$" share is listed by default.
+testit_grep "net_rpc_share_allowedusers" '^print\$$' $net usersidlist | $VALGRIND $net rpc share allowedusers -S$SERVER -U$USERNAME%$PASSWORD $ADDARGS || failed=`expr $failed + 1`
+# Check "print$" share is listed if we ask for it.
+testit_grep "net_rpc_share_allowedusers" '^print\$$' $net usersidlist | $VALGRIND $net rpc share allowedusers -S$SERVER -U$USERNAME%$PASSWORD $ADDARGS - 'print$' || failed=`expr $failed + 1`
+# Check user "user1" is allowed to read share "tmp".
+testit_grep "net_rpc_share_allowedusers" '^ user1$' $net usersidlist | $VALGRIND $net rpc share allowedusers -S$SERVER -U$USERNAME%$PASSWORD $ADDARGS || failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index bfe875e19fa..f30b03ce990 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -706,6 +706,11 @@ plantestsuite("samba3.blackbox.net_cache_samlogon", "ad_member:local",
               [os.path.join(samba3srcdir, "script/tests/test_net_cache_samlogon.sh"),
                '$SERVER', 'tmp', '$DC_USERNAME', '$DC_PASSWORD'])
 
+plantestsuite("samba3.blackbox.net_rpc_share_allowedusers", "nt4_dc",
+              [os.path.join(samba3srcdir, "script/tests/test_net_rpc_share_allowedusers.sh"),
+               "$SERVER", "$USERNAME", "$PASSWORD", "$PREFIX/net_rpc_share_allowedusers",
+               configuration])
+
 plantestsuite("samba3.blackbox.net_dom_join_fail_dc", "nt4_dc",
               [os.path.join(samba3srcdir, "script/tests/test_net_dom_join_fail_dc.sh"),
                "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_dom_join_fail_dc",
@@ -718,6 +723,10 @@ plantestsuite("samba3.blackbox.net_rpc_oldjoin", "nt4_dc:local",
               [os.path.join(samba3srcdir, "script/tests/test_net_rpc_oldjoin.sh"),
                "$SERVER", "$PREFIX/net_rpc_oldjoin",
                "$SMB_CONF_PATH"])
+plantestsuite("samba3.blackbox.net_rpc_join_creds", "nt4_dc",
+              [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join_creds.sh"),
+               "$DOMAIN", "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join_creds",
+               configuration])
 
 plantestsuite("samba3.blackbox.rpcclient_srvsvc", "simpleserver",
               [os.path.join(samba3srcdir, "script/tests/test_rpcclientsrvsvc.sh"),
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 40ba319bf3d..a3df8a1b736 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3756,7 +3756,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 				return status;
 			}
 		}
-		/* Note that here we set the *inital* delete on close flag,
+		/* Note that here we set the *initial* delete on close flag,
 		   not the regular one. The magic gets handled in close. */
 		fsp->initial_delete_on_close = True;
 	}
@@ -4292,7 +4292,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 		}
 
 		if (NT_STATUS_IS_OK(status)) {
-			/* Note that here we set the *inital* delete on close flag,
+			/* Note that here we set the *initial* delete on close flag,
 			   not the regular one. The magic gets handled in close. */
 			fsp->initial_delete_on_close = True;
 		}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 956b83ae08b..f2617fab3b3 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -6930,7 +6930,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
 			status = can_set_delete_on_close(fsp, 0);
 
 			if (NT_STATUS_IS_OK(status)) {
-				/* Note that here we set the *inital* delete on close flag,
+				/* Note that here we set the *initial* delete on close flag,
 				 * not the regular one. The magic gets handled in close. */
 				fsp->initial_delete_on_close = True;
 			}
diff --git a/source3/utils/net.c b/source3/utils/net.c
index e0776c8d82c..769e6f86f8f 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -50,6 +50,7 @@
 #include "messages.h"
 #include "cmdline_contexts.h"
 #include "lib/gencache.h"
+#include "auth/credentials/credentials.h"
 
 #ifdef WITH_FAKE_KASERVER
 #include "utils/net_afs.h"
@@ -904,6 +905,26 @@ static struct functable net_func[] = {
 };
 
 
+static void get_credentials_file(struct net_context *c,
+				 const char *file)
+{
+	struct cli_credentials *cred = cli_credentials_init(c);
+
+	if (cred == NULL) {
+		d_printf("ERROR: Unable to allocate memory!\n");
+		exit(-1);
+	}
+
+	if (!cli_credentials_parse_file(cred, file, CRED_GUESS_FILE)) {
+		exit(-1);
+	}
+
+	c->opt_user_name = cli_credentials_get_username(cred);
+	c->opt_user_specified = (c->opt_user_name != NULL);
+	c->opt_password = cli_credentials_get_password(cred);
+	c->opt_target_workgroup = cli_credentials_get_domain(cred);
+}
+
 /****************************************************************************
   main program
 ****************************************************************************/
@@ -923,6 +944,7 @@ static struct functable net_func[] = {
 		{"help",	'h', POPT_ARG_NONE,   0, 'h'},
 		{"workgroup",	'w', POPT_ARG_STRING, &c->opt_target_workgroup},
 		{"user",	'U', POPT_ARG_STRING, &c->opt_user_name, 'U'},
+		{"authentication-file", 'A', POPT_ARG_STRING, &c->opt_user_name, 'A', "Get the credentials from a file", "FILE"},
 		{"ipaddress",	'I', POPT_ARG_STRING, 0,'I'},
 		{"port",	'p', POPT_ARG_INT,    &c->opt_port},
 		{"myname",	'n', POPT_ARG_STRING, &c->opt_requester_name},
@@ -1025,6 +1047,9 @@ static struct functable net_func[] = {
 				c->opt_password = p+1;
 			}
 			break;
+		case 'A':
+			get_credentials_file(c, c->opt_user_name);
+			break;
 		default:
 			d_fprintf(stderr, _("\nInvalid option %s: %s\n"),
 				 poptBadOption(pc, 0), poptStrerror(opt));
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index b99a036fca1..41e72975e76 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -58,8 +58,8 @@ static NTSTATUS sync_files(struct copy_clistate *cp_clistate, const char *mask);
  * @brief RPC based subcommands for the 'net' utility.
  *
  * This file should contain much of the functionality that used to
- * be found in rpcclient, execpt that the commands should change
- * less often, and the fucntionality should be sane (the user is not
+ * be found in rpcclient, except that the commands should change
+ * less often, and the functionality should be sane (the user is not
  * expected to know a rid/sid before they conduct an operation etc.)
  *
  * @todo Perhaps eventually these should be split out into a number
@@ -256,7 +256,7 @@ fail:
 }
 
 /**


-- 
Samba Shared Repository



More information about the samba-cvs mailing list