trustee: share trustee header path formatting
Move the shared GRANT/REMOVE/REVOKE header path formatting into trustee.c. The Novell trustee tools display the server and volume separator as SERVER/SYS: while keeping the remaining path separators as DOS backslashes. Use one trustee_header_path() helper for that formatting instead of keeping separate local copies in GRANT, REMOVE and REVOKE. No behavior change.
This commit is contained in:
29
trustee.c
29
trustee.c
@@ -31,6 +31,35 @@
|
||||
#define S_IFDIR 0040000
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* trustee_header_path
|
||||
*
|
||||
* Purpose:
|
||||
* Formats the path header used by GRANT, REMOVE and REVOKE.
|
||||
*
|
||||
* Parameters:
|
||||
* out - destination buffer.
|
||||
* path - source path to format.
|
||||
* max - destination buffer size.
|
||||
*
|
||||
* Notes:
|
||||
* Novell trustee tools display the server and volume separator as
|
||||
* SERVER/SYS: while tools such as RIGHTS keep SERVER\SYS:. Keep all
|
||||
* remaining path separators as DOS backslashes.
|
||||
*/
|
||||
void trustee_header_path(char *out, char *path, int max)
|
||||
{
|
||||
char *p;
|
||||
char *colon;
|
||||
|
||||
tool_header_path(out, path, max);
|
||||
|
||||
p = strchr(out, '\\');
|
||||
colon = strchr(out, ':');
|
||||
if (p && colon && p < colon)
|
||||
*p = '/';
|
||||
}
|
||||
/*
|
||||
* trustee_parse_right_word
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user