9.3 KiB
mars_dosutils
DOS client-side utilities for mars_nwe and compatible NetWare-style NCP environments.
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,capture.exe, orlogout.exe
That design is explicit in the command table in net.c, and the install rules also deploy the same binary under multiple command names. The original project documentation describes it as a “simple DOS-client program to allow standard NCP network actions, mainly for mars_nwe,” and also notes that it was still incomplete at the time of writing. fileciteturn1file1L1-L6 fileciteturn1file2L18-L44 fileciteturn0file0
Features
- Login and logout against an NCP server
- Password change support
- DOS drive mapping and unmapping
- Search-path management (
PATH,PATHINS,PATHDEL) - Printer capture and release (
CAPTURE,ENDCAP) - Scripted session setup through command files
- External program execution via
SPAWNandEXEC - Optional mars_nwe debug control hooks
Available commands
The current command dispatcher includes these built-ins:
LOGINLOGOUTPASSWDPROFILESPAWNEXECMAPMAPDELPATHPATHINSPATHDELCAPTUREENDCAPDEBUGECHOCDTESTS(developer/testing only)
SLIST is present in the historical build/install metadata, but the command is disabled in the dispatcher and the provided slist.c is only a stub in this source snapshot. fileciteturn1file2L18-L44 fileciteturn1file0
How it works
The program resolves the command from either:
- the executable name itself, or
- the first command-line argument
That means all of the following styles are valid:
NET LOGIN alice secret
NET MAP F:=SYS:
LOGIN.EXE alice secret
MAP.EXE F:=SYS:
CAPTURE.EXE LPT1 Q1
This is one of the key design ideas of the project, and the original README specifically recommends copying or linking net.exe to login.exe for convenience. fileciteturn1file1L7-L16 fileciteturn1file2L46-L96
Command reference
LOGIN
Authenticate to an NCP server as a user.
LOGIN [-u] [user | user password]
-uforces the older unencrypted login path. fileciteturn1file1L9-L11- If no username is provided, the tool prompts interactively. fileciteturn1file2L101-L139
- If no password is provided, it prompts for one after the username. fileciteturn1file2L125-L138
- Successful login clears and rebuilds NetWare search-path state before running a local post-login script named
loginfrom the executable directory. fileciteturn1file2L116-L147
LOGOUT
Log out from the current NCP session.
The implementation also removes configured network search paths before performing logout. fileciteturn1file2L150-L159
PASSWD
Change a user password.
PASSWD [user]
Notes:
- If no username is supplied, the tool attempts to resolve the currently logged-in user. fileciteturn1file2L162-L190
- The source comments note that password changes currently use the older unencrypted password-change call. fileciteturn1file1L29-L33 fileciteturn1file2L12-L33
PROFILE
Execute a command script.
PROFILE <filename>
This is a central part of the workflow. The command reader parses non-empty lines, ignores # comments, uppercases the command token, and dispatches it through the same internal command table used for direct invocation. ECHO is treated specially so the rest of the line is preserved as a single string. fileciteturn1file1L21-L27 fileciteturn1file2L202-L323
SPAWN
Run an external program and wait for it to finish.
EXEC
Execute an external program using overlay-style execution.
Both commands share the same implementation and differ only in whether they use spawnvp(..., P_WAIT, ...) or execvp(...). fileciteturn1file1L54-L57 fileciteturn1file2L357-L390
MAP
List current drive mappings or map a DOS drive letter to a network path.
MAP [d:[=[path]]]
Examples:
MAP
MAP F:=SYS:
MAP H:=HOME:
The implementation lists active mappings, distinguishes local vs. redirected drives, and uses DOS-style drive letters. fileciteturn1file1L43-L49 fileciteturn1file2L1-L178
MAPDEL
Remove an existing drive mapping.
MAPDEL d:
Example:
MAPDEL F:
PATH
List or set a search-path entry.
PATH sn:[=[path]]
Where sn is s1 through s16. The original documentation notes that this updates the path environment rather than directly creating a drive mapping. fileciteturn1file1L34-L42 fileciteturn1file2L180-L288
PATHINS
Insert a search-path entry instead of overwriting one.
PATHINS sn:[=[path]]
PATHDEL
Delete a search-path entry.
PATHDEL sn:
CAPTURE
List printer captures or redirect a local printer device to a queue.
Typical usage:
CAPTURE [device [queue]]
Examples:
CAPTURE
CAPTURE LPT1 Q1
CAPTURE PRN Q1
PRN is normalized to LPT1 internally. The command can also display existing captures. fileciteturn1file2L1-L77
ENDCAP
Cancel a printer redirection.
Typical usage:
ENDCAP device
Example:
ENDCAP LPT1
DEBUG
Set mars_nwe debug levels for selected server-side modules.
DEBUG NCPSERV|NWCONN|NWBIND level
levelmust be between0and99. fileciteturn1file2L1-L31- The original docs say this requires
FUNC_17_02_IS_DEBUGto be enabled inmars_nwe/config.h. fileciteturn1file1L50-L53
ECHO
Print a string, mainly for use inside profile/login scripts. fileciteturn1file2L350-L355
CD
Change the current DOS directory. It also adjusts the active drive if a drive-qualified path is supplied. fileciteturn1file2L329-L348
TESTS
Internal developer test routines. Not intended as a regular end-user command. fileciteturn1file2L39-L43
Login script workflow
A particularly important feature is the automatic execution of a file named login located beside the executable after a successful login. The historical README gives this example:
map f:=SYS:
map h:=home:
map z:=SYS:PUBLIC
path s16:=z:.
capture lpt1 q1
profile h:\profile
This makes the tool suite useful not just for authentication, but for setting up a full DOS network session: drive mappings, search paths, printer capture, and then a user-specific profile script. fileciteturn1file1L12-L20 fileciteturn1file2L140-L147
Building
Historical DOS build
The included makefile.bcc is the primary historical build file and targets Borland C / Borland tools on DOS.
Key settings from the makefile:
- compiler:
bcc - linker:
bcc - assembler:
tasm - memory model:
-ml - define:
-Dmsdos - output:
net.exe
The object list includes:
net.ctools.cnetcall.cncpcall.clogin.cmap.cslist.cnwcrypt.cnwdebug.cnwtests.ccapture.ckern.asm
fileciteturn1file2L1-L18
CMake status
A CMakeLists.txt is present, but in this snapshot it is only a partial modern build description. It defines include paths, version-related macros, and install rules, while the actual add_executable(...) line is still commented out. That means it is better understood as packaging metadata than a ready-to-use complete build system. fileciteturn0file0
Installation layout
The CMake install rules deploy the same binary multiple times into SYS/public:
net.exelogin.exeprofile.exespawn.exepasswd.exepath.exepathins.exepathdel.exemap.exemapdel.exelogout.exeslist.execapture.exeendcap.exe
They also install minimal login.exe and map.exe copies into SYS/login. fileciteturn0file0
Project status and limitations
This is legacy DOS networking code from the mid-1990s, and a few caveats are worth keeping in mind:
- The original README explicitly says the program was still incomplete. fileciteturn1file1L6-L7
SLISTis not implemented in the provided source snapshot. fileciteturn1file2L36-L39 fileciteturn1file0- Parts of the authentication and password-change path still rely on older unencrypted operations when the newer keyed flow is unavailable or disabled. fileciteturn1file2L12-L33
- The code is tightly coupled to DOS, IPX/NCP behavior, and mars_nwe-specific expectations.
Historical metadata
From the included project metadata:
- project:
mars_dosutils - version:
0.10 - entered:
21-May-96 - keywords:
mars_nwe,dos,dosemu - platforms:
DOS,DOSEMU - author/maintainer: Martin Stover
fileciteturn1file2L1-L4
License
No standalone license file is included in the provided snapshot. The source files do contain copyright notices naming Martin Stover. Anyone planning to redistribute or modernize the project should verify licensing status before publishing derivative releases. fileciteturn1file2L1-L5