Univention Bugzilla – Bug 34642
umc-command returns ill-defined exit status
Last modified: 2021-05-25 16:02:06 CEST
Created attachment 5886 [details] fail.log The univention-management-console-client (aka umc_command) doesn't return exit codes properly. In case a UMC Module e.g. raises a UMC_CommandError, the UMC client recieves a RESULT status of 400 and then exits with sys.exit(0). During tests for Bug 34097 I discovered that a Windows-Client can be joined into an UCS@school Samba4 DC Slave even though the umc command selectiveudm/create_windows_computer failed in my case. This is because the Samba4 LDB module univention_samaccountname_ldap_check relies on the exit status.
Created attachment 5887 [details] fix_umc_command_returncode.patch This problem seems to be caused by umc_command effectively returning rc = (response.status - 200) if rc == 200: sys.exit(0) else: sys.exit(rc) Apart from the singularity for response.status = 400 this also could cause problems for cases where ((rc % 256) == 0). Currently UMC doesn't seem to use a status code of 456 though.
This is the commit that introduced the returncode mapping: -------------------------------------------------------------------------------- r30100 | <id> | 2011-12-28 15:11:43 +0100 (Mi, 28. Dez 2011) | 1 Zeile increase stability of UMC server when receiving invalid messages and sockets are closed by the client unexpectedly; Bug #25231, Bug #25237 ; umc-client: add option to close connection directyl after sending request, support different MIME types, set exit code to UMCP response status - 200 --------------------------------------------------------------------------------
Just faced this yesterday again: UMC status: 590 umc-command return status: 134 = (590-200)%256
6a03eec589 | Fix exit status of univention-management-console-client
OK: exit code fixed OK: changelog entry
UCS 5.0 has been released: https://docs.software-univention.de/release-notes-5.0-0-en.html https://docs.software-univention.de/release-notes-5.0-0-de.html If this error occurs again, please use "Clone This Bug".