[SCM] Samba Shared Repository - branch master updated

Björn Baumbach bbaumbach at samba.org
Mon Apr 26 13:22:01 UTC 2021


The branch, master has been updated
       via  2e2426e5157 samba-tool group listmembers: always list objects which can not expire
       via  86f2b8dab11 test samba-tool group listmembers: test listing contacts as group members
       via  6fcde09f093 pyldb: fix a typo
      from  16d1abb63eb lib:replace: Fix possible resource leaks in test_closefrom()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2e2426e51576aae6211950b25aaacdd97815b111
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Apr 23 18:03:53 2021 +0200

    samba-tool group listmembers: always list objects which can not expire
    
    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 at sernet.de>
    Reviewed-by: Rowland penny <rpenny at samba.org>
    
    Autobuild-User(master): Björn Baumbach <bb at sernet.de>
    Autobuild-Date(master): Mon Apr 26 13:21:43 UTC 2021 on sn-devel-184

commit 86f2b8dab1102974d32275282dfe69f4af5b6834
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Apr 23 18:01:33 2021 +0200

    test samba-tool group listmembers: test listing contacts as group members
    
    Make sure that contacts are listed as group members, even if the
    --hide-expired option is used.
    
    Expect failure. Fix follows up.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14692
    
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Rowland penny <rpenny at samba.org>

commit 6fcde09f093db5d26c582a3c28531265f06b9fde
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Jan 18 16:48:21 2021 +0100

    pyldb: fix a typo
    
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Rowland penny <rpenny at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/pyldb.c                       | 2 +-
 python/samba/netcmd/group.py          | 7 +++++--
 source4/setup/tests/blackbox_group.sh | 9 +++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 7802757eb78..be01b24325b 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -4279,7 +4279,7 @@ static PyMethodDef py_ldb_global_methods[] = {
 		"S.string_to_time(string) -> int\n\n"
 		"Parse a LDAP time string into a UNIX timestamp." },
 	{ "valid_attr_name", py_valid_attr_name, METH_VARARGS,
-		"S.valid_attr_name(name) -> bool\n\nn"
+		"S.valid_attr_name(name) -> bool\n\n"
 		"Check whether the supplied name is a valid attribute name." },
 	{ "binary_encode", py_binary_encode, METH_VARARGS,
 		"S.binary_encode(string) -> string\n\n"
diff --git a/python/samba/netcmd/group.py b/python/samba/netcmd/group.py
index a958db2c42c..3c8a9054339 100644
--- a/python/samba/netcmd/group.py
+++ b/python/samba/netcmd/group.py
@@ -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/source4/setup/tests/blackbox_group.sh b/source4/setup/tests/blackbox_group.sh
index ae3a9849a70..5fa622ecb25 100755
--- a/source4/setup/tests/blackbox_group.sh
+++ b/source4/setup/tests/blackbox_group.sh
@@ -132,6 +132,15 @@ testit_expect_failure "group addmembers contact failure" $PYTHON $samba_tool gro
 # test add contact with --object-types=all
 testit "group addmembers contact object-type all" $PYTHON $samba_tool group addmembers $CONFIG dsg testcontact --object-types=all
 
+# test listing contacts as group members
+testit_grep "group listmembers contact" "^testcontact" $PYTHON $samba_tool group listmembers $CONFIG dsg
+
+# test listing contacts as group members
+# Make sure that the test contact is listed, because it does not have the
+# accountExpires attribute and can not expire.
+testit_grep "group listmembers contact hide-expired" "^testcontact" $PYTHON $samba_tool group listmembers $CONFIG dsg --hide-expired
+testit_grep "group listmembers contact hide-disabled" "^testcontact" $PYTHON $samba_tool group listmembers $CONFIG dsg --hide-disabled
+
 # test remove contact with --object-types=all
 testit "group removemembers contact object-type all" $PYTHON $samba_tool group removemembers $CONFIG dsg testcontact --object-types=all
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list