Rename parent rights fix incremental Debug
All checks were successful
Source release / source-package (push) Successful in 37s
All checks were successful
Source release / source-package (push) Successful in 37s
This commit is contained in:
@@ -2414,18 +2414,33 @@ static int nw_rename_file_dir(int namespace,
|
||||
if (slash && slash > src_parent)
|
||||
*slash = '\0';
|
||||
|
||||
missing_m = tru_eff_rights_exists(dbe_s->nwpath.volume, unname_s,
|
||||
&dbe_s->nwpath.statb, TRUSTEE_M);
|
||||
if (missing_m && slash && !stat(src_parent, &src_parent_stb))
|
||||
missing_m = tru_eff_rights_exists(dbe_s->nwpath.volume,
|
||||
(uint8*)src_parent, &src_parent_stb, TRUSTEE_M);
|
||||
/* We can arrive here immediately after a GRANT from another client.
|
||||
* Avoid using stale effective-rights nodes for the rename decision.
|
||||
*/
|
||||
tru_free_cache(dbe_s->nwpath.volume);
|
||||
|
||||
if (missing_m) {
|
||||
XDPRINTF((5, 0,
|
||||
"Rename denied: missing M on source `%s` or parent `%s`",
|
||||
unname_s, slash ? src_parent : (char*)""));
|
||||
result=-0x8b;
|
||||
} else if (slash && strcmp(src_parent, (char*)unname_dp) &&
|
||||
{
|
||||
int rights_s = tru_get_eff_rights(dbe_s->nwpath.volume, unname_s,
|
||||
&dbe_s->nwpath.statb);
|
||||
int rights_p = 0;
|
||||
int have_parent = (slash && !stat(src_parent, &src_parent_stb));
|
||||
|
||||
if (have_parent)
|
||||
rights_p = tru_get_eff_rights(dbe_s->nwpath.volume,
|
||||
(uint8*)src_parent, &src_parent_stb);
|
||||
|
||||
missing_m = !((rights_s & (TRUSTEE_S|TRUSTEE_M)) ||
|
||||
(rights_p & (TRUSTEE_S|TRUSTEE_M)));
|
||||
|
||||
if (missing_m) {
|
||||
XDPRINTF((5, 0,
|
||||
"Rename denied: missing M on source `%s` rights=0x%04x or parent `%s` rights=0x%04x",
|
||||
unname_s, rights_s, slash ? src_parent : (char*)"", rights_p));
|
||||
result=-0x8b;
|
||||
}
|
||||
}
|
||||
|
||||
if (result > -1 && slash && strcmp(src_parent, (char*)unname_dp) &&
|
||||
tru_eff_rights_exists(dbe_d->nwpath.volume, unname_dp,
|
||||
&dbe_d->nwpath.statb, TRUSTEE_C)) {
|
||||
/* Only require destination Create rights when this is a move to a
|
||||
|
||||
Reference in New Issue
Block a user