fix: macOS and Windows test/lint failures; repo.dixon.cx packaging for nexusterminal
CI hadn't run on macOS or Windows for a while (billing); once it did: - Windows: the RDP shared-drive code and its symlink test are Unix-only but were compiled there (and the unused pieces failed clippy). The drive type, its impls, imports and test are now cfg(unix); refusing a drive request is a free function used everywhere. Other Windows-only warnings fixed (serial test import, unused mut, harden_process). - macOS: the local shell's directory was sampled on the first output after Enter, which is the shell echoing the command before a cd runs, so restored tabs opened one directory behind. It's now sampled shortly after Enter and again once the command has had time to finish. - packaging/repo.sh publishes the 'nexusterminal' .deb/.rpm/Arch packages to repo.dixon.cx from the release's own Linux binaries, verified against SHA256SUMS. - The desktop entry mentions RDP.
This commit is contained in:
@@ -175,15 +175,14 @@ fn init_logging(data_dir: &std::path::Path) {
|
||||
/// files, and on Linux the process is non-dumpable (also blocks ptrace attach by other processes
|
||||
/// of the same user). Debug builds skip this so they can still be debugged.
|
||||
fn harden_process() {
|
||||
if cfg!(debug_assertions) {
|
||||
return;
|
||||
}
|
||||
#[cfg(unix)]
|
||||
// SAFETY: plain syscalls on this process with valid arguments; failure is harmless.
|
||||
unsafe {
|
||||
let none = libc::rlimit { rlim_cur: 0, rlim_max: 0 };
|
||||
libc::setrlimit(libc::RLIMIT_CORE, &none);
|
||||
#[cfg(target_os = "linux")]
|
||||
libc::prctl(libc::PR_SET_DUMPABLE, 0, 0, 0, 0);
|
||||
if !cfg!(debug_assertions) {
|
||||
// SAFETY: plain syscalls on this process with valid arguments; failure is harmless.
|
||||
unsafe {
|
||||
let none = libc::rlimit { rlim_cur: 0, rlim_max: 0 };
|
||||
libc::setrlimit(libc::RLIMIT_CORE, &none);
|
||||
#[cfg(target_os = "linux")]
|
||||
libc::prctl(libc::PR_SET_DUMPABLE, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user