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:
16
remove.c
16
remove.c
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user