Compare commits

..

No commits in common. "main" and "v0.5.0" have entirely different histories.
main ... v0.5.0

4 changed files with 6 additions and 31 deletions

View File

@ -72,13 +72,13 @@ Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Debian/Ubuntu (amd64):
```bash
sudo apt install ./sshkeeper_0.5.1-1_amd64.deb
sudo apt install ./sshkeeper_0.4.1-1_amd64.deb
```
Fedora/RHEL-family (x86_64):
```bash
sudo dnf install ./sshkeeper-0.5.1-1.x86_64.rpm
sudo dnf install ./sshkeeper-0.4.1-1.x86_64.rpm
```
`arm64`/`aarch64` packages are published alongside the x86_64 builds. Native
@ -98,8 +98,8 @@ sshkeeper --version
The traditional tar.gz archive remains available too:
```bash
tar -xzf sshkeeper_v0.5.1_linux_amd64.tar.gz
sudo install -m 0755 sshkeeper_v0.5.1_linux_amd64/sshkeeper /usr/local/bin/sshkeeper
tar -xzf sshkeeper_v0.4.1_linux_amd64.tar.gz
sudo install -m 0755 sshkeeper_v0.4.1_linux_amd64/sshkeeper /usr/local/bin/sshkeeper
sshkeeper
```

View File

@ -1,12 +0,0 @@
# sshkeeper v0.5.1 — Package Migration Fix
v0.5.1 is a patch release on top of v0.5.0 Persistent SSH Sessions.
## Fixed
- Fixed DEB/RPM post-install discovery of legacy per-user binaries at `~/.local/bin/sshkeeper`.
- Package installation now correctly backs up a legacy binary and replaces its old path with a symlink to `/usr/bin/sshkeeper`.
- Added a regression test that discovers the user path through passwd data, matching the real package-install path.
- `sshkeeper --version` and `sshkeeper version` continue to report the embedded release version.
No session functionality from v0.5.0 is removed or rolled back.

View File

@ -4,7 +4,6 @@ umask 077
SYSTEM_BINARY=${SSHKEEPER_SYSTEM_BINARY:-/usr/bin/sshkeeper}
STATE_FILE=${SSHKEEPER_STATE_FILE:-/var/lib/sshkeeper/package-legacy-paths}
PASSWD_FILE=${SSHKEEPER_PASSWD_FILE:-/etc/passwd}
candidate_paths() {
if [ -n "${SSHKEEPER_LEGACY_PATHS:-}" ]; then
@ -15,8 +14,8 @@ candidate_paths() {
fi
printf 'root\t%s\n' /usr/local/bin/sshkeeper
if [ -r "$PASSWD_FILE" ]; then
awk -F: '$3 == 0 || $3 >= 1000 { if ($6 != "" && $6 != "/") printf "%s\t%s/.local/bin/sshkeeper\n", $1, $6 }' "$PASSWD_FILE"
if [ -r /etc/passwd ]; then
awk -F: '$3 == 0 || $3 >= 1000 { if ($6 != "" && $6 != "/") printf "%s\\t%s/.local/bin/sshkeeper\\n", $1, $6 }' /etc/passwd
fi
}

View File

@ -15,18 +15,6 @@ printf 'old-user\n' > "$legacy_user"
printf 'old-local\n' > "$legacy_local"
chmod +x "$system" "$legacy_user" "$legacy_local"
# Discover ~/.local/bin/sshkeeper through passwd exactly as a real package install does.
passwd_file="$tmp/passwd"
printf 'test:x:1000:1000:test:%s:/bin/bash\n' "$tmp/home/test" > "$passwd_file"
env SSHKEEPER_MIGRATION_RUN_AS_CURRENT=1 SSHKEEPER_SYSTEM_BINARY="$system" SSHKEEPER_STATE_FILE="$state" SSHKEEPER_PASSWD_FILE="$passwd_file" \
packaging/scripts/postinstall.sh configure
test -L "$legacy_user"
test "$(readlink "$legacy_user")" = "$system"
test -f "${legacy_user}.legacy-backup"
env SSHKEEPER_MIGRATION_RUN_AS_CURRENT=1 SSHKEEPER_SYSTEM_BINARY="$system" SSHKEEPER_STATE_FILE="$state" \
packaging/scripts/postremove.sh remove
test "$(cat "$legacy_user")" = old-user
paths=$(printf '%s\n%s' "$legacy_user" "$legacy_local")
env SSHKEEPER_MIGRATION_RUN_AS_CURRENT=1 SSHKEEPER_SYSTEM_BINARY="$system" SSHKEEPER_STATE_FILE="$state" SSHKEEPER_LEGACY_PATHS="$paths" \
packaging/scripts/postinstall.sh configure