summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python
Commit message (Collapse)AuthorAgeFilesLines
* samba-tool: use ldb.binary_encode() on search expression elementsAndrew Tridgell2011-07-299-24/+27
| | | | | | | | this allows us to deal with search elements containing characters that must be escaped in LDAP Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
* samba-tool: fixed binary encoding of usernames in setpasswordAndrew Tridgell2011-07-291-2/+2
| | | | | Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* samba-tool: ensure prompting of passwords is in the right orderAndrew Tridgell2011-07-281-1/+3
| | | | | | | | | | | | ask the creds object for the password before prompting for the new password in the user password change code, to ensure the user is asked for the old password first Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Jul 28 08:35:45 CEST 2011 on sn-devel-104
* samba-tool: Added gpo fetch command implementation using python smb module.Amitay Isaacs2011-07-281-0/+94
| | | | | | | To copy the GPO files, use libcli python interface list() to get directory listing and loadfile() to read the contents of the file. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)Amitay Isaacs2011-07-281-78/+124
| | | | | | | | | | | Instead of using gpo dn as the key to refer to a gpo, use the gpo name as the key. If no URL is specified (-H option), find a writable DC and use that. Extract a commonly used method as get_gpo_info() to find details of a GPO. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Add user password command to change user's own passwordAmitay Isaacs2011-07-281-0/+33
| | | | | | | This command is a user-level command and differs from setpassword command which is administrator command. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Python routine to find writable/ldap-capable DCAmitay Isaacs2011-07-281-0/+13
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Raise exception on errors and report using base classAmitay Isaacs2011-07-281-10/+3
| | | | | | | Exceptions are captured at top-level samba-tool and reported using the base class (Command) method show_command_error(). Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Display Usage line and list commands alphabeticallyAmitay Isaacs2011-07-281-3/+6
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Replace C version of samba-tool with python versionAmitay Isaacs2011-07-281-70/+0
| | | | | | | C version of samba-tool is now called samba-tool-c, which will be removed as soon as all the samba-tool commands are ported to python. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Added python version of samba-toolAmitay Isaacs2011-07-281-0/+70
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Reimplement GPO functions in pythonAmitay Isaacs2011-07-281-11/+412
| | | | | | | Implementation of subcommands - show, getlink, setlink, dellink, getinheritance, setinheritance Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Removed newuserGiampaolo Lauria2011-07-282-94/+0
| | | | | | Removed newuser as its functionality has been moved to "user add" Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Changed "user add" implementationGiampaolo Lauria2011-07-281-13/+60
| | | | | | | Changed "user add" to use SamDB instead of Net Also, added the set of Options available in newuser Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: add -H or --URL where necessaryGiampaolo Lauria2011-07-287-19/+32
| | | | | | | To improve consistency, I've made sure all the commands take either a -H or --URL when specifying a URL Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4:samba-tool: ldapcmp needs CredentialsOptionsDoubleStefan Metzmacher2011-07-261-0/+6
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jul 26 17:09:32 CEST 2011 on sn-devel-104
* s4-param: use "state directory" and "cache directory" optionsBjörn Baumbach2011-07-211-5/+5
| | | | | | | instead of "state dir" and "cache dir" in order be compatible with the source3 code. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* samba-tool: make sure we exit with an error on a bad commandAndrew Tridgell2011-07-211-1/+2
| | | | | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Jul 21 04:58:01 CEST 2011 on sn-devel-104
* dbcheck: use string DN in delete when fixing broken strings DNsAndrew Tridgell2011-07-211-1/+1
| | | | | | this prevents the extended_dn_in module from 'fixing' the DN for us Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-provision: run dbcheck on a minimal set of objects in provisionAndrew Tridgell2011-07-211-4/+8
| | | | | | | this speeds up the dbcheck in provision to fix only the objects that we know will need fixing Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: change the samba3sam test to add the show_deleted moduleAndrew Tridgell2011-07-211-1/+1
| | | | | | | this is needed now that the samldb module adds the show deleted control Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* samba-tool: nicer error in passwordsettings with no settingsAndrew Tridgell2011-07-211-0/+2
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* samba-tool: testparm doesn't take any credentialsAndrew Tridgell2011-07-211-0/+5
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* samba-tool: use 'exportkeytab' instead of 'dumpkeys'Andrew Tridgell2011-07-211-3/+3
| | | | | | | a 'keytab' is a particular format known to administrators, whereas 'keys' is a bit too vague Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* samba-tool: Fix __doc_ in base classesGiampaolo Lauria2011-07-211-3/+3
| | | | | | Changed prog to samba-tool as prog is only meaningful in Parser Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed synopsis code in base classGiampaolo Lauria2011-07-211-8/+2
| | | | | | | As it is not always possible to determine the usage of a command solely based on the list of required and optional args, it is best to have the subclasses always define it, rather than displaying an incorrect usage statement. Currently, all commands are subclassing the synopsis. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Fixed bugs to determine min and max # of allowed argumentsGiampaolo Lauria2011-07-211-7/+14
| | | | | | | | | | | Fixed the bugs in the code to determine both the min and the max # of allowed arguments Changed the argument suffix convention from "*" to "+" to represent one or more arguments as: 1. It follows the Regular expression convention ("*" means 0 or more) 2. It is what was missing in terms of functionality NB Currently, no command is using the "*/+", but it is a good thing to have to help out the validation of the args if/when in the future we have such need Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Improved --help functionalityGiampaolo Lauria2011-07-211-2/+6
| | | | | | | Added a new --help msg Return an error when no subcommand is specified Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: fixed __doc__ in base classesGiampaolo Lauria2011-07-211-3/+3
| | | | | | Replaced the "net" word with %prog in all instances Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: Fix error handling in SuperCommand classGiampaolo Lauria2011-07-211-2/+11
| | | | | | | Created show_command_error method to handle errors in SuperCommand Removed statement in SuperCommand to raise exception Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: improved Option list for all user commandsGiampaolo Lauria2011-07-211-10/+7
| | | | | | Added metavar values for -H and added some default values for other options Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: added error handling for the user commandGiampaolo Lauria2011-07-211-10/+21
| | | | | | Caught exception whenever possible, added new check for newpassword to make sure it contains some chars Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: fixed drs commands synopsisGiampaolo Lauria2011-07-211-5/+5
| | | | | | Added [options] as needed Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: fixed synopsis on user commandsGiampaolo Lauria2011-07-211-1/+1
| | | | | | Fixed all synopsis to contain [options], filter, and username Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: fixed synopsis on all "user" commandsGiampaolo Lauria2011-07-211-4/+8
| | | | | | Added [options] where needed, fixed others where filter or username was needed, renamed name to username Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: moved takes_optiongroups definition to Command base classGiampaolo Lauria2011-07-2119-240/+23
| | | | | | | | | | The option groups should be defined at the Command base class level as they are in common across all samba-tool commands. Major move advantages: 1. more OOP approach 2. enforcing consistency across commands 3. avoiding the need of declaring for every new command Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed the assignment to parser.progGiampaolo Lauria2011-07-211-1/+0
| | | | | | The prog should only be set if we want it to be different than the name of the program that executed it. I think that for better portability we should not set it and let it default to samba-tool. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: fixed prog name in samba-toolGiampaolo Lauria2011-07-211-1/+1
| | | | | | Changed the prog name from net to samba-tool so that the usage statement is now correct Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: update vampire.py messageGiampaolo Lauria2011-07-211-1/+1
| | | | | | The update was necessary to reflect the move from join to domain join as part of the object-action work Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed join as it has been replaced by domain joinGiampaolo Lauria2011-07-212-80/+0
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: moved join to domain joinGiampaolo Lauria2011-07-211-1/+57
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed export as it has been moved to domain dumpkeysGiampaolo Lauria2011-07-212-58/+0
| | | | | | The functionality of export has been moved to domain dumpkeys to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: moved export to domain dumpkeysGiampaolo Lauria2011-07-211-0/+23
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed domainlevel as it has been moved to domain levelGiampaolo Lauria2011-07-212-249/+0
| | | | | | The functionality of domainlevel has been moved the "domain level" to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: moved domainlevel to domain levelGiampaolo Lauria2011-07-211-0/+201
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed machinepw as it has been moved to domain machinepasswordGiampaolo Lauria2011-07-212-58/+0
| | | | | | The functionality of machinepwd has been moved to "domain machinepassword" to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: moved machinepw to domain machinepasswordGiampaolo Lauria2011-07-211-1/+37
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: removed pwsettingsGiampaolo Lauria2011-07-211-197/+0
| | | | | | pwsettings functionality has been moved to user passwordsettings to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: created domain object, moved pwsettings to user passwordsettingsGiampaolo Lauria2011-07-212-2/+214
| | | | | | This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
* samba-tool: update test suite for add setpasswordGiampaolo Lauria2011-07-211-2/+0
| | | | | | The test suite needs to change from setpassword to "user setpassword" to reflect the new cmd syntax Signed-off-by: Andrew Tridgell <tridge@samba.org>