The Samba-Bugzilla – Bug 10038
Enhance 'net' command to exit with mapped error codes.
Last modified: 2014-04-24 19:44:47 UTC
In order to trap exact NT_STATUS error code of a 'net' command from inside a process, it is beneficial to make 'net' command exit with a mapping error code instead of just returning status.
Currently 'net' command emits detailed error code but this is done either to a debug log file or to the stdout depending on the configuration.
In order to get this specific NT_STATUS error code one has to parse the file or the stdout, looking for a specific string like "Failed to join.." etc.
This becomes clumsy or break in case the error string changed later.
It would be good if we make 'net' command exit with specific mapped error codes so that programs using 'net' can capture error condition in a better way in a SIGCHLD handler.