Bug 14043 - samba-tool ntacl set <file-name> command not working
Summary: samba-tool ntacl set <file-name> command not working
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.10.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-22 03:10 UTC by Amit Kumar
Modified: 2019-07-22 03:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Kumar 2019-07-22 03:10:22 UTC
It looks above command is somehow broken

# samba-tool ntacl set <file-name>

Step-1: Gets object of 'type <samba.netcmd.ntacl.cmd_ntacl_set>' and calls _run method on it

# vim ./samba/netcmd/__init__.py
class SuperCommand(Command):
    def _run(self, myname, subcommand=None, *args):
        if subcommand in self.subcommands:
            self.subcommands[subcommand]._run()    

Step-2: But 'class cmd_ntacl_set(Command):' samba/netcmd/ntacl.py does not have _run() method rather it has 'run()'. So call never goes inside _run()
    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, service=None):
 

Step-3: Even though if I tried changing function name to _run(). sambaopts is always None. get_loadparm() cannot be called over None type.
"sambaopts": options.SambaOptions
lp = sambaopts.get_loadparm()