Bug 15454 - Error on samba-tool gpo dellink
Summary: Error on samba-tool gpo dellink
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.18.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Douglas Bagnall
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-16 08:22 UTC by keesvanvloten
Modified: 2023-08-16 21:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keesvanvloten 2023-08-16 08:22:21 UTC
In 4.18.5 I getting an error on "samba-tool gpo dellink":

------------
samba-tool gpo listcontainers '{E3B6035C-E684-4E2A-B853-31A7BD7D2F2E}' -H /var/lib/samba/private/sam.ldb
ldb_wrap open of secrets.ldb
Container(s) using GPO {E3B6035C-E684-4E2A-B853-31A7BD7D2F2E}
   DN: DC=example,DC=com

samba-tool gpo dellink DC=example,DC=com {E3B6035C-E684-4E2A-B853-31A7BD7D2F2E} -H /var/lib/samba/private/sam.ldb --username=<redacted> --password=<redacted>
descriptor_prepare_commit: changes: num_registrations=0
descriptor_prepare_commit: changes: num_registered=0
descriptor_prepare_commit: changes: num_toplevel=0
descriptor_prepare_commit: changes: num_processed=0
descriptor_prepare_commit: objects: num_processed=0
descriptor_prepare_commit: objects: num_skipped=0
Deleted GPO link.
lpcfg_load: refreshing parameters from /etc/samba/smb.conf
GPO(s) linked to DN DC=example,DC=com
    GPO     : {77B1F807-CABA-493E-AC6F-7377E5A466F5}
    Name    : example_gpo_name
    Options : NONE

<redacted lot of linked GPOs>

ERROR(ldb): Cannot get information for GPOs - No such Base DN: CN={83789B30-2FAC-4ABD-A3B5-43C5E7AE6AC1},CN=Policies,CN=System,DC=example,DC=com
  File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 165, in get_gpo_info
    msg = samdb.search(base=base_dn, scope=search_scope,
------------

And returncode: 255

Do note the output ends with "scope=search_scope," as if more output was expected...

It looks like it crashes after the link is removed:

------------
samba-tool gpo listcontainers '{E3B6035C-E684-4E2A-B853-31A7BD7D2F2E}' -H /var/lib/samba/private/sam.ldb
ldb_wrap open of secrets.ldb
No Containers using GPO {E3B6035C-E684-4E2A-B853-31A7BD7D2F2E}
------------

I don't remember seeing this when we were testing last year in 4.15, which makes me think it was introduced after that time.