Files
mars-dosutils/test/creator/cix_collect_xattr.sh
Mario Fetka 4a952b4c4c dosutils: align Novell-compatible tests and stage NCOPY work
Update the DOS utilities and test suite with the current Novell comparison
state.

Validated/updated tool behavior:
- improve CREATOR output by showing Novell-style attribute and rights masks
- extend FLAGDIR handling with old NCP22 directory attribute read/write
  fallback paths
- expand NDIR Novell-style formatting, filtering, /SUB handling, date output,
  DI/RI attribute display and richer metadata collection
- adjust REVOKE output/grammar, recursive /SUBDIRECTORIES behavior and trustee
  update/delete paths to better match Novell tools
- adjust SLIST header/output behavior for logged-in and logged-out cases
- update README status to reflect the currently green/tested tools

Test-suite changes:
- add/refresh Novell comparison tests for CREATOR, NDIR, REVOKE and SLIST
- update NCOPY tests and collection scripts for the current investigation state
- refresh per-tool README files and top-level test documentation
- keep MAP documented as still separately open

NCOPY:
- add the current NCOPY implementation and experimental NCP74/server-side-copy
  scaffolding
- build ncopy.c so it stays compile-tested
- keep NCOPY disabled in the NET multicall dispatch for now because the
  server-side-copy/open-handle path is still unsafe and needs further analysis

Build:
- include ncopy.c in the DOS utility build
- drop the temporary MARS_DOSUTILS_VERSION define wiring from CMake
2026-05-29 07:40:04 +02:00

86 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
#
# cix_collect_xattr.sh
#
# Linux-side collector for the CIXSTA CREATOR/xattr test.
#
# Run as root after CIXSTA.BAT/PART2 and before CIXZIP.BAT:
# sudo ./cix_collect_xattr.sh
#
# The output names intentionally use DOS/ZIP-safe 8.3 names because the
# DOS-side ZIP step may truncate long names in F:\CIXCMP\LINUX.
#
set -eu
SYS=${SYS:-/var/mars_nwe/SYS}
TREE=${TREE:-$SYS/CIXTEST}
OUT=${OUT:-$SYS/CIXCMP/LINUX}
mkdir -p "$OUT"
INFO="$OUT/collecto.txt"
FILES="$OUT/files.txt"
STAT="$OUT/stat.txt"
XATTR_NAMES="$OUT/xattr_na.txt"
GETFATTR="$OUT/getfattr.txt"
XATTR_FOCUS="$OUT/xattr_fo.txt"
{
echo "CIX CREATOR xattr/stat collection"
echo "Created: $(date)"
echo "Tree: $TREE"
echo "Output: $OUT"
echo
} > "$INFO"
if ! command -v getfattr >/dev/null 2>&1; then
echo "ERROR: getfattr not installed. Install the attr package." | tee "$OUT/getfattr_missing.txt"
exit 1
fi
if [ ! -d "$TREE" ]; then
echo "ERROR: test tree not found: $TREE" | tee "$OUT/tree_missing.txt"
exit 1
fi
find "$TREE" -xdev -print | sort > "$FILES"
{
echo "path|uid|gid|mode|size|mtime|ctime|atime"
while IFS= read -r p; do
stat -c '%n|%u|%g|%a|%s|%y|%z|%x' "$p"
done < "$FILES"
} > "$STAT"
{
while IFS= read -r p; do
echo "### $p"
getfattr -m - --absolute-names "$p" 2>/dev/null || true
echo
done < "$FILES"
} > "$XATTR_NAMES"
{
while IFS= read -r p; do
echo "### $p"
getfattr -d -m - -e hex --absolute-names "$p" 2>/dev/null || true
echo
done < "$FILES"
} > "$GETFATTR"
grep -iE 'mars|nwe|netware|trust|owner|creator|modifier|archiv|fileinfo|dos|attr' \
"$GETFATTR" > "$XATTR_FOCUS" || true
chmod -R a+r "$OUT"
cat <<EOF2
Wrote:
$INFO
$FILES
$STAT
$XATTR_NAMES
$GETFATTR
$XATTR_FOCUS
EOF2