rights: restore trustee check semantics
All checks were successful
Source release / source-package (push) Successful in 1m18s

This commit is contained in:
OpenAI
2026-06-10 20:29:07 +00:00
committed by Mario Fetka
parent fbc346b4ad
commit d1ea93a209
3 changed files with 5 additions and 5 deletions

View File

@@ -1896,7 +1896,7 @@ static int do_set_file_info(NW_PATH *nwpath, FUNC_SEARCH *fs)
if (!stat(unname, &statb)) {
if (S_ISFIFO(statb.st_mode) || (voloptions&VOL_OPTION_IS_PIPE))
return(0); /* do nothing but report OK */
if (!tru_eff_rights_exists(nwpath->volume, unname, &statb, TRUSTEE_M))
if (tru_eff_rights_exists(nwpath->volume, unname, &statb, TRUSTEE_M))
result=-0x8c; /* no modify rights */
} else result=-0xff;
if (!result) {

View File

@@ -2643,7 +2643,7 @@ static int nw_modify_file_dir(int namespace,
xfree(uname);
return(0); /* do nothing but report OK */
}
if (!tru_eff_rights_exists(dbe->nwpath.volume, uname, stb,
if (tru_eff_rights_exists(dbe->nwpath.volume, uname, stb,
TRUSTEE_M))
result=-0x8c; /* no modify rights */
if (!result && (infomask & DOS_MSK_ATTRIBUTE)){
@@ -2651,7 +2651,7 @@ static int nw_modify_file_dir(int namespace,
GET_32(dmi->attributes));
}
if ( (!result) && (infomask & DOS_MSK_INHERIT_RIGHTS)
&& tru_eff_rights_exists(dbe->nwpath.volume, uname, stb, TRUSTEE_A) ) {
&& !tru_eff_rights_exists(dbe->nwpath.volume, uname, stb, TRUSTEE_A) ) {
int mask = tru_get_inherited_mask(dbe->nwpath.volume, uname, stb);
int grantmask = GET_16(dmi->rightsgrantmask);
int revokemask = GET_16(dmi->rightsrevokemask);
@@ -2663,7 +2663,7 @@ static int nw_modify_file_dir(int namespace,
}
if ((!result) && (infomask & DOS_MSK_MAX_SPACE)) {
if (S_ISDIR(stb->st_mode)) {
if (!tru_eff_rights_exists(dbe->nwpath.volume, uname, stb, TRUSTEE_M))
if (tru_eff_rights_exists(dbe->nwpath.volume, uname, stb, TRUSTEE_M))
result=-0x8c;
else
result=nsp_set_dir_quota_metadata((const char*)uname,

View File

@@ -221,7 +221,7 @@ static int set_nw_attrib(
int voloptions=get_volume_options(volume);
if (voloptions & VOL_OPTION_IS_PIPE)
return(0); /* we return with no error */
if (!tru_eff_rights_exists(volume, unixname, stb, TRUSTEE_M))
if (tru_eff_rights_exists(volume, unixname, stb, TRUSTEE_M))
return(-0x8c); /* no modify rights */
if (!(voloptions & VOL_OPTION_ATTRIBUTES)) {
if (!(get_unix_eff_rights(stb) & W_OK)) {