samba-tool gpo manage motd set failing with invalid handle on s390x

Andreas Hasenack andreas.hasenack at canonical.com
Mon May 5 22:52:50 UTC 2025


Hi,

I just wrote some tests around the motd GPO subset of commands of
samba-tool, and am baffled at a failure I'm getting only on s390x (big
endian).

On a freshly provisioned AD/DC controller, samba 4.21.4, I run this
command, and it fails:

# samba-tool gpo manage motd set
"{31B2F340-016D-11D2-945F-00C04FB984F9}" hello-there  -U Administrator
Password for [EXAMPLE.FAKE\Administrator]:
ERROR(runtime): uncaught exception - (3221225480, 'An invalid HANDLE
was specified.')
  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line
353, in _run
    return self.run(*args, **kwargs)
           ~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 3850, in run
    reg.increment_gpt_ini(machine_changed=True)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/policies.py", line 198,
in increment_gpt_ini
    self.__save_file(self.pol_dir % '', GPT_INI,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     out_data.read().encode('utf-8'))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/policies.py", line 99, in
__save_file
    self.conn.set_acl(file_name, self.fs_sd)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/samba3/libsmb_samba_internal.py",
line 128, in set_acl
    self.set_sd(fnum, sd, sinfo)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^

I bumped the logs to 10, but didn't spot anything obvious. The motd
text is set correctly in the manifest:
# cat /var/lib/samba/sysvol/example/Policies/\{31B2F340-016D-11D2-945F-00C04FB984F9\}/MACHINE/VGP/VTLA/Unix/MOTD/manifest.xml
;echo
<?xml version='1.0' encoding='UTF-8'?>
<vgppolicy><policysetting><version>1</version><name>Text
File</name><description>Represents a Generic Text
File</description><apply_mode>replace</apply_mode><data><filename>motd</filename><text>hello-there</text></data></policysetting></vgppolicy>

The manifest.xml file does get posix acls, if that matters:
# getfacl /var/lib/samba/sysvol/example/Policies/\{31B2F340-016D-11D2-945F-00C04FB984F9\}/MACHINE/VGP/VTLA/Unix/MOTD/manifest.xml
getfacl: Removing leading '/' from absolute path names
# file: var/lib/samba/sysvol/example/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/VGP/VTLA/Unix/MOTD/manifest.xml
# owner: BUILTIN\\administrators
# group: users
user::rwx
user:root:rwx                   #effective:r--
user:BUILTIN\\administrators:rwx        #effective:r--
user:BUILTIN\\server\040operators:r-x   #effective:r--
user:NT\040Authority\\system:rwx        #effective:r--
user:NT\040Authority\\authenticated\040users:r-x        #effective:r--
group::---
group:BUILTIN\\administrators:rwx       #effective:r--
group:BUILTIN\\server\040operators:r-x  #effective:r--
group:NT\040Authority\\system:rwx       #effective:r--
group:NT\040Authority\\authenticated\040users:r-x       #effective:r--
mask::r--
other::---

Here I'm just interested in exercising the samba-tool gpo motd
commands, which got a few fixes recently. This check passes in many
other architectures (arm64, armhf, ppcel64), just not s390x.



More information about the samba-technical mailing list