1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

55 Commits

Author SHA1 Message Date
Giampaolo Lauria
8de3f98ef2 samba-tool: Removed newuser
Removed newuser as its functionality has been moved to "user add"

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:51 +10:00
Andrew Tridgell
7f9d45bf10 samba-tool: make sure we exit with an error on a bad command
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
2011-07-21 04:58:01 +02:00
Giampaolo Lauria
6e7b8aaf1d samba-tool: Fix __doc_ in base classes
Changed prog to samba-tool as prog is only meaningful in Parser

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
5f5eb1b003 samba-tool: removed synopsis code in base class
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>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
452e50919e samba-tool: Fixed bugs to determine min and max # of allowed arguments
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>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
f03a059814 samba-tool: Improved --help functionality
Added a new --help msg
Return an error when no subcommand is specified

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
a2e2c130b0 samba-tool: fixed __doc__ in base classes
Replaced the "net" word with %prog in all instances

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
903ec440c4 samba-tool: Fix error handling in SuperCommand class
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>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
f6fa868489 samba-tool: moved takes_optiongroups definition to Command base class
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>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
1dfcb019d2 samba-tool: removed the assignment to parser.prog
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>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
35d534b026 samba-tool: fixed prog name in samba-tool
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>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
b8b20f7a46 samba-tool: removed join as it has been replaced by domain join
This is part of the samba-tool work to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
8f274af3f8 samba-tool: removed export as it has been moved to domain dumpkeys
The functionality of export has been moved to domain dumpkeys to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
0cef2bff9c samba-tool: removed domainlevel as it has been moved to domain level
The functionality of domainlevel has been moved the "domain level" to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
e573037ac5 samba-tool: removed machinepw as it has been moved to domain machinepassword
The functionality of machinepwd has been moved to "domain machinepassword" to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
e5255f0920 samba-tool: created domain object, moved pwsettings to user passwordsettings
This is part of the samba-tool work to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:22 +10:00
Giampaolo Lauria
c4a92292c1 samba-tool: update test suite for add setpassword
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>
2011-07-21 10:32:22 +10:00
Stefan Metzmacher
dee41bcdf2 s4:samba-tool: add "delegation" subcommands for S4U2Proxy and related stuff
For now this only works on the local sam.ldb, but it shouldn't be hard
to improve it to talk to remove servers.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2011-06-24 19:06:44 +02:00
Andrew Tridgell
0c89d624e6 s4-samba-tool: added dbcheck commmand
this will be used as a consistency checker and repair tool for
sam.ldb. This initial checkin just checks for empty attributes and
offers to fix them

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jun 10 10:31:56 CEST 2011 on sn-devel-104
2011-06-10 10:31:56 +02:00
Theresa Halloran
23177b5f44 s4:samba-tool: Move samba-tool setexpiry to samba-tool user setexpiry <user>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-01 17:24:36 +10:00
Theresa Halloran
726ee12bb4 s4/samba-tool: Move samba-tool enableaccount to samba-tool user enable command.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-01 17:24:36 +10:00
Kai Blin
4b78956985 s4 samba-tool: Implement "testparm" command
This is a port of the existing "testparm" python script to a samba-tool
command.

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Tue Apr  5 07:49:13 CEST 2011 on sn-devel-104
2011-04-05 07:49:13 +02:00
Andrew Tridgell
a1f96923e6 s4-samba-tool: improved exception handling in samba-tool
we now do reasonable printing on a wide range of common exception
classes, and always force a backtrace on an exception if the debug
level is >= 3

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
2010-11-29 18:04:42 +11:00
Andrew Tridgell
abe9ac53f0 s4-ldapcmp: make ldapcmp a samba-tool command
The ldapcmp tool is very useful, and should be available to Samba
admins, not just developers. This makes it a samba-tool command, which
also gives it the nicer command line handling that samba-tool has
2010-11-29 18:04:42 +11:00
Andrew Tridgell
7a826d02a3 s4-samba-tool: started on gpo subcommands in python
this adds the listall GPO command. Currently the python variants are
available as "samba-tool gpo2 SUBCOMMAND". These will replace the
"samba-tool gpo" commands when complete
2010-11-29 18:04:41 +11:00
Andrew Tridgell
60bf020394 s4-samba-tool: support help, and show description of commands
when you don't specify a subcommand, show the description of the
subcommands in the list of available subcommands. Also show the list
of subcommands when you use 'help', '--help' or '-h' as a subcommand

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sun Nov 28 01:56:46 CET 2010 on sn-devel-104
2010-11-28 01:56:46 +01:00
Andrew Tridgell
3d8d382fe5 s4-samba-tool: switched over to python version of samba-tool drs 2010-11-28 00:16:38 +11:00
Andrew Tridgell
d8f48c7ffc s4-net: added "net rodc preload" command
this command will preload the credentials for an account from the full
domain controller

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-26 22:50:20 +10:00
Andrew Tridgell
a2cb6ef017 s4-net: moved the net join command to python
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-23 15:55:39 +10:00
Matthieu Patou
cad04dabbb s4 net: Add spn module to list/add/remove spn on objects
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-07-10 11:18:17 +02:00
Andrew Tridgell
4cb423f527 s4-python: python is not always in /usr/bin
Using "#!/usr/bin/env python" is more portable. It still isn't ideal
though, as we should really use the python path found at configure
time. We do that in many places already, but some don't.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-24 18:46:57 +10:00
Lukasz Zalewski
c58c0c2129 Modifications extending functionality of newuser cmd and new net group set of commands for group related operations on ldb
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-06-20 01:29:03 +02:00
Jelmer Vernooij
47c4e883d6 s4-net: Add definition of outf. 2010-04-12 02:55:27 +02:00
Jelmer Vernooij
0d92dd1074 s4-net: Cope with options without arguments. 2010-04-09 11:53:00 +02:00
Jelmer Vernooij
9af8d02b22 s4-net: Convert machinepw command to python. 2010-04-09 11:53:00 +02:00
Jelmer Vernooij
f83aa13f62 s4-net: Convert vampire command over to Python. 2010-04-09 11:53:00 +02:00
Jelmer Vernooij
ffa73c412e s4-net: Convert user subcommand to Python. 2010-04-09 11:53:00 +02:00
Jelmer Vernooij
26d928e948 s4-net: Convert 'net time' to python. 2010-04-08 23:41:08 +02:00
Jelmer Vernooij
cf17d48dec Migrate 'net export keytab' to python. 2010-04-08 22:37:35 +02:00
Nadezhda Ivanova
a212c1dedb Added a net acl ds command for modification of ACLs on directory objects
At present the command supports only addition of control access rigts, done
so DRS access checks can be tested. It will be expanded to deal with most
ways to modify and view a DS ACL.
Shifted commands a bit. What used to be net acl is now "net acl nt" as apposed
to this, which is "net acl ds"

./bin/net acl ds set --help
Usage: set --objectdn=objectdn --car=control right --action=[deny|allow] --trusteedn=trustee-dn

Options:
  -h, --help            show this help message and exit
  --host=HOST           LDB URL for database or target server
  --car=CAR              The access control right to allow or deny
  --action=ACTION       Deny or allow access
  --objectdn=OBJECTDN   DN of the object whose SD to modify
  --trusteedn=TRUSTEEDN
                        DN of the entity that gets access

  Samba Common Options:
    -s FILE, --configfile=FILE
                        Configuration file

  Credentials Options:
    --simple-bind-dn=DN
                        DN to use for a simple bind
    --password=PASSWORD
                        Password
    -U USERNAME, --username=USERNAME
                        Username
    -W WORKGROUP, --workgroup=WORKGROUP
                        Workgroup
    -N, --no-pass       Don't ask for a password
    -k KERBEROS, --kerberos=KERBEROS
                        Use Kerberos
2010-03-16 13:37:48 +02:00
Jelmer Vernooij
6d9c0724a6 ntacl: Use existing infrastructure. 2010-03-01 04:44:08 +01:00
Nadezhda Ivanova
dffb5ad2bf Implemented net fsmo command for transferring fsmo roles
The command allows the user to transfer a fsmo role to the server to which
the connection is established. Roles can be transferred or seized. By default a
transfer is attempted even if seize option is chosen, as it is dangerous to
seize a role if the current owner is still running.
example use:
net fsmo show --host=hostnameoraddress --username=username --password=password
net fsmo transfer --role=role --host=hostnameoraddress --username=username --password=password
net fsmo seize --role=role --host=hostnameoraddress --username=username --password=password [--force]

Tested against Win2008. Does not work for samba 4 yet as we are missing the GetNCChanges extensions.
2010-01-27 17:57:37 +02:00
Matthieu Patou
a4b01dd59c s4: utils recreate in python setntacl and getntacl
setntacl is able to set NTACL attribute from command line
  getntacl now use getopt for parsing command line option and is also able to
  dump the acl in the SDDL format.
2010-01-21 07:11:18 +13:00
Jelmer Vernooij
7effe2d2e3 net: Support 'super' commands implemented in Python.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:28 +11:00
Jelmer Vernooij
9e5ef916d4 net: Move 'newuser' to 'net newuser'
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:27 +11:00
Jelmer Vernooij
73594c248f net: Fix tests and documentation of setexpiry.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:25 +11:00
Jelmer Vernooij
345b25d059 net: Move setexpiry to 'net setexpiry'
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:24 +11:00
Jelmer Vernooij
b531696a5b net: Move 'setpassword' to 'net setpassword'.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:22 +11:00
Jelmer Vernooij
e2c4d8281d s4/net: Allow options before arguments for Python commands. 2009-12-29 16:26:20 +01:00
Jelmer Vernooij
433f58f5a7 s4/net: Pass all arguments through to the Python commands. 2009-12-29 16:26:20 +01:00