dosutils: align Novell-compatible tests and stage NCOPY work
Update the DOS utilities and test suite with the current Novell comparison state. Validated/updated tool behavior: - improve CREATOR output by showing Novell-style attribute and rights masks - extend FLAGDIR handling with old NCP22 directory attribute read/write fallback paths - expand NDIR Novell-style formatting, filtering, /SUB handling, date output, DI/RI attribute display and richer metadata collection - adjust REVOKE output/grammar, recursive /SUBDIRECTORIES behavior and trustee update/delete paths to better match Novell tools - adjust SLIST header/output behavior for logged-in and logged-out cases - update README status to reflect the currently green/tested tools Test-suite changes: - add/refresh Novell comparison tests for CREATOR, NDIR, REVOKE and SLIST - update NCOPY tests and collection scripts for the current investigation state - refresh per-tool README files and top-level test documentation - keep MAP documented as still separately open NCOPY: - add the current NCOPY implementation and experimental NCP74/server-side-copy scaffolding - build ncopy.c so it stays compile-tested - keep NCOPY disabled in the NET multicall dispatch for now because the server-side-copy/open-handle path is still unsafe and needs further analysis Build: - include ncopy.c in the DOS utility build - drop the temporary MARS_DOSUTILS_VERSION define wiring from CMake
This commit is contained in:
78
creator.c
78
creator.c
@@ -21,6 +21,34 @@
|
||||
#define BINDERY_USER 0x0001
|
||||
#define BINDERY_GROUP 0x0002
|
||||
|
||||
#ifndef _A_RDONLY
|
||||
#define _A_RDONLY 0x01
|
||||
#endif
|
||||
#ifndef _A_HIDDEN
|
||||
#define _A_HIDDEN 0x02
|
||||
#endif
|
||||
#ifndef _A_SYSTEM
|
||||
#define _A_SYSTEM 0x04
|
||||
#endif
|
||||
#ifndef _A_SUBDIR
|
||||
#define _A_SUBDIR 0x10
|
||||
#endif
|
||||
#ifndef _A_ARCH
|
||||
#define _A_ARCH 0x20
|
||||
#endif
|
||||
|
||||
#define CREATOR_ATTR_RENAME_INHIBIT 0x00020000UL
|
||||
#define CREATOR_ATTR_DELETE_INHIBIT 0x00040000UL
|
||||
|
||||
#define CREATOR_RIGHT_S 0x01
|
||||
#define CREATOR_RIGHT_R 0x02
|
||||
#define CREATOR_RIGHT_W 0x04
|
||||
#define CREATOR_RIGHT_C 0x08
|
||||
#define CREATOR_RIGHT_E 0x10
|
||||
#define CREATOR_RIGHT_M 0x20
|
||||
#define CREATOR_RIGHT_F 0x40
|
||||
#define CREATOR_RIGHT_A 0x80
|
||||
|
||||
static void creator_usage(void)
|
||||
{
|
||||
fprintf(stdout, "Usage:\n");
|
||||
@@ -366,10 +394,53 @@ static int set_info(uint8 dhandle, char *name, uint32 bits,
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static void creator_attr_string(uint32 attr, char *out)
|
||||
{
|
||||
out[0] = '[';
|
||||
out[1] = 'R';
|
||||
out[2] = (attr & _A_RDONLY) ? 'o' : 'w';
|
||||
out[3] = '-';
|
||||
out[4] = (attr & _A_ARCH) ? 'A' : '-';
|
||||
out[5] = '-';
|
||||
out[6] = (attr & _A_HIDDEN) ? 'H' : '-';
|
||||
if (attr & _A_SYSTEM) {
|
||||
out[7] = 'S';
|
||||
out[8] = 'y';
|
||||
} else {
|
||||
out[7] = '-';
|
||||
out[8] = '-';
|
||||
}
|
||||
memset(out + 9, '-', 8);
|
||||
out[17] = (attr & CREATOR_ATTR_DELETE_INHIBIT) ? 'D' : '-';
|
||||
out[18] = (attr & CREATOR_ATTR_RENAME_INHIBIT) ? 'R' : '-';
|
||||
out[19] = ']';
|
||||
out[20] = '\0';
|
||||
}
|
||||
|
||||
static void creator_rights_string(uint16 rights, char *out)
|
||||
{
|
||||
uint8 old = (uint8)rights;
|
||||
|
||||
out[0] = '[';
|
||||
out[1] = (old & CREATOR_RIGHT_S) ? 'S' : '-';
|
||||
out[2] = (old & CREATOR_RIGHT_R) ? 'R' : '-';
|
||||
out[3] = (old & CREATOR_RIGHT_W) ? 'W' : '-';
|
||||
out[4] = (old & CREATOR_RIGHT_C) ? 'C' : '-';
|
||||
out[5] = (old & CREATOR_RIGHT_E) ? 'E' : '-';
|
||||
out[6] = (old & CREATOR_RIGHT_M) ? 'M' : '-';
|
||||
out[7] = (old & CREATOR_RIGHT_F) ? 'F' : '-';
|
||||
out[8] = (old & CREATOR_RIGHT_A) ? 'A' : '-';
|
||||
out[9] = ']';
|
||||
out[10] = '\0';
|
||||
}
|
||||
|
||||
static int show_info(char *name, uint8 dhandle)
|
||||
{
|
||||
C32_NDIR_INFO info;
|
||||
int rc;
|
||||
char attr_text[24];
|
||||
char rights_text[12];
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(name) ? "" : name,
|
||||
@@ -381,8 +452,11 @@ static int show_info(char *name, uint8 dhandle)
|
||||
return(rc);
|
||||
}
|
||||
|
||||
creator_attr_string(info.attributes, attr_text);
|
||||
creator_rights_string(info.inherited_rights, rights_text);
|
||||
|
||||
fprintf(stdout, "File: %s\n", name);
|
||||
fprintf(stdout, "Attributes: 0x%08lX\n", (unsigned long)info.attributes);
|
||||
fprintf(stdout, "Attributes: %s (0x%08lX)\n", attr_text, (unsigned long)info.attributes);
|
||||
fprintf(stdout, "Create: "); print_dos_date(info.creation_date);
|
||||
fprintf(stdout, " "); print_dos_time(info.creation_time);
|
||||
fprintf(stdout, " creator=0x%08lX\n", (unsigned long)info.creator_id);
|
||||
@@ -393,7 +467,7 @@ static int show_info(char *name, uint8 dhandle)
|
||||
fprintf(stdout, " "); print_dos_time(info.archive_time);
|
||||
fprintf(stdout, " archiver=0x%08lX\n", (unsigned long)info.archiver_id);
|
||||
fprintf(stdout, "Access date: "); print_dos_date(info.last_access_date);
|
||||
fprintf(stdout, "\nRights mask: 0x%04X\n", (unsigned)info.inherited_rights);
|
||||
fprintf(stdout, "\nRights mask: %s (0x%04X)\n", rights_text, (unsigned)info.inherited_rights);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user