samba-tool user setexpiry is broken in 4.7

Andreas Schneider asn at samba.org
Wed Aug 2 06:27:20 UTC 2017


On Wednesday, 2 August 2017 07:46:40 CEST Andreas Schneider via samba-
technical wrote:
> On Tuesday, 1 August 2017 19:14:02 CEST Rowland Penny wrote:
> > On Tue, 01 Aug 2017 18:07:52 +0200
> > Andreas Schneider via samba-technical <samba-technical at lists.samba.org>
> > 
> > wrote:
> > > Hi,
> > > 
> > > The command 'samba-tool user setexpiry' doesn't work!
> > > 
> > > Reproducer:
> > > 
> > > make testenv SELFTEST_TESTENV=ad_member
> > > 
> > > $ bin/samba-tool user setexpiry alice --days=4 --URL=ldap://
> > > localdc.samba.example.com --username=administrator
> > > --password=locDCpass1 Expiry for user 'alice' set to 4 days.
> > > 
> > > $ bin/wbinfo --name-to-sid alice
> > > S-1-5-21-1321629873-2603511802-1948877269-1105 SID_USER (1)
> > > 
> > > $ bin/rpcclient ncacn_np:localdc -UAdministrator%locDCpass1 -c
> > > "queryuser 1105"
> > > User Name   :   alice
> > > ...
> > > Password last set Time   :      Tue, 01 Aug 2017 17:50:08 CEST
> > > Password must change Time:      Tue, 12 Sep 2017 17:50:08 CEST
> > > 
> > > 
> > > The must change time is 41 days away and not 4 days as set!
> > > 
> > > 
> > > Either the test python/samba/tests/samba_tool/user.py does not work
> > > as it should, or there is a bug in the rpc server.
> > 
> > Hi Andreas, I think you are getting a bit mixed up here, account expiry
> > has nothing to do with the password.
> 
> Damn, how do you change the password expiration?

Check the attached patch, that irritated me.


	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
>From 9d1c7a204cffbd1be95743182978a9d3a630ae31 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 2 Aug 2017 07:52:24 +0200
Subject: [PATCH] pyton:samba: Fix help of samba-tool user setexpiry

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 python/samba/netcmd/user.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index 3b744a3f4ac..da31fb38eea 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -642,7 +642,7 @@ Example4 shows how to set the account expiration so that it will never expire.
                metavar="URL", dest="H"),
         Option("--filter", help="LDAP Filter to set password on", type=str),
         Option("--days", help="Days to expiry", type=int, default=0),
-        Option("--noexpiry", help="Password does never expire", action="store_true", default=False),
+        Option("--noexpiry", help="Account does never expire", action="store_true", default=False),
     ]
 
     takes_args = ["username?"]
-- 
2.13.3



More information about the samba-technical mailing list