samba-tool group listmembers: always list objects which can not expire master
authorBjörn Baumbach <bb@sernet.de>
Fri, 23 Apr 2021 16:03:53 +0000 (18:03 +0200)
committerBjörn Baumbach <bb@sernet.de>
Mon, 26 Apr 2021 12:30:22 +0000 (14:30 +0200)
Otherwise for example contacts wouldn't be listed when the
--hide-expired option is used. Contacts typically do not have the
accountExpires attribute.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14692

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Rowland penny <rpenny@samba.org>
python/samba/netcmd/group.py
selftest/knownfail.d/samba4.blackbox.group [deleted file]

index a958db2c42c360323813f7d9a5777e36d8b99f4d..3c8a9054339e0c32b07a0a3ce6515132dcc95b23 100644 (file)
@@ -544,8 +544,11 @@ samba-tool group listmembers \"Domain Users\" -H ldap://samba.samdom.example.com
             filter_expires = ""
             if hide_expired is True:
                 current_nttime = samdb.get_nttime()
-                filter_expires = \
-                "(|(accountExpires=0)(accountExpires>=%u))" % (current_nttime)
+                filter_expires = ("(|"
+                                  "(!(accountExpires=*))"
+                                  "(accountExpires=0)"
+                                  "(accountExpires>=%u)"
+                                  ")" % (current_nttime))
 
             filter_disabled = ""
             if hide_disabled is True:
diff --git a/selftest/knownfail.d/samba4.blackbox.group b/selftest/knownfail.d/samba4.blackbox.group
deleted file mode 100644 (file)
index c236c8a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba4.blackbox.group.py