[PATCH] samba-tool 'user create' examples incorrect

Rowland Penny repenny241155 at gmail.com
Mon Nov 9 10:12:31 UTC 2015


Hi, the attached patch fixes a very small problem. If you run 
'samba-tool user create --help' you get lines like this:

Example5:
samba-tool user add User5 passw5rd --nis-domain=samdom 
--unix-home=/home/User5

Note that it uses 'add' instead of 'create', the attached patch fixes this.

Rowland
-------------- next part --------------
From b32e91a0bb9f23983b3ebfecb9a946d6eda911a1 Mon Sep 17 00:00:00 2001
From: Rowland Penny <repenny241155 at gmail.com>
Date: Mon, 9 Nov 2015 10:05:05 +0000
Subject: [PATCH] samba-tool: user create examples show 'add' instead of
 'create' Signed-off-by: Rowland Penny
 <repenny241155 at gmail.com>

---
 python/samba/netcmd/user.py |   51 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 38 insertions(+), 13 deletions(-)

diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index ec91a93..c6757e1 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -41,39 +41,64 @@ from samba.netcmd import (
 class cmd_user_create(Command):
     """Create a new user.
 
-This command creates a new user account in the Active Directory domain.  The username specified on the command is the sAMaccountName.
+This command creates a new user account in the Active Directory domain.  
+The username specified on the command is the sAMaccountName.
 
-User accounts may represent physical entities, such as people or may be used as service accounts for applications.  User accounts are also referred to as security principals and are assigned a security identifier (SID).
+User accounts may represent physical entities, such as people or may be used as 
+service accounts for applications.  User accounts are also referred to as 
+security principals and are assigned a security identifier (SID).
 
-A user account enables a user to logon to a computer and domain with an identity that can be authenticated.  To maximize security, each user should have their own unique user account and password.  A user's access to domain resources is based on permissions assigned to the user account.
+A user account enables a user to logon to a computer and domain with an 
+identity that can be authenticated.  To maximize security, each user should 
+have their own unique user account and password.  A user's access to domain 
+resources is based on permissions assigned to the user account.
 
-Unix (RFC2307) attributes may be added to the user account. Attributes taken from NSS are obtained on the local machine. Explicitly given values override values obtained from NSS. Configure 'idmap_ldb:use rfc2307 = Yes' to use these attributes for UID/GID mapping.
+Unix (RFC2307) attributes may be added to the user account. Attributes taken 
+from NSS are obtained on the local machine. Explicitly given values override 
+values obtained from NSS. Configure 'idmap_ldb:use rfc2307 = Yes' to use these 
+attributes for UID/GID mapping.
 
-The command may be run from the root userid or another authorized userid.  The -H or --URL= option can be used to execute the command against a remote server.
+The command may be run from the root userid or another authorized userid.  
+The -H or --URL= option can be used to execute the command against a remote 
+server.
 
 Example1:
-samba-tool user add User1 passw0rd --given-name=John --surname=Smith --must-change-at-next-login -H ldap://samba.samdom.example.com -Uadministrator%passw1rd
+samba-tool user create User1 passw0rd --given-name=John --surname=Smith \
+    --must-change-at-next-login -H ldap://samba.samdom.example.com \
+    -Uadministrator%passw1rd
 
-Example1 shows how to create a new user in the domain against a remote LDAP server.  The -H parameter is used to specify the remote target server.  The -U option is used to pass the userid and password authorized to issue the command remotely.
+Example1 shows how to create a new user in the domain against a remote LDAP 
+server.  
+The -H parameter is used to specify the remote target server.  
+The -U option is used to pass the userid and password authorized to issue the 
+command remotely.
 
 Example2:
-sudo samba-tool user add User2 passw2rd --given-name=Jane --surname=Doe --must-change-at-next-login
+sudo samba-tool user create User2 passw2rd --given-name=Jane --surname=Doe \
+    --must-change-at-next-login
 
-Example2 shows how to create a new user in the domain against the local server.   sudo is used so a user may run the command as root.  In this example, after User2 is created, he/she will be forced to change their password when they logon.
+Example2 shows how to create a new user in the domain against the local server.   
+sudo is used so a user may run the command as root. In this example, after 
+User2 is created, they will be forced to change their password when they logon.
 
 Example3:
-samba-tool user add User3 passw3rd --userou='OU=OrgUnit'
+samba-tool user create User3 passw3rd --userou='OU=OrgUnit'
 
 Example3 shows how to create a new user in the OrgUnit organizational unit.
 
 Example4:
 samba-tool user create User4 passw4rd --rfc2307-from-nss --gecos 'some text'
 
-Example4 shows how to create a new user with Unix UID, GID and login-shell set from the local NSS and GECOS set to 'some text'.
+Example4 shows how to create a new user with Unix UID, GID and login-shell set 
+from the local NSS and GECOS set to 'some text'.
 
 Example5:
-samba-tool user add User5 passw5rd --nis-domain=samdom --unix-home=/home/User5 \
-           --uid-number=10005 --login-shell=/bin/false --gid-number=10000
+samba-tool user create User5 passw5rd --nis-domain=samdom \
+--unix-home=/home/User5 --uid-number=10005 --login-shell=/bin/false \
+   --gid-number=10000
+
+Example5 shows how to create an RFC2307/NIS domain enabled user account. If
+--nis-domain is set, then the other four parameters are mandatory.
 
 Example5 shows how to create an RFC2307/NIS domain enabled user account. If
 --nis-domain is set, then the other four parameters are mandatory.
-- 
1.7.10.4



More information about the samba-technical mailing list