NCP22/4 Modify Maximum/Inherit Rights Mask
All checks were successful
Source release / source-package (push) Successful in 44s

This commit is contained in:
Mario Fetka
2026-05-25 13:12:19 +02:00
parent d5b07b4ea0
commit 2c21eb77fd
3 changed files with 40 additions and 3 deletions

View File

@@ -269,6 +269,9 @@ extern int nw_set_dir_info(int dir_handle, uint8 *data, int len,
uint32 owner_id, int max_rights,
uint8 *creationdate, uint8 *creationtime);
extern int nw_modify_max_right_mask(int dir_handle, uint8 *data, int len,
int max_rights);
extern int nw_scan_user_trustee(int volume, int *sequence, uint32 id,
int *access_mask, uint8 *path);

View File

@@ -2898,6 +2898,27 @@ int nw_set_dir_info(int dir_handle, uint8 *data, int len,
return(result);
}
int nw_modify_max_right_mask(int dir_handle, uint8 *data, int len,
int max_rights)
{
char unname[256];
struct stat stbuff;
NW_PATH nwpath;
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);
}
int nw_scan_user_trustee(int volume, int *sequence, uint32 id,
int *access_mask, uint8 *path)
{

View File

@@ -608,10 +608,23 @@ static int handle_ncp_serv(void)
}
break;
case 0x4 : { /* Modify Max Right MAsk */
case 0x4 : { /* Modify Max Right Mask */
/******** MODIFY MAX RIGHT MASK ****************/
/* NO REPLY !! */
completition = 0xfb; /* TODO */
/*
* Request:
* byte directory handle
* byte maximum/inherited rights mask
* byte path length
* byte path[path length]
*
* No reply data.
*/
int result = nw_modify_max_right_mask(
(int)*(p+1),
p+4,
(int)*(p+3),
(int)*(p+2));
if (result) completition = (uint8)-result;
}
break;