The Samba-Bugzilla – Attachment 16597 Details for
Bug 14692
"samba-tool group listmembers --hide-expired" does not list objects without accountExpires attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix for 4.14, cherry-picked from master
fix-14692.patch (text/plain), 4.55 KB, created by
Björn Baumbach
on 2021-04-26 15:59:59 UTC
(
hide
)
Description:
fix for 4.14, cherry-picked from master
Filename:
MIME Type:
Creator:
Björn Baumbach
Created:
2021-04-26 15:59:59 UTC
Size:
4.55 KB
patch
obsolete
>From 032fc89864f2db1eedad7a5a316befa3685a14fd Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb@sernet.de> >Date: Fri, 23 Apr 2021 18:01:33 +0200 >Subject: [PATCH 1/2] test samba-tool group listmembers: test listing contacts > as group members >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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@sernet.de> >Reviewed-by: Rowland penny <rpenny@samba.org> >(cherry picked from commit 86f2b8dab1102974d32275282dfe69f4af5b6834) >--- > selftest/knownfail.d/samba4.blackbox.group | 1 + > source4/setup/tests/blackbox_group.sh | 9 +++++++++ > 2 files changed, 10 insertions(+) > create mode 100644 selftest/knownfail.d/samba4.blackbox.group > >diff --git a/selftest/knownfail.d/samba4.blackbox.group b/selftest/knownfail.d/samba4.blackbox.group >new file mode 100644 >index 00000000000..c236c8a63e1 >--- /dev/null >+++ b/selftest/knownfail.d/samba4.blackbox.group >@@ -0,0 +1 @@ >+^samba4.blackbox.group.py >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 > >-- >2.26.3 > > >From 72c5249b536241efc146184597f5b9af23698053 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb@sernet.de> >Date: Fri, 23 Apr 2021 18:03:53 +0200 >Subject: [PATCH 2/2] samba-tool group listmembers: always list objects which > can not expire >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> > >Autobuild-User(master): Björn Baumbach <bb@sernet.de> >Autobuild-Date(master): Mon Apr 26 13:21:43 UTC 2021 on sn-devel-184 > >(cherry picked from commit 2e2426e51576aae6211950b25aaacdd97815b111) >--- > python/samba/netcmd/group.py | 7 +++++-- > selftest/knownfail.d/samba4.blackbox.group | 1 - > 2 files changed, 5 insertions(+), 3 deletions(-) > delete mode 100644 selftest/knownfail.d/samba4.blackbox.group > >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/selftest/knownfail.d/samba4.blackbox.group b/selftest/knownfail.d/samba4.blackbox.group >deleted file mode 100644 >index c236c8a63e1..00000000000 >--- a/selftest/knownfail.d/samba4.blackbox.group >+++ /dev/null >@@ -1 +0,0 @@ >-^samba4.blackbox.group.py >-- >2.26.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
rpenny
:
review-
bbaumbach
:
ci-passed+
Actions:
View
Attachments on
bug 14692
: 16597