NCP22 uses bit 0x80 for Modify. MARS internally uses the same bit for
TRUSTEE_M, while Supervisor is represented internally as TRUSTEE_S at 0x100.
Only the Supervisor/Open bit needs translation.
The previous conversion mapped NCP22 0x80 incorrectly, causing GRANT M from
Novell tools to be stored without TRUSTEE_M internally. As a result, users with
directory Modify rights could not rename files even though NDIR/RIGHTS displayed
the rights as expected.
Align rename permission checks with NetWare trustee semantics. A same-directory
rename should be controlled by the Modify right instead of requiring a broader
R/W/M combination. For moves to another parent directory, require Create rights
on the destination parent.
Also invalidate the trustee rights cache after adding or deleting trustee
assignments so newly granted rights are visible immediately to subsequent
operations.
This fixes the MARIO trustee test where rename failed with R/W/M/F and even
R/W/C/E/M/F, while the same operation succeeded only with the broader all-rights
set.
Handle failures from seteuid(0) in su_quotactl() before calling
quotactl(). This fixes the warn_unused_result compiler warning and
returns an error to the quota caller if privilege elevation fails.
Keep the existing MARS debug logging switch separate from compiler
debug flags. ENABLE_DEBUG still controls the legacy DO_DEBUG/XDPRINTF
code paths, while the new ENABLE_DEBUG_BUILD option enables a real
debug build with -g3, -O0 and -fno-omit-frame-pointer.
When ENABLE_DEBUG_BUILD is set on single-config generators, CMake also
forces CMAKE_BUILD_TYPE=Debug so gdb/valgrind builds can be enabled
without manually passing compiler flags.
Add a FindQuota.cmake module that checks for the Linux quota headers and
symbols required by the MARS NWE quota backend. Prefer modern
<sys/quota.h> with quotactl(), and keep <linux/quota.h> as fallback for
older systems.
Enable quota support by default, but only compile it in when the required
headers and quota symbols are available. Also move the QTAINSYS define to
the detected sys/quota.h path so modern Linux builds use the correct
header automatically.
SYSCON reads volume/disk restrictions before opening the edit dialog.
For volumes that do not map to a quota-capable block device, such as
HOME on /home, the old code returned an error during the read path.
This made SYSCON abort with error -30312 before the user could even see
the restriction state.
Treat read requests on volumes without a quota backend as unrestricted:
return success with an unlimited quota and zero usage. Removing a
restriction on such a volume is also treated as a successful no-op.
Setting a non-zero restriction still fails, so admin tools do not report
a quota as enforced when no Linux quota backend exists.