grant/revoke Request-Layout
All checks were successful
Source release / source-package (push) Successful in 46s

This commit is contained in:
Mario Fetka
2026-05-25 14:11:06 +02:00
parent 1460e8a7ac
commit 0bc4a4b9c5
3 changed files with 21 additions and 15 deletions

View File

@@ -2900,23 +2900,25 @@ int nw_set_dir_info(int dir_handle, uint8 *data, int len,
int nw_modify_max_right_mask(int dir_handle, uint8 *data, int len,
int max_rights)
int grant_mask, int revoke_mask)
{
char unname[256];
struct stat stbuff;
NW_PATH nwpath;
int old_mask;
int new_mask;
int result = conn_get_kpl_path(&nwpath, &stbuff, dir_handle, data, len, 0);
if (result < 0) return(result);
xstrcpy(unname, build_unix_name(&nwpath, 0));
if (s_stat(unname, &stbuff, NULL) || !S_ISDIR(stbuff.st_mode)) {
result = -0x9c;
} else {
result = tru_set_inherited_mask(nwpath.volume, unname,
&stbuff, max_rights);
}
return(result);
if (s_stat(unname, &stbuff, NULL) || !S_ISDIR(stbuff.st_mode))
return(-0x9c);
old_mask = tru_get_inherited_mask(nwpath.volume, unname, &stbuff);
new_mask = (old_mask | (grant_mask & 0xff)) & (~revoke_mask & 0xff);
return tru_set_inherited_mask(nwpath.volume, unname, &stbuff, new_mask);
}
int nw_scan_user_trustee(int volume, int *sequence, uint32 id,

View File

@@ -611,19 +611,23 @@ static int handle_ncp_serv(void)
case 0x4 : { /* Modify Max Right Mask */
/******** MODIFY MAX RIGHT MASK ****************/
/*
* Request:
* Request (NetWare 2.x compatible NCP 22/4):
* byte directory handle
* byte maximum/inherited rights mask
* byte grant rights mask
* byte revoke rights mask
* byte path length
* byte path[path length]
* path bytes
*
* New mask is: (old_mask | grant_mask) & ~revoke_mask.
*
* No reply data.
*/
int result = nw_modify_max_right_mask(
(int)*(p+1),
p+4,
(int)*(p+3),
(int)*(p+2));
p+5,
(int)*(p+4),
(int)*(p+2),
(int)*(p+3));
if (result) completition = (uint8)-result;
}
break;