Bug 7455 - Patch: extended version of newuser and newgroup script for net cmd utility
Summary: Patch: extended version of newuser and newgroup script for net cmd utility
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Jelmer Vernooij
QA Contact: samba4-qa@samba.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 10:53 UTC by Lukasz Zalewski
Modified: 2010-06-30 02:27 UTC (History)
0 users

See Also:


Attachments
Attached patch files (3.51 KB, application/x-gzip)
2010-05-26 10:54 UTC, Lukasz Zalewski
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Zalewski 2010-05-26 10:53:14 UTC
Hi!
I have attached a tarball containing collection of scripts that extend and add to the current net cmd functionality. 
newscriptadv.py based on the existing newuser cmd utility but adds ability to specify custom prefix to users container as compared to default CN=Users and allows filling some (but not all although full set could be added) of the other parameters such as first name, initials, last name, decription etc

newgroupadv.py based on newuser tmeplate it allows addition of new groups with ability to specify custom prefix to groups container and allowing definitaion of additional parameters such as description, email and type and scope of the group

two diffs samdb.py.diff and __init__.py.diff contian extensions to the existing code to allow extended functionality of the above two scripts
Comment 1 Lukasz Zalewski 2010-05-26 10:54:00 UTC
Created attachment 5740 [details]
Attached patch files
Comment 2 Matthias Dieter Wallnöfer 2010-05-26 11:02:47 UTC
This is Python stuff. So reassigning it up to Jelmer.
Comment 3 Jelmer Vernooij 2010-05-26 11:46:08 UTC
Thanks for the patch!

Can you please send it to the mailing list as a single unified diff mentioning it fixes this bug report?

A couple of things I noticed while looking at the patch:
 * please use dashes rather than CamelCasing in argument names, consistent with the rest of Samba
 * please avoid tabs in python code, use spaces everywhere (in compliance with PEP8)
Comment 4 Lukasz Zalewski 2010-05-26 17:18:47 UTC
Thx Jelmer,
diff sent to the list.
I have also noticed that when account is created in AD through mmc's Active Directory Users and Computers the CN is
CN=GivenName Initals. Surname (if any of them are defined)
or
CN=username (if none of the GivenName, Initals and Surname is defined)

newuser script seems to use tha latter format, which i personally prefer - is this by design?
Comment 5 Matthias Dieter Wallnöfer 2010-05-27 08:26:06 UTC
Well, I think we chose the latter format since it's easier to apply it ;) But if you really like to be consistent with the MMC then I would start a discussion on the technical mailing list.
Comment 6 Matthias Dieter Wallnöfer 2010-06-30 02:27:40 UTC
Merged.