Bug 15877 - gpclass.py doesn't handle empty string
Summary: gpclass.py doesn't handle empty string
Status: ASSIGNED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.21.3
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-04 13:28 UTC by Alex Sharov
Modified: 2025-07-12 01:32 UTC (History)
2 users (show)

See Also:


Attachments
patch for 4.22 and 4.21 (1.43 KB, patch)
2025-07-11 07:26 UTC, Andreas Schneider
dbagnall: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Sharov 2025-07-04 13:28:13 UTC
GP_LINK class is used to get GPO links from AD DC.

gpo_parse_gplink is parsing links we get from DC, and it doesn't handle empty link that looks like '[ ]'.

If there is an empty link for whatever reason, samba-gpupdate fails on getting GPOs.

Proposition:

Add check for the link to not be empty, e.g. check if ';' that separates LDAP link and options exists. Later we assume that semicolon is there.
Comment 2 Samba QA Contact 2025-07-10 18:56:03 UTC
This bug was referenced in samba master:

44ee31c0258b0afb3d3f2ce17942cc86e308a690
Comment 3 Douglas Bagnall 2025-07-11 00:43:56 UTC
This probably affects 4.19+, post a8bad5d5b859a2a76ce18919fbe2bf42f8ef7562 (2023-04), but I'm not aware of reports of it causing problems. Do we want to backport?
Comment 4 Andreas Schneider 2025-07-11 07:26:10 UTC
Created attachment 18671 [details]
patch for 4.22 and 4.21
Comment 5 Douglas Bagnall 2025-07-12 01:32:12 UTC
For 4.21 and 4.22, thanks.