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

@@ -49,20 +49,6 @@ static void remove_usage_after_error(void)
fprintf(stdout, "\n");
}
static void remove_header_path(char *out, char *path, int max)
{
char *p;
tool_header_path(out, path, max);
/* Novell REMOVE displays server and volume as SERVER/SYS: while
* RIGHTS uses SERVER\SYS:. Keep the rest of the path with DOS
* backslashes. */
p = strchr(out, '\\');
if (p && strchr(out, ':') && p < strchr(out, ':'))
*p = '/';
}
static int remove_one(char *path, uint16 dhandle, uint32 object_id,
uint16 objtype, char *objname, int forced_is_file)
{
@@ -97,7 +83,7 @@ static int remove_one(char *path, uint16 dhandle, uint32 object_id,
{
char header[300];
remove_header_path(header, path, sizeof(header));
trustee_header_path(header, path, sizeof(header));
fprintf(stdout, "%s\n", header);
}