+
    4Ssië  ã                   ó`   € ^ RI Ht ^ RIHt ^ RIHt ^ RIHtH	t	H
t
 ^ RIHt  ! R R]4      tR# )é    N)Úldb)Úsystem_session)ÚCommandÚCommandErrorÚOption)ÚSamDBc                   ó  a € ] tR t^t o RtRt]! RRR]RRR7      ]! R	R
]R7      ]! RR]R7      ]! RR]R7      ]! RR]R7      ]! RR]R7      .tRR.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )Úcmd_user_add_unix_attrsa…
  Add RFC2307 attributes to a user.

This command adds Unix attributes to a user account in the Active
Directory domain.

The username specified on the command is the sAMaccountName.

You must supply a unique uidNumber.

Unix (RFC2307) attributes will be added to the user account.

If you supply a gidNumber with '--gid-number', this will be used for the
users Unix 'gidNumber' attribute.

If '--gid-number' is not supplied, the users Unix gidNumber will be set to the
one found in 'Domain Users', this means Domain Users must have a gidNumber
attribute.

if '--unix-home' is not supplied, the users Unix home directory will be
set to /home/DOMAIN/username

if '--login-shell' is not supplied, the users Unix login shell will be
set to '/bin/sh'

if ---gecos' is not supplied, the users Unix gecos field will be set to the
users 'CN'

Add 'idmap_ldb:use rfc2307 = Yes' to the smb.conf on DCs, to use these
attributes for UID/GID mapping.

The command may be run from the root userid or another authorised userid.
The -H or --URL= option can be used to execute the command against a
remote server.

Example1:
samba-tool user addunixattrs User1 10001

Example1 shows how to add RFC2307 attributes to a domain enabled user
account, Domain Users will be set as the users gidNumber.

The users Unix ID will be set to '10001', provided this ID isn't already
in use.

Example2:
samba-tool user addunixattrs User2 10002 --gid-number=10001 --unix-home=/home/User2

Example2 shows how to add RFC2307 attributes to a domain enabled user
account.

The users Unix ID will be set to '10002', provided this ID isn't already
in use.

The users gidNumber attribute will be set to '10001'

The users Unix home directory will be set to '/home/user2'

Example3:
samba-tool user addunixattrs User3 10003 --gid-number=10001 --login-shell=/bin/false --gecos='User3 test'

Example3 shows how to add RFC2307 attributes to a domain enabled user
account.

The users Unix ID will be set to '10003', provided this ID isn't already
in use.

The users gidNumber attribute will be set to '10001'

The users Unix login shell will be set to '/bin/false'

The users gecos field will be set to 'User3 test'

Example4:
samba-tool user addunixattrs User4 10004 --gid-number=10001 --unix-home=/home/User4 --login-shell=/bin/bash --gecos='User4 test'

Example4 shows how to add RFC2307 attributes to a domain enabled user
account.

The users Unix ID will be set to '10004', provided this ID isn't already
in use.

The users gidNumber attribute will be set to '10001'

The users Unix home directory will be set to '/home/User4'

The users Unix login shell will be set to '/bin/bash'

The users gecos field will be set to 'User4 test'

z'%prog <username> <uid-number> [options]z-Hz--URLz%LDB URL for database or target serverÚURLÚH)ÚhelpÚtypeÚmetavarÚdestz--gid-numberzUser's Unix/RFC2307 GID)r   r   z--unix-homez"User's Unix/RFC2307 home directoryz--login-shellzUser's Unix/RFC2307 login shellz--gecoszUser's Unix/RFC2307 GECOS fieldz--uidzUser's Unix/RFC2307 usernameÚusernamez
uid-numberÚ	sambaoptsÚcredoptsÚversionoptsNc           	     ó~  € VP                  4       pVP                  V4      p\        V\        4       WÜR 7      pVP	                  4       pRP                  V4      pVP                  V\        P                  VR7      p\        V4      ^ 8w  d   \        RP                  V4      4      hRP                  \        P                  ! V4      4      pVP                  V\        P                  VR7      p\        V4      ^ 8X  d   \        RP                  V4      4      hV^ ,          P                  pRV^ ,          9   d   \        RP                  V4      4      hV
f   V^ ,          R	,          ^ ,          p
Vf   V^ ,          R	,          ^ ,          pVfc   RP                  \        P                  ! R
4      4      p VP                  V\        P                  VR7      pV F  pVP                  R4      pK  	  V	f   Rp	VfS   VP                  4       pVf   \        R4      hVP                  R4      pVP!                  RV4      P!                  RV4      pVP                  R4      '       g   V P"                  P%                  R4       RP                  VW'W«W˜4      pVP'                  4         VP)                  V4       VP+                  4        V P"                  P%                  RP                  V4      4       R#   \         d    \        R4      hi ; i  \        P,                   d!   p\        RP                  TT4      4      hRp?ii ; i))ÚurlÚsession_infoÚcredentialsÚlpz%(&(objectClass=person)(uidNumber={})))ÚscopeÚ
expressionz#uidNumber {} is already being used.z(samaccountname={})zUnable to find user '{}'Ú	uidNumberzUser {} is already a Unix user.NÚcnzDomain UsersÚ	gidNumberz0Domain Users does not have a gidNumber attributez/bin/shzUnable to find Unix domainztemplate homedirz%Dz%Uzidmap_ldb:use rfc2307z“You are setting a Unix/RFC2307 UID & GID. You may want to set 'idmap_ldb:use rfc2307 = Yes' in smb.conf to use the attributes for XID/SID-mapping.
zÎ
dn: {0}
changetype: modify
add: uidNumber
uidNumber: {1}
add: gidnumber
gidNumber: {2}
add: gecos
gecos: {3}
add: uid
uid: {4}
add: loginshell
loginShell: {5}
add: unixHomeDirectory
unixHomeDirectory: {6}
z Modified User '{}' successfully
z Failed to modify user '{0}': {1})Úget_loadparmÚget_credentialsr   r   Ú	domain_dnÚformatÚsearchr   ÚSCOPE_SUBTREEÚlenr   Úbinary_encodeÚdnÚgetÚ
IndexErrorÚdomain_netbios_nameÚreplaceÚoutfÚwriteÚtransaction_startÚmodify_ldifÚtransaction_commitÚLdbError)Úselfr   Ú
uid_numberr   r   r   r   Ú
gid_numberÚ	unix_homeÚlogin_shellÚgecosÚuidr   ÚcredsÚsamdbÚdomaindnÚfilterÚresÚuser_dnÚsearch_filterÚmsgÚunix_domainÚtmplÚuser_modÚes   &&&&&&&&&&&&             ÚB/usr/lib/python3/dist-packages/samba/netcmd/user/add_unix_attrs.pyÚrunÚcmd_user_add_unix_attrs.run‘   s  € ð ×#Ñ#Ó%ˆØ×(Ñ(¨Ó,ˆä˜!¬.Ó*:Ø"'ô0ˆð —?‘?Ó$ˆð :ß‘6˜*Ó%ð 	à�l‰l˜8Ü!$×!2Ñ!2Ø&,ð ó .ˆô �‹H˜ŒMÜÐDß &¡ zÓ 2ó4ð 4ð '×-Ñ-¬c×.?Ò.?ÀÓ.IÓJˆØ�l‰l˜8Ü!$×!2Ñ!2Ø&,ð ó .ˆô �‹H˜ŒMÜÐ9×@Ñ@ÀÓJÓKÐKà�a•&—)‘)ˆà˜#˜a�&Ô ÜÐ@ß &¡ xÓ 0ó2ð 2ð Š=Ø˜•F˜4•L •OˆEàŠ;Ø�a•&˜•,˜q•/ˆCàÒØ2ß$™f¤S×%6Ò%6°~Ó%FÓGð ð;Ø—l‘l 8Ü),×):Ñ):Ø.;ð #ó =�ó �CØ!$§¡¨Ó!5’Jñ ð ÒØ#ˆKàÒà×3Ñ3Ó5ˆKØÒ"Ü"Ð#?Ó@Ð@à—6‘6Ð,Ó-ˆDØŸ™ T¨;Ó7×?Ñ?ÀÀhÓOˆIà�v‰vÐ-×.Ò.Ø�I‰I�O‰Oð 1ô 2ð
÷ �Fˆ7�J¨E¸ÓOð 	ð" 	×ÑÔ!ð	/Ø×Ñ˜hÔ'ð
 ×$Ñ$Ô&Ø�I‰I�O‰OÐ?ß#™V HÓ-ö/øô_ ô ;Ü"ð $:ó ;ð ;ð;ûôT �|‰|ô 	5ÜÐAß &¡ x°Ó 3ó5ð 5ûð	5ús$   Æ1<K- Ê L Ë-LÌL<ÌL7Ì7L<© )	NNNNNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úsynopsisr   ÚstrÚtakes_optionsÚ
takes_argsÚoptionsÚSambaOptionsÚCredentialsOptionsÚVersionOptionsÚtakes_optiongroupsrF   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @rE   r
   r
      s¼   ø‡ € ñ[ðz 9€Hñ 	ˆt�WÐ#JØ ¨Sô	2áˆ~Ð$=ÀCÔHÙˆ}Ð#GØô	áˆÐ%FØô	áˆyÐ@ÀsÔKÙˆwÐ;À#ÔFð
€Mð ˜lÐ+€Jð 	�W×)Ñ)Ø�G×.Ñ.Ø�w×-Ñ-ð
Ð÷c/ò c/ó    r
   )Úsamba.getoptÚgetoptrR   Úsambar   Ú
samba.authr   Úsamba.netcmdr   r   r   Úsamba.samdbr   r
   rH   rZ   rE   Ú<module>ra      s'   ðõ, Ý Ý %ß 6Ñ 6Ý ôW/˜gö W/rZ   