Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.eol": "\n",
"files.autoGuessEncoding": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
}
18 changes: 15 additions & 3 deletions keychain.pod
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@ Keychain also supports GnuPG 2.1 and later, and will automatically start
gpg-agent if any GPG keys are referenced on the command-line, and will ensure
these credentials are cached in memory and available for use.

Keychain supports most UNIX-like operating systems. It supports integration
with Bourne-compatible, csh-compatible and fish shells.

Official project home: L<https://github.com/danielrobbins/keychain>.

=head1 COMPATIBILITY

Keychain supports most UNIX-like operating systems.

Keychain itself requires a Bourne-compatible shell to function, but will
support integration with Bourne, csh/tcsh, and fish shells. Bash, ksh and
zsh should also work as they can consume the standard Bourne pidfiles
generated by Keychain.

Keychain will work with a reasonably modern OpenSSH (7.3 and newer), and
should also be compatible with many legacy SSH implementations
such as SunSSH which can be found on older Oracle Solaris systems.

GnuPG support requires GnuPG 2.1 or later.

=head1 LIFECYCLE

Typically, you configure keychain to run when you first log in to a system.
Expand Down
22 changes: 7 additions & 15 deletions keychain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

versinfo() {
qprint
qprint " Copyright ${CYANN}2009-##CUR_YEAR##${OFF} Daniel Robbins, BreezyOps;"
qprint " Copyright ${CYANN}2002-##CUR_YEAR##${OFF} Daniel Robbins, BreezyOps;"
qprint " lockfile() Copyright ${CYANN}2009${OFF} Parallels, Inc."
qprint " Copyright ${CYANN}2007${OFF} Aron Griffis;"
qprint " Copyright ${CYANN}2002-2006${OFF} Gentoo Foundation;"
Expand Down Expand Up @@ -124,8 +124,7 @@ me=$(id -un) || die "Who are you? id -un doesn't know..."
# synopsis: testssh
# Figure out which ssh is in use, set the global boolean $openssh and $sunssh
testssh() {
# Query local host for SSH application, presently supporting
# OpenSSH, Sun SSH, and ssh.com
# Query local host for SSH application, presently supporting OpenSSH and Sun SSH:
openssh=false
sunssh=false

Expand Down Expand Up @@ -429,7 +428,7 @@ SSH_AGENT_PID=$SSH_AGENT_PID; export SSH_AGENT_PID"
else
mesg "Starting ssh-agent..."
# shellcheck disable=SC2086 # We purposely don't want to double-quote the args to ssh-agent so they disappear if not used:
pidfile_out="$(ssh-agent ${ssh_timeout} ${ssh_agent_socket})"
pidfile_out="$(ssh-agent -s ${ssh_timeout} ${ssh_agent_socket})"
return $?
fi
fi
Expand All @@ -438,18 +437,11 @@ SSH_AGENT_PID=$SSH_AGENT_PID; export SSH_AGENT_PID"
write_pidfile() {
if [ -n "$pidfile_out" ]; then
pidfile_out=$(echo "$pidfile_out" | grep -v 'Agent pid')
case $pidfile_out in setenv\ *) error "unexpected csh-style ssh-agent output (expected -s)"; exit 1;; esac
rm -f "$pidf" "$cshpidf" "$fishpidf" # Remove first, so we can recreate with our umask
case "$pidfile_out" in
setenv*)
echo "$pidfile_out" >"$cshpidf"
echo "$pidfile_out" | awk '{print $2"="$3" export "$2";"}' >"$pidf"
;;
*)
echo "$pidfile_out" >"$pidf"
echo "$pidfile_out" | sed 's/;.*/;/' | sed 's/=/ /' | sed 's/^/setenv /' >"$cshpidf"
echo "$pidfile_out" | sed 's/;.*/;/' | sed 's/^\(.*\)=\(.*\);/set -e \1; set -x -U \1 \2;/' >"$fishpidf"
;;
esac
echo "$pidfile_out" >"$pidf"
echo "$pidfile_out" | sed 's/;.*/;/' | sed 's/=/ /' | sed 's/^/setenv /' >"$cshpidf"
echo "$pidfile_out" | sed 's/;.*/;/' | sed 's/^\(.*\)=\(.*\);/set -e \1; set -x -U \1 \2;/' >"$fishpidf"
else
debug skipping creation of pidfiles!
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/release-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for f in "$ASSET_TARBALL" "$ASSET_KEYCHAIN" "$ASSET_MAN"; do
[ -f "$f" ] || fail "Missing asset file $f"
# Determine publish name (basename should remain canonical filenames)
case $(basename "$f") in
keychain-$VER.tar.gz) pname="keychain-$VER.tar.gz";;
"keychain-$VER.tar.gz") pname="keychain-$VER.tar.gz";;
keychain) pname="keychain";;
keychain.1) pname="keychain.1";;
*) # If path is different (e.g., CI dir), map by type heuristics
Expand Down
6 changes: 3 additions & 3 deletions scripts/release-orchestrate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Orchestrated release creation/refresh with:
# 1. Local build presence check (already performed via Makefile prereqs)
# 2. CI artifact fetch (mandatory)
Expand Down Expand Up @@ -142,7 +142,7 @@ for artifact in keychain keychain.1 keychain-$VER.tar.gz; do
fi
fi
;;
keychain-$VER.tar.gz)
"keychain-$VER.tar.gz")
if compare_tar_content "$artifact" "$CI_DIR/$artifact"; then
# If tar blob hash matches display it; else note normalized match.
L=$(calc_sha256 "$artifact"); R=$(calc_sha256 "$CI_DIR/$artifact")
Expand Down Expand Up @@ -203,7 +203,7 @@ sed 's/^/| /' "$NOTES_FILE"
echo "========================================================================="

printf 'Continue with %s of %s? (Y/N): ' "$MODE" "$VER"
read ans < /dev/tty || ans=N
read -r ans < /dev/tty || ans=N
case "$ans" in
Y|y) echo "Continuing...";;
*) echo "Aborted by user."; exit 1;;
Expand Down
2 changes: 1 addition & 1 deletion scripts/release-refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ASSET_TARBALL=${KEYCHAIN_ASSET_TARBALL:-keychain-$VER.tar.gz}
for f in "$ASSET_TARBALL" "$ASSET_KEYCHAIN" "$ASSET_MAN"; do
[ -f "$f" ] || fail "Missing asset file $f"
case $(basename "$f") in
keychain-$VER.tar.gz) pname="keychain-$VER.tar.gz";;
"keychain-$VER.tar.gz") pname="keychain-$VER.tar.gz";;
keychain) pname="keychain";;
keychain.1) pname="keychain.1";;
*) if echo "$f" | grep -q "keychain-$VER.tar.gz"; then pname="keychain-$VER.tar.gz"; fi
Expand Down