Bug 10038 - Enhance 'net' command to exit with mapped error codes.
Enhance 'net' command to exit with mapped error codes.
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools
All All
: P5 enhancement
: ---
Assigned To: Andrew Bartlett
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2013-07-19 12:29 UTC by ravindra
Modified: 2014-04-24 19:44 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description ravindra 2013-07-19 12:29:42 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.