From bb6c34dce4d9889ba3ea79a2f00e811523423a47 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Fri, 22 May 2026 19:06:30 +0200 Subject: [PATCH] pathins fix --- map.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/map.c b/map.c index 0fed3b1..5138082 100644 --- a/map.c +++ b/map.c @@ -437,15 +437,17 @@ static int set_search_native(uint8 *drvstr, NWPATH *nwp, int pathmode) strmaxcpy(p->dospath, nwp->path+2, sizeof(p->dospath)-1); result = set_search_drive_vektor(drives); } else { - int dhandle = alloc_permanent_dir_handle(0, nwp->path, 0, NULL); - if (dhandle >= 0) { - p->flags = 1; - p->drivenummer = 0xfe; - *(p->dospath) = '\0'; - p->connid = 1; - p->dhandle = (uint8)dhandle; - result = set_search_drive_vektor(drives); - } + /* + * Search path entries are not drive mappings. The original code stores + * the NetWare path text directly in dospath with drivenummer=0xfe. + * Client32 keeps/prints these entries correctly; allocating a permanent + * directory handle here made set_search_drive_vektor() return success, + * but the entry did not actually replace SEARCH1. + */ + p->flags = 0; + p->drivenummer = 0xfe; + strmaxcpy(p->dospath, nwp->path, sizeof(p->dospath)-1); + result = set_search_drive_vektor(drives); } } @@ -458,29 +460,23 @@ int func_path(int argc, char *argv[], int mode) uint8 drvstr[22]; NWPATH nwpath; int rc; - int i; - - fprintf(stderr, "PATHDBG mode=%d argc=%d", mode, argc); - for (i = 0; i < argc; i++) - fprintf(stderr, " argv[%d]='%s'", i, argv[i]); - fprintf(stderr, "\n"); + /* + * PATH/PATHINS/PATHDEL need their own parser. The old parse_argv() + * rejects common login-script syntax such as: + * PATHINS S1:=SYS:PUBLIC + * MAP INS S1:=SYS:PUBLIC + */ if (argc < 2) { show_search(""); return(0); } rc = parse_pathins_arg(drvstr, &nwpath, argc, argv, mode); - fprintf(stderr, "PATHDBG parse rc=%d drv0=%u drv1=%u path='%s'\n", - rc, drvstr[0], drvstr[1], rc ? "" : nwpath.path); - if (!rc) { int result=0; if (*(nwpath.path) || mode==1) result=set_search_native(drvstr, &nwpath, mode); - - fprintf(stderr, "PATHDBG set result=%d\n", result); - if (mode != 1) show_search(drvstr); return(result);