From 1df94ae08a5207c2778a2d0f089974cdf03b9933 Mon Sep 17 00:00:00 2001 From: OpenAI Date: Wed, 10 Jun 2026 20:07:58 +0000 Subject: [PATCH] rights: fix modify checks for DOS attribute updates --- src/connect.c | 2 +- src/nwattrib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connect.c b/src/connect.c index 59e408f..dec95b8 100644 --- a/src/connect.c +++ b/src/connect.c @@ -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) { diff --git a/src/nwattrib.c b/src/nwattrib.c index 0096e5b..b227864 100644 --- a/src/nwattrib.c +++ b/src/nwattrib.c @@ -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)) {