dosutils: add maintainer helpers and compare-ready tools

Add maintainer-only support used by the automated DOS compatibility
tests.

This introduces the MAINTAINER_BUILD option for the DOS tools. In
maintainer builds, LOGIN accepts the hidden /PWD: and /PASSWORD:
arguments for automated test relogin, and the DLYSTRT helper is built to
delay-start DOS batch files after the invoking batch has returned to the
prompt.

Add the WHOAMI utility and wire it into the NET command dispatch. Also
adjust SLIST and RIGHTS output to match Novell behavior more closely,
including server-not-found handling, path formatting, Supervisor rights,
missing-path errors and usage text.

Extend the test scripts to compare NPUBLIC Novell baselines against the
PUBLIC implementations. LOGIN/LOGOUT can now run automatically via
DLYSTRT and the maintainer LOGIN password option. RIGHTS gains an
additional NOPASSUSER effective-rights matrix that covers single rights,
mixed rights, Supervisor rights, ALL/N and file trustee cases.

Normal builds remain free of maintainer-only helpers and hidden password
handling.
This commit is contained in:
Mario Fetka
2026-05-27 20:14:01 +02:00
parent f214e89d69
commit 4ad455c6df
21 changed files with 1704 additions and 322 deletions

45
tools.c
View File

@@ -452,9 +452,6 @@ int tool_current_prefix(char *out, int max)
int drive;
char server[52];
char dpath[260];
char volume[32];
char *p;
int i = 0;
if (!out || max < 8)
return(-1);
@@ -476,23 +473,12 @@ int tool_current_prefix(char *out, int max)
if (get_dir_path(dhandle, dpath) || !dpath[0])
return(-1);
p = strchr(dpath, ':');
if (!p)
return(-1);
while (dpath + i < p && i < (int)sizeof(volume) - 1) {
volume[i] = dpath[i];
i++;
}
volume[i] = '\0';
if (!volume[0])
return(-1);
tool_upcopy(dpath, dpath, sizeof(dpath));
if (server[0])
sprintf(out, "%s/%s:", server, volume);
sprintf(out, "%s\\%s", server, dpath);
else
sprintf(out, "%s:", volume);
sprintf(out, "%s", dpath);
return(0);
}
@@ -538,8 +524,10 @@ void tool_basename(char *dst, char *src, int max)
void tool_header_path(char *out, char *path, int max)
{
char prefix[90];
char prefix[260];
char up[260];
char *p;
int len;
if (tool_current_prefix(prefix, sizeof(prefix)))
prefix[0] = '\0';
@@ -550,9 +538,26 @@ void tool_header_path(char *out, char *path, int max)
}
tool_upcopy(up, path, sizeof(up));
/* Convert DOS drive-qualified paths like F:\DIR to a NetWare path
* relative to the mapped volume, matching Novell's display. */
p = up;
if (p[0] && p[1] == ':') {
p += 2;
if (*p == '\\') p++;
}
while (*p == '\\') p++;
strmaxcpy(out, prefix, max - 1);
if ((int)(strlen(out) + strlen(up)) < max - 1)
strcat(out, up);
len = strlen(out);
if (*p && len > 0 && out[len - 1] != ':' && out[len - 1] != '\\') {
if (len < max - 1) {
out[len++] = '\\';
out[len] = '\0';
}
}
if ((int)(strlen(out) + strlen(p)) < max - 1)
strcat(out, p);
}
int tool_is_dot_dir(char *name)