NCP87/29 rights-only Patch
All checks were successful
Source release / source-package (push) Successful in 44s

This commit is contained in:
Mario Fetka
2026-05-25 12:57:50 +02:00
parent f03aa0482b
commit d5b07b4ea0

View File

@@ -1209,12 +1209,25 @@ static int nsp_get_eff_rights(int namespace, NW_HPATH *nwp,
if (result > -1) {
DIR_BASE_ENTRY *dbe=dir_base[result];
char *unixname = alloc_nwpath2unix(&(dbe->nwpath), 2);
int rights;
(void)destnamspace;
(void)searchattrib;
(void)infomask;
/*
* NCP 87/29 (Get Effective Directory Rights) returns only a
* 16-bit effective-rights mask. The old code appended
* build_dir_info() data after the mask, which makes strict clients
* reject the reply even though the rights word itself was already
* computed. Keep this handler rights-only, like NCP 22/42 and
* NCP 22/50.
*/
nwp_stat(&(dbe->nwpath), "nsp_get_eff_rights");
U16_TO_16(tru_get_eff_rights(dbe->nwpath.volume, unixname,
&(dbe->nwpath.statb)), responsedata);
responsedata+=2;
result = build_dir_info(dbe, unixname, destnamspace, infomask, responsedata);
if (result>-1) result+=2;
rights = tru_get_eff_rights(dbe->nwpath.volume, unixname,
&(dbe->nwpath.statb));
U16_TO_16(rights, responsedata);
result = 2;
xfree(unixname);
}
if (result <0 ) {