** Description changed: + [ Impact ] + + * An explanation of the effects of the bug on users and justification + for backporting the fix to the stable release. + + * In addition, it is helpful, but not required, to include an + explanation of how the upload fixes this bug. + + [ Test Plan ] + + * detailed instructions how to reproduce the bug + + * these should allow someone who is not familiar with the affected + package to reproduce the bug and verify that the updated package + fixes the problem. + + * if other testing is appropriate to perform before landing this + update, this should also be described here. + + [ Where problems could occur ] + + * Think about what the upload changes in the software. Imagine the + change is wrong or breaks something else: how would this show up? + + * It is assumed that any SRU candidate patch is well-tested before + upload and has a low overall risk of regression, but it's important + to make the effort to think about what ''could'' happen in the event + of a regression. + + * This must never be "None" or "Low", or entirely an argument as to why + your upload is low risk. + + * This both shows the SRU team that the risks have been considered, + and provides guidance to testers in regression-testing the SRU. + + [ Other Info ] + + * Anything else you think is useful to include + + * Make sure to explain any deviation from the norm, to save the SRU + reviewer from having to infer your reasoning, possibly incorrectly. + This should also help reduce review iterations, particularly when the + reason for the deviation is not obvious. + + * Anticipate questions from users, SRU, +1 maintenance, security teams + and the Technical Board and address these questions in advance + + [ 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%Passw0rd WARNING: Using passwords on command line is insecure. Installing the setproctitle python module will hide these from shortly after program start. ERROR(<class 'UnboundLocalError'>): uncaught exception - cannot access local variable 'data' where it is not associated with a value - File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in _run - return self.run(*args, **kwargs) - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 3829, in run - text = ET.SubElement(data, 'text') - ^^^^ - + File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in _run + return self.run(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 3829, in run + text = ET.SubElement(data, 'text') + ^^^^ Filed upstream as https://bugzilla.samba.org/show_bug.cgi?id=15774 This might be a fix (untested): diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py index 96fce917f0f..fe9b7caacb2 100644 --- a/python/samba/netcmd/gpo.py +++ b/python/samba/netcmd/gpo.py @@ -3808,7 +3808,9 @@ samba-tool gpo manage motd set {31B2F340-016D-11D2-945F-00C04FB984F9} "Message f - return - - try: + return + + try: - xml_data = ET.fromstring(conn.loadfile(vgp_xml)) + xml_data = ET.ElementTree(ET.fromstring(conn.loadfile(vgp_xml))) + policysetting = xml_data.getroot().find('policysetting') + data = policysetting.find('data') - except NTSTATUSError as e: - if e.args[0] in [NT_STATUS_OBJECT_NAME_INVALID, - NT_STATUS_OBJECT_NAME_NOT_FOUND, + except NTSTATUSError as e: + if e.args[0] in [NT_STATUS_OBJECT_NAME_INVALID, + NT_STATUS_OBJECT_NAME_NOT_FOUND,
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2092308 Title: Backtrace when running "gpo manage motd set" to update an existing motd policy To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2092308/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
