summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-12-15 21:24:26 +1100
committerJeremy Allison <jra@samba.org>2013-01-08 03:39:20 +0100
commiteae01b0d3daf5bae9edada73669e3af879b000bb (patch)
tree279f49e0bac39ea5cd01c5695ec77d41c4ab5a17 /source4
parentcef5f466af80406d9a1ce0b37d1ed1d237d59be1 (diff)
downloadsamba-eae01b0d3daf5bae9edada73669e3af879b000bb.tar.gz
samba-eae01b0d3daf5bae9edada73669e3af879b000bb.tar.bz2
samba-eae01b0d3daf5bae9edada73669e3af879b000bb.zip
samba-tool Add --service argument to samba-tool ntacl get/set
This also ensures a VFS connect is done to the correct service. Andrew Bartlett Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 8 03:39:21 CET 2013 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/ntacl.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/netcmd/ntacl.py b/source4/scripting/python/samba/netcmd/ntacl.py
index 838f9bab30..6d4d350653 100644
--- a/source4/scripting/python/samba/netcmd/ntacl.py
+++ b/source4/scripting/python/samba/netcmd/ntacl.py
@@ -56,14 +56,16 @@ class cmd_ntacl_set(Command):
choices=["native","tdb"]),
Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
Option("--use-ntvfs", help="Set the ACLs directly to the TDB or xattr for use with the ntvfs file server", action="store_true"),
- Option("--use-s3fs", help="Set the ACLs for use with the default s3fs file server via the VFS layer", action="store_true")
+ Option("--use-s3fs", help="Set the ACLs for use with the default s3fs file server via the VFS layer", action="store_true"),
+ Option("--service", help="Name of the smb.conf service to use when applying the ACLs", type="string")
]
takes_args = ["acl","file"]
def run(self, acl, file, use_ntvfs=False, use_s3fs=False,
quiet=False,xattr_backend=None,eadb_file=None,
- credopts=None, sambaopts=None, versionopts=None):
+ credopts=None, sambaopts=None, versionopts=None,
+ service=None):
logger = self.get_logger()
lp = sambaopts.get_loadparm()
try:
@@ -87,7 +89,7 @@ class cmd_ntacl_set(Command):
# ensure we are using the right samba_dsdb passdb backend, no matter what
s3conf.set("passdb backend", "samba_dsdb:%s" % samdb.url)
- setntacl(lp, file, acl, str(domain_sid), xattr_backend, eadb_file, use_ntvfs=use_ntvfs)
+ setntacl(lp, file, acl, str(domain_sid), xattr_backend, eadb_file, use_ntvfs=use_ntvfs, service=service)
if use_ntvfs:
logger.warning("Please note that POSIX permissions have NOT been changed, only the stored NT ACL")
@@ -109,14 +111,16 @@ class cmd_ntacl_get(Command):
choices=["native","tdb"]),
Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
Option("--use-ntvfs", help="Get the ACLs directly from the TDB or xattr used with the ntvfs file server", action="store_true"),
- Option("--use-s3fs", help="Get the ACLs for use via the VFS layer used by the default s3fs file server", action="store_true")
+ Option("--use-s3fs", help="Get the ACLs for use via the VFS layer used by the default s3fs file server", action="store_true"),
+ Option("--service", help="Name of the smb.conf service to use when getting the ACLs", type="string")
]
takes_args = ["file"]
def run(self, file, use_ntvfs=False, use_s3fs=False,
as_sddl=False, xattr_backend=None, eadb_file=None,
- credopts=None, sambaopts=None, versionopts=None):
+ credopts=None, sambaopts=None, versionopts=None,
+ service=None):
lp = sambaopts.get_loadparm()
try:
samdb = SamDB(session_info=system_session(),
@@ -135,7 +139,7 @@ class cmd_ntacl_get(Command):
# ensure we are using the right samba_dsdb passdb backend, no matter what
s3conf.set("passdb backend", "samba_dsdb:%s" % samdb.url)
- acl = getntacl(lp, file, xattr_backend, eadb_file, direct_db_access=use_ntvfs)
+ acl = getntacl(lp, file, xattr_backend, eadb_file, direct_db_access=use_ntvfs, service=service)
if as_sddl:
try:
domain_sid = security.dom_sid(samdb.domain_sid)