Replace unsafe Win32 calls and raw bitmasks with safe Rust standard library
APIs across Windows implementations:
- mv: use OpenOptionsExt access_mode for delete check
- sync: use File::sync_all instead of FlushFileBuffers
- hostname: remove redundant manual Winsock initialization
- touch: use io::Error::last_os_error instead of GetLastError
- rm: use Metadata::permissions().readonly() and FileTypeExt::is_symlink_dir()
Replace the onig C-dependency in expr with the pure-Rust fancy-regex crate.
This removes the onig_sys C library dependency while preserving full POSIX BRE,
backreference, multibyte UTF-8, and C locale compatibility.
Fixes required to build uutils/coreutils on HarmonyOS (aarch64-unknown-linux-ohos):
- uucore/fsext: statfs.f_type is u64 on OHOS; route it through the musl branch.
- hostid: implement gethostid locally (read /etc/hostid, else hash hostname)
because the OHOS SDK libc dropped the symbol.
- date: pass through the system time zone ID from OH_TimeService_GetTimeZone
and resolve it with embedded IANA tzdata (jiff-tzdb) via TimeZone::tzif,
instead of relying on /etc/localtime or a POSIX-injected TZ. The OHOS-only
helper is cfg-gated; non-OHOS code paths are byte-identical to upstream.
utmpx is intentionally left untouched: upstream #14252 disables it on OHOS
(no utmp data source there), and this PR defers to that approach.
Also syncs fuzz/Cargo.lock after adding the jiff-tzdb dependency.
Verified on-device: date matches system time (+0800 CST; 1987-06-01 -> +0900 CDT),
hostid behaves, builds pass on the non-utmpx feature set.
Reuse uucore::safe_traversal, the same traversal chown and chgrp already
use, in place of fts(3). Directories are still labelled post-order, so a
context that forbids reading one is applied only once its contents are
done.
Cycles are now caught with a set of the directories open on the current
path rather than FTS_DC, and the stale-stat retry goes away: entries are
stat'ed when they are visited rather than when the walk is opened.
chcon was the only fts-sys user in the workspace, so the dependency goes
with it.