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:
Mario Fetka
2026-05-29 12:33:32 +02:00
parent f3e77819d8
commit 34ec41e760
5 changed files with 36 additions and 47 deletions

View File

@@ -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
*