dosutils: factor shared helpers and update README
Move common DOS utility helper code into tools.c and expose it through net.h. This removes duplicated command-local helpers from GRANT, RIGHTS, FLAG, FLAGDIR and the trustee helper layer. The shared helpers cover case-insensitive argument comparison, help and option detection, /FILES and /SUBDIRS parsing, current network directory handle lookup, current volume prefix formatting, uppercase DOS path copying, basename/header-path handling, wildcard detection and simple path joining/splitting. Keep the command frontends smaller and less coupled so the current multicall utility can later be split into smaller grouped multicall binaries, such as trustee tools, login/session tools and file/flag tools. Update the DOS utilities README for the newer Client32 and trustee commands. Document RIGHTS, GRANT, REVOKE and REMOVE in the status, feature, command and install sections. Add command reference entries for the trustee tools, including Novell-style syntax, supported rights, recursive/file options and missing-trustee behavior. Also mention the shared trustee helper layer and common tools.c helpers used by the newer command frontends.
This commit is contained in:
124
README.md
124
README.md
@@ -5,20 +5,25 @@ DOS client-side utilities for **mars_nwe** and compatible NetWare-style NCP envi
|
||||
This repository contains the source for a small DOS utility suite built around a **single multi-call executable**, `net.exe`. The program can be used either as:
|
||||
|
||||
- `net <command> [args...]`, or
|
||||
- a renamed executable such as `login.exe`, `map.exe`, `flag.exe`, `flagdir.exe`, `capture.exe`, or `logout.exe`.
|
||||
- a renamed executable such as `login.exe`, `map.exe`, `flag.exe`, `flagdir.exe`, `rights.exe`, `grant.exe`, `revoke.exe`, `remove.exe`, `capture.exe`, or `logout.exe`.
|
||||
|
||||
The command dispatcher lives in `net.c`, and the install rules deploy the same binary under multiple command names in `SYS:PUBLIC` and selected names in `SYS:LOGIN`.
|
||||
|
||||
## Current status
|
||||
|
||||
The tree is a modernization of the historical mars_nwe DOS utilities. It still keeps the original Borland-era style and APIs where useful, but now also has an Open Watcom/CMake build path and working DOS Client32 support for the FLAG-family tools.
|
||||
The tree is a modernization of the historical mars_nwe DOS utilities. It still keeps the original Borland-era style and APIs where useful, but now also has an Open Watcom/CMake build path and working DOS Client32 support for the FLAG-family and trustee/right tools.
|
||||
|
||||
Validated recently:
|
||||
|
||||
- `FLAG` file attribute read/modify through DOS Client32
|
||||
- `FLAGDIR` directory attribute read/modify through DOS Client32
|
||||
- `RIGHTS` effective-rights display through Client32 NCP87
|
||||
- `GRANT` trustee assignment for users and groups
|
||||
- `REVOKE` trustee-right removal for users and groups
|
||||
- `REMOVE` trustee deletion for users and groups
|
||||
- Novell-tool comparison for `FLAG`, including `ALL`, `N`, `RO`, `RW`, high bits, and display layout
|
||||
- Novell-tool comparison for `FLAGDIR`, including `Normal`, `System`, `Hidden`, `DeleteInhibit`, `Purge`, `RenameInhibit`, and combined attributes
|
||||
- Novell-tool comparison for `RIGHTS`, `GRANT`, `REVOKE`, and `REMOVE`
|
||||
- CMake/Open Watcom build using binary-directory object files, so `.obj`/`.o` files are no longer written into the source tree
|
||||
|
||||
Still to validate or continue:
|
||||
@@ -26,7 +31,7 @@ Still to validate or continue:
|
||||
- DOSX/VLM/NETX fallback behavior for `FLAG` and `FLAGDIR`
|
||||
- More complex `FLAGDIR` paths beyond the simple mapped-directory cases already tested
|
||||
- OS/2 requester/tool behavior
|
||||
- Additional Novell-like utilities such as `RIGHTS`, `GRANT`, `REVOKE`, `NDIR`, `PURGE`, and `SALVAGE`
|
||||
- Additional Novell-like utilities such as `NDIR`, `PURGE`, and `SALVAGE`
|
||||
|
||||
## Features
|
||||
|
||||
@@ -41,6 +46,9 @@ Still to validate or continue:
|
||||
- File attribute management through `FLAG`
|
||||
- Directory attribute management through `FLAGDIR`
|
||||
- Effective rights display through `RIGHTS`
|
||||
- Trustee rights assignment through `GRANT`
|
||||
- Trustee rights removal through `REVOKE`
|
||||
- Trustee assignment deletion through `REMOVE`
|
||||
- Optional mars_nwe debug control hooks
|
||||
- Developer diagnostics through `TESTS`
|
||||
|
||||
@@ -65,6 +73,9 @@ The current command dispatcher includes these built-ins:
|
||||
- `FLAG`
|
||||
- `FLAGDIR`
|
||||
- `RIGHTS`
|
||||
- `GRANT`
|
||||
- `REVOKE`
|
||||
- `REMOVE`
|
||||
- `DEBUG`
|
||||
- `ECHO`
|
||||
- `CD`
|
||||
@@ -117,8 +128,11 @@ This path is currently used by:
|
||||
- `FLAG`
|
||||
- `FLAGDIR`
|
||||
- `RIGHTS`
|
||||
- `GRANT`
|
||||
- `REVOKE`
|
||||
- `REMOVE`
|
||||
|
||||
The old `Net_Call` / INT 21h requester path is kept as a fallback where appropriate, but Client32 is now preferred for the validated FLAG-family operations.
|
||||
The old `Net_Call` / INT 21h requester path is kept as a fallback where appropriate, but Client32 is now preferred for the validated FLAG-family and trustee operations.
|
||||
|
||||
## Command reference
|
||||
|
||||
@@ -377,10 +391,10 @@ Typical usage:
|
||||
RIGHTS [path]
|
||||
```
|
||||
|
||||
Supported in this first version:
|
||||
Supported:
|
||||
|
||||
- directory paths
|
||||
- file paths, using the parent directory rights for the first read-only implementation
|
||||
- file paths
|
||||
- Novell-like display of the effective rights mask
|
||||
|
||||
Rights are shown in the traditional order:
|
||||
@@ -390,6 +404,94 @@ S R W C E M F A
|
||||
Supervisor, Read, Write, Create, Erase, Modify, File scan, Access Control
|
||||
```
|
||||
|
||||
|
||||
### `GRANT`
|
||||
|
||||
Assign explicit trustee rights to a user or group.
|
||||
|
||||
Typical usage:
|
||||
|
||||
```text
|
||||
GRANT rightslist* [FOR path] TO [USER | GROUP] name [options]
|
||||
Options: /SubDirectories | /Files
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```text
|
||||
GRANT R W C FOR UDIR TO USER MARIO
|
||||
GRANT ALL FOR UDIR TO GROUP EVERYONE /SUBDIRECTORIES
|
||||
GRANT R F FOR UDIR\*.TST TO USER MARIO /FILES
|
||||
```
|
||||
|
||||
Supported 386-style rights:
|
||||
|
||||
- `ALL`
|
||||
- `N` / `NONE`
|
||||
- `S` / `SUPERVISOR`
|
||||
- `R` / `READ`
|
||||
- `W` / `WRITE`
|
||||
- `C` / `CREATE`
|
||||
- `E` / `ERASE`
|
||||
- `M` / `MODIFY`
|
||||
- `F` / `FILESCAN`
|
||||
- `A` / `ACCESS CONTROL`
|
||||
|
||||
For Novell compatibility, `ALL` grants the normal trustee rights (`RWCEMFA`) and does not imply Supervisor; use `S` explicitly when Supervisor rights are intended.
|
||||
|
||||
### `REVOKE`
|
||||
|
||||
Remove selected rights from an explicit trustee assignment.
|
||||
|
||||
Typical usage:
|
||||
|
||||
```text
|
||||
REVOKE rightslist* [FOR path] FROM [USER|GROUP] name [options]
|
||||
Options: /SubDirectories | /Files
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```text
|
||||
REVOKE W M FOR UDIR FROM USER MARIO
|
||||
REVOKE R W FOR UDIR\*.TST FROM GROUP EVERYONE /FILES
|
||||
REVOKE W C FOR UDIR FROM USER MARIO /SUBDIRECTORIES
|
||||
```
|
||||
|
||||
`REVOKE` scans the explicit trustee assignment first, subtracts the requested rights, and deletes the trustee entry when no rights remain. Missing trustee entries are reported in Novell style:
|
||||
|
||||
```text
|
||||
No trustee for the specified directory.
|
||||
No trustee for the specified file.
|
||||
```
|
||||
|
||||
### `REMOVE`
|
||||
|
||||
Delete an explicit trustee assignment for a user or group.
|
||||
|
||||
Typical usage:
|
||||
|
||||
```text
|
||||
REMOVE [USER | GROUP] name [FROM path] [option]
|
||||
Options: /Subdirs | /Files
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```text
|
||||
REMOVE USER MARIO FROM UDIR
|
||||
REMOVE GROUP EVERYONE FROM UDIR /SUBDIRS
|
||||
REMOVE USER MARIO FROM UDIR\*.TST /FILES
|
||||
```
|
||||
|
||||
If `USER` or `GROUP` is omitted, the tool tries to resolve the name as a user first and then as a group. Successful multi-object operations print Novell-style summaries such as:
|
||||
|
||||
```text
|
||||
Trustee "MARIO" removed from 4 directories.
|
||||
Trustee "MARIO" removed from 2 files.
|
||||
```
|
||||
|
||||
|
||||
### `DEBUG`
|
||||
|
||||
Set mars_nwe debug levels for selected server-side modules.
|
||||
@@ -504,6 +606,10 @@ The install rules deploy the same binary multiple times into `SYS/public`, inclu
|
||||
- `slist.exe`
|
||||
- `flag.exe`
|
||||
- `flagdir.exe`
|
||||
- `rights.exe`
|
||||
- `grant.exe`
|
||||
- `revoke.exe`
|
||||
- `remove.exe`
|
||||
- `capture.exe`
|
||||
- `endcap.exe`
|
||||
|
||||
@@ -514,7 +620,9 @@ They also install selected copies such as `login.exe`, `map.exe`, and `slist.exe
|
||||
- `kern_wasm.asm` is the 16-bit Open Watcom assembly implementation used by the modern build.
|
||||
- `kern.c` was an experimental C-side test wrapper and is no longer required by the current Client32 FLAG/FLAGDIR path.
|
||||
- `c32ncp.c` and `c32ncp.h` contain reusable Client32 NCP helper functions for DOS tools.
|
||||
- The verified Client32 path uses NCP 87 subfunction 6 for obtaining DOS information and subfunction 7 for modifying DOS information.
|
||||
- `trustee.c` and `trustee.h` contain shared code for `GRANT`, `REVOKE`, and `REMOVE`.
|
||||
- `tools.c` contains shared command/frontend helpers so future smaller multicall binaries can reuse common parsing and path code.
|
||||
- The verified Client32 path uses NCP 87 subfunction 6 for obtaining DOS information, subfunction 7 for modifying DOS information, subfunction 29 for effective rights, and trustee scan/add/delete calls for the trustee tools.
|
||||
- For modify operations, use the modify information mask `DM_ATTRIBUTES` (`0x00000002`) rather than the read-side `RIM_ATTRIBUTES` mask.
|
||||
- High NetWare attributes must be stored and displayed as 32-bit values even in 16-bit DOS builds.
|
||||
|
||||
@@ -523,7 +631,7 @@ They also install selected copies such as `login.exe`, `map.exe`, and `slist.exe
|
||||
This is legacy DOS networking code from the mid-1990s, and a few caveats are worth keeping in mind:
|
||||
|
||||
- The code is tightly coupled to DOS, IPX/NCP behavior, and mars_nwe/NetWare requester semantics.
|
||||
- Client32 support has been validated for the FLAG-family tools, but not yet generalized to every command.
|
||||
- Client32 support has been validated for the FLAG-family and trustee/right tools, but not yet generalized to every command.
|
||||
- DOSX/VLM/NETX fallback testing is still pending.
|
||||
- `FLAGDIR` currently focuses on the NetWare 386-style attributes and simple mapped directory paths.
|
||||
- OS/2 requester behavior is still future work.
|
||||
|
||||
Reference in New Issue
Block a user