Backtrace when running "gpo manage motd set" to update an existing motd policy
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| samba (Ubuntu) |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
| Noble |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
| Oracular |
Won't Fix
|
Undecided
|
Andreas Hasenack | ||
| Plucky |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Bug Description
[ Impact ]
The MOTD policy sets the message of the day text for domain joined linux computers to which the policy applies. The message can be set with "samba-tool gpo manage motd set", but due to this bug, it can only be set once, and not updated again (unless removed, and recreated).
If an attempt is made to try to update an existing MOTD policy, with samba-tool, it will crash like this:
ubuntu@o-ad:~$ sudo samba-tool gpo manage motd set {31B2F340-
WARNING: Using passwords on command line is insecure. Installing the setproctitle python module will hide these from shortly after program start.
ubuntu@o-ad:~$ sudo samba-tool gpo manage motd set {31B2F340-
WARNING: Using passwords on command line is insecure. Installing the setproctitle python module will hide these from shortly after program start.
ERROR(<class 'UnboundLocalEr
File "/usr/lib/
return self.run(*args, **kwargs)
File "/usr/lib/
text = ET.SubElement(data, 'text')
[ Test Plan ]
This SRU includes a new test case for this bug, part of the existing d/t/samba-
For verification purposes, the samba-ad-
## MOTD GPO tests (server only)
[ Where problems could occur ]
This is changing the code that deals specifically with the MOTD GPO, nothing else, so regressions there could manifest themselves in failures to apply that policy, or even syntax errors in the policy file (given this is XML after all).
This bug was found while trying to reproduce https:/
[ Other Info ]
Not at this time.
[ Original Description ]
When an motd policy already exists, the "set" command fails:
root@n-ad:~# samba-tool gpo manage motd set $gpo "Welcome" -U Administrator%
WARNING: Using passwords on command line is insecure. Installing the setproctitle python module will hide these from shortly after program start.
ERROR(<class 'UnboundLocalEr
File "/usr/lib/
return self.run(*args, **kwargs)
File "/usr/lib/
text = ET.SubElement(data, 'text')
Filed upstream as https:/
This might be a fix (untested):
diff --git a/python/
index 96fce917f0f.
--- a/python/
+++ b/python/
@@ -3808,7 +3808,9 @@ samba-tool gpo manage motd set {31B2F340-
return
try:
- xml_data = ET.fromstring(
+ xml_data = ET.ElementTree(
+ policysetting = xml_data.
+ data = policysetting.
except NTSTATUSError as e:
if e.args[0] in [NT_STATUS_
Related branches
- git-ubuntu bot: Approve
- Lukas Märdian (community): Approve
- Canonical Server Core Reviewers: Pending requested
- Canonical Server Reporter: Pending requested
-
Diff: 4046 lines (+3574/-7)7 files modifieddebian/changelog (+2985/-0)
debian/control (+30/-6)
debian/patches/fix-update-motd-gpo.patch (+33/-0)
debian/patches/series (+1/-0)
debian/tests/control (+4/-0)
debian/tests/samba-ad-dc-provisioning-internal-dns (+398/-0)
debian/tests/util (+123/-1)
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 61 lines (+39/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/fix-update-motd-gpo.patch (+31/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 242 lines (+203/-3)5 files modifieddebian/changelog (+7/-3)
debian/patches/deprecated-readfp-configparser.patch (+86/-0)
debian/patches/fix-update-motd-gpo.patch (+31/-0)
debian/patches/gpo-segfault-fix.patch (+76/-0)
debian/patches/series (+3/-0)
| tags: | added: server-todo |
| Changed in samba (Ubuntu): | |
| assignee: | nobody → Andreas Hasenack (ahasenack) |
| status: | New → In Progress |
| summary: |
- Backtrace when running gpo manage motd set" to update an existing motd + Backtrace when running "gpo manage motd set" to update an existing motd policy |
| description: | updated |
| description: | updated |
| description: | updated |
| description: | updated |
| Changed in samba (Ubuntu Noble): | |
| status: | Fix Committed → Confirmed |
| Changed in samba (Ubuntu Oracular): | |
| assignee: | nobody → Andreas Hasenack (ahasenack) |
| Changed in samba (Ubuntu Noble): | |
| assignee: | nobody → Andreas Hasenack (ahasenack) |
| description: | updated |

Status changed to 'Confirmed' because the bug affects multiple users.