1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

37 Commits

Author SHA1 Message Date
Amitay Isaacs
0365df93e6 samba-tool: gpo: Use utility function dc_url() to set the connection url
In create and fetch subcommands, we also need to know DC hostname. So first
find a DC and use DC hostname to construct connection url. If ldap:// url is
specified with -H, then use that to construct DC hostname.
2012-07-03 15:20:42 +10:00
Amitay Isaacs
a9c4336733 samba-tool: gpo: Refactor code using utility functions 2012-07-03 15:20:42 +10:00
Amitay Isaacs
5ca24346bf samba-tool: gpo: Add utility functions get_gpo_containers and del_gpo_link
Thanks to Denis Bonnenfant <denis.bonnenfant@diderot.org> for patch
2012-07-03 15:20:42 +10:00
Amitay Isaacs
e93ed5f69a samba-tool: gpo: Use gpo (id) instead of gpo_dn (DN)
Thanks to Denis Bonnenfant <denis.bonnenfant@diderot.org> for patch.
2012-07-03 15:20:41 +10:00
Amitay Isaacs
963f0df179 samba-tool: gpo: Correct the attribute name from gPlink to gPLink
Thanks to Denis Bonnenfant <denis.bonnenfant@diderot.org> for patch.
2012-07-03 15:20:41 +10:00
Amitay Isaacs
7563032acd samba-tool: gpo: Fix policy DN
Thanks to Denis Bonnenfant <denis.bonnenfant@diderot.org> for patch.
2012-07-03 15:20:41 +10:00
Amitay Isaacs
17ad62b33a samba-tool: gpo: Fix creation of filesystem ACL from directory ACL
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jun 21 03:25:57 CEST 2012 on sn-devel-104
2012-06-21 03:25:57 +02:00
Andreas Schneider
82c2bca89b s4-python: Remove env from non-executable netcmd scripts. 2012-03-13 17:52:29 +01:00
Jelmer Vernooij
9ecc68abe7 'samba-tool gpo': Properly close transaction. 2012-02-25 20:39:05 +01:00
Jelmer Vernooij
a0ff4c349c Revert "samba-tool: moved takes_optiongroups definition to Command base class"
This reverts commit f6fa8684896b8f3f9f8b7bd3742c99906973274c.

This keeps the main command class fairly slim, and makes it a bit
more obvious where the arguments to run() are coming from.

Conflicts:

	source4/scripting/python/samba/netcmd/__init__.py
	source4/scripting/python/samba/netcmd/domain.py
	source4/scripting/python/samba/netcmd/gpo.py
	source4/scripting/python/samba/netcmd/newuser.py
	source4/scripting/python/samba/netcmd/testparm.py
	source4/scripting/python/samba/netcmd/user.py
	source4/scripting/python/samba/tests/samba_tool/__init__.py
2012-02-07 01:11:08 +01:00
Amitay Isaacs
d0ab0a4cee samba-tool: Add transaction wrapper for creating GPO
This ensures that if the GPT files are not copied via SMB,
AD changes are rolled back.

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Tue Dec 20 09:12:41 CET 2011 on sn-devel-104
2011-12-20 09:12:41 +01:00
Amitay Isaacs
0cee9b01d9 samba-tool: Fix DN for GPO entries 2011-12-14 15:57:32 +11:00
Amitay Isaacs
8b94a34bac samba-tool: gpo: fix a typo 2011-12-14 15:57:32 +11:00
Amitay Isaacs
d8bed322fc samba-tool: Remove duplicate code of dsacl to fsacl conversion
Use samba.ntacls.dsacl2fsacl() instead.
2011-12-14 15:57:32 +11:00
Jelmer Vernooij
9213f398ad samba-tool: Don't require full prog line to be in synopsis. 2011-10-14 00:22:57 +02:00
Jelmer Vernooij
88d997a63e samba-tool: Use self.outf in a few more places.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Oct 13 05:06:52 CEST 2011 on sn-devel-104
2011-10-13 05:06:52 +02:00
Jelmer Vernooij
8111001977 netcmd: Avoid catching all exceptions, avoid using ';' at the end of lines.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Oct  8 15:46:46 CEST 2011 on sn-devel-104
2011-10-08 15:46:46 +02:00
Giampaolo Lauria
ca30b9ff3e samba-tool: Expanded acronym descriptions
Expanded command acronym descriptions
Added footnote for "server connection needed"

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Amitay Isaacs
4967b04ada samba-tool: Remove gpo setacl command 2011-08-13 10:25:06 +10:00
Stefan Metzmacher
10752c5b5b s4:netcmd/gpo.py: we don't need to set autogenerated attributes
metze
2011-08-06 10:35:40 +02:00
Amitay Isaacs
7d137f8bda samba-tool: Add implementation of gpo create command
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:09 +10:00
Amitay Isaacs
fb798d35df samba-tool: Add functions to create directories and copy files over SMB share
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:07 +10:00
Amitay Isaacs
c670465c23 samba-tool: Rename copy_directory_recurse to copy_directory_remote_to_local
gpo fetch is remote->local and gpo create is local->remote
local is local filesystem and remote is smb share.
Need two functions to copy local->remote and remote->local.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:55 +10:00
Amitay Isaacs
1e3667934b samba-tool: Addd functions to print GPO flags and GPlink options
Use methods from python wrapper to convert gpo flags and gplink
options to string.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:53 +10:00
Andrew Tridgell
03f92508ef samba-tool: use ldb.binary_encode() on search expression elements
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>
2011-07-29 18:17:44 +10:00
Amitay Isaacs
2b6ea7975b samba-tool: Added gpo fetch command implementation using python smb module.
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>
2011-07-28 15:20:54 +10:00
Amitay Isaacs
d6db6614dd samba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)
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>
2011-07-28 15:20:54 +10:00
Amitay Isaacs
e74661066b samba-tool: Reimplement GPO functions in python
Implementation of subcommands - show, getlink, setlink, dellink,
getinheritance, setinheritance

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:51 +10:00
Giampaolo Lauria
41f073eb60 samba-tool: add -H or --URL where necessary
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>
2011-07-28 15:20:51 +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
Andrew Tridgell
087ee1f40e s4-gpo: fixed display of GPO version numbers 2011-06-06 12:26:10 +10:00
Andrew Tridgell
a0bc538a8f s4-samba-tool: fixed the gpo command to use the right DN for access checks 2011-01-14 16:39:33 +11:00
Andrew Bartlett
29fb42a48b s4-samba_tool Added ACL checking to python GPO management tool 2011-01-14 16:39:32 +11:00
Andrew Tridgell
545932fda5 samba-tools: more reasonable defaults for samba-tool commands
- fallback to machine account where possible

- default to local hostname where this is reasonable
2010-12-08 05:26:05 +01:00
Andrew Tridgell
37bfc4ec38 s4-samba-tool: fixed exception handling in subcommands
this switches to the new pattern of:

 except Exception, e:
 	raise CommandError("some error message", e)
2010-11-29 18:04:42 +11:00
Andrew Tridgell
6982a00ded s4-gpo: started on samba-tool gpo list command 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