Bug 13873 - Samba 4.10/Py3: samba-tool domain passwordsettings set --max-pwd-age cmd fails
Samba 4.10/Py3: samba-tool domain passwordsettings set --max-pwd-age cmd fails
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB
4.10.0
All All
: P5 normal
: ---
Assigned To: Tim Beale
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-31 20:28 UTC by Tim Beale
Modified: 2019-04-03 12:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Beale 2019-03-31 20:28:20 UTC
Can't set max-pwd-age (Maximum Password Age for the domain) using samba-tool.

As reported on list: 
https://lists.samba.org/archive/samba/2019-March/222100.html

samba-tool domain passwordsettings set --max-pwd-age=270
WARNING: The "server schannel" option is deprecated
ERROR(<class 'TypeError'>): uncaught exception - unorderable types: NoneType() >= int()
  File "bin/python/samba/netcmd/__init__.py", line 185, in _run
    return self.run(*args, **kwargs)
  File "bin/python/samba/netcmd/domain.py", line 1514, in run
    if max_pwd_age and max_pwd_age > 0 and min_pwd_age >= max_pwd_age:

The problem is the command doesn't work using python3. Should be simple to fix. In the meantime, the workaround is to specify min-pwd-age as well as max-pwd-age. E.g.

samba-tool domain passwordsettings set --max-pwd-age=270 --min-pwd-age=default
WARNING: The "server schannel" option is deprecated
Minimum password age changed!
Maximum password age changed!
All changes applied successfully!