debian 9 fresh install, samba-4.10.2 from Louis: root at lnxdc1:/home/service# samba-tool domain passwordsettings show Password informations for domain 'DC=mydomain,DC=lan' Password complexity: on Store plaintext passwords: off Password history length: 10 Minimum password length: 8 Minimum password age (days): 0 Maximum password age (days): 60 Account lockout duration (mins): 30 Account lockout threshold (attempts): 0 Reset account lockout after (mins): 30 if I try to change the max password age: root at lnxdc1:/home/service# samba-tool domain passwordsettings set --max-pwd-age=90 ERROR(<class 'TypeError'>): uncaught exception - unorderable types: NoneType() >= int() File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 185, in _run return self.run(*args, **kwargs) File "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line 1513, in run if max_pwd_age and max_pwd_age > 0 and min_pwd_age >= max_pwd_age: root at lnxdc1:/home/service# dpkg -S /usr/lib/python3/dist-packages/samba/netcmd/domain.py python3-samba: /usr/lib/python3/dist-packages/samba/netcmd/domain.py root at lnxdc1:/home/service# dpkg -l python3-samba Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-===============================-====================-====================-===================================================================ii python3-samba 2:4.10.2+nmu-1debian amd64 Python 3 bindings for Samba
Hai, Well, i think you found a bug here, i get exact the same. But i found a workaround ;-) We need to verify it. Can someone test this on a source build also for this. Try this for the error. samba-tool domain passwordsettings show samba-tool domain passwordsettings set --max-pwd-age=90 That errors. And if you try this and set Min + Max age, then it works: kinit Administrator samba-tool domain passwordsettings set --max-pwd-age=90 --min-pwd-age=1 -k yes Minimum password age changed! Maximum password age changed! All changes applied successfully! If some people here can verify it, then we can put it in bugzilla. Greetz, Louis> -----Oorspronkelijk bericht----- > Van: samba [mailto:samba-bounces at lists.samba.org] Namens > banda bassotti via samba > Verzonden: zondag 5 mei 2019 21:20 > Aan: samba at lists.samba.org > Onderwerp: [Samba] samba-tool max-pwd-age error > > debian 9 fresh install, samba-4.10.2 from Louis: > > root at lnxdc1:/home/service# samba-tool domain passwordsettings show > Password informations for domain 'DC=mydomain,DC=lan' > > Password complexity: on > Store plaintext passwords: off > Password history length: 10 > Minimum password length: 8 > Minimum password age (days): 0 > Maximum password age (days): 60 > Account lockout duration (mins): 30 > Account lockout threshold (attempts): 0 > Reset account lockout after (mins): 30 > > if I try to change the max password age: > > root at lnxdc1:/home/service# samba-tool domain passwordsettings set > --max-pwd-age=90 > ERROR(<class 'TypeError'>): uncaught exception - unorderable types: > NoneType() >= int() > File > "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 185, > in _run > return self.run(*args, **kwargs) > File > "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line 1513, > in run > if max_pwd_age and max_pwd_age > 0 and min_pwd_age >= max_pwd_age: > > root at lnxdc1:/home/service# dpkg -S > /usr/lib/python3/dist-packages/samba/netcmd/domain.py > python3-samba: /usr/lib/python3/dist-packages/samba/netcmd/domain.py > root at lnxdc1:/home/service# dpkg -l python3-samba > Desired=Unknown/Install/Remove/Purge/Hold > | > Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) > ||/ Name Version Architecture > Description > +++-===============================-====================-====> ===============-=============================================> =====================> ii python3-samba 2:4.10.2+nmu-1debian amd64 > Python 3 bindings for Samba > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba > >
On Mon, 6 May 2019 08:57:35 +0200 "L.P.H. van Belle via samba" <samba at lists.samba.org> wrote:> Hai, > > Well, i think you found a bug here, i get exact the same. > But i found a workaround ;-) > > We need to verify it. Can someone test this on a source build also > for this. > > Try this for the error. > samba-tool domain passwordsettings show > samba-tool domain passwordsettings set --max-pwd-age=90 > > That errors. > > And if you try this and set Min + Max age, then it works: > > kinit Administrator > samba-tool domain passwordsettings set --max-pwd-age=90 > --min-pwd-age=1 -k yes Minimum password age changed! > Maximum password age changed! > All changes applied successfully! > > If some people here can verify it, then we can put it in bugzilla. >Morning Louis, It does appear to be a bug ;-) If you run: samba-tool domain passwordsettings --help Amongst the output is this: --min-pwd-age=MIN_PWD_AGE The minimum password age (<integer in days> | default). Default is 1. Which seems to say, if you don't supply the minimum password age, '1' will be used, BUT: The code runs like this: def run(self, H=None, min_pwd_age=None,........ if min_pwd_age is not None: if min_pwd_age == "default": min_pwd_age = 1 else: min_pwd_age = int(min_pwd_age) If you haven't supplied the minimum password age, the 'def' will set it to 'None'. This means that the code meant to set the minimum password age to '1' is never run because 'min_pwd_age' is 'None' I think the code should be: if min_pwd_age is None: if min_pwd_age == "default": min_pwd_age = 1 else: min_pwd_age = int(min_pwd_age) Rowland