/usr/lib/keyringer/actions/shell is in keyringer 0.3.7-1+deb8u1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/bin/bash
#
# Interactive shell.
#
# Load functions
LIB="`dirname $0`/../functions"
source "$LIB" || exit 1
# Basic parameters
SHELLPATH="/"
# Show usage
keyringer_usage $KEYRING
# While a "quit" command isn't entered, read STDIN
while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do
if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then
break
elif [ "$STDIN" == "shell" ]; then
echo "Why you need nesting?"
elif [[ "$STDIN" == "cd"* ]]; then
# Update current path
OLDPATH="$SHELLPATH"
SHELLPATH="`echo $STDIN | sed -e 's/^cd//' | cut -d ' ' -f 2`"
# Fix current path
if [ "$SHELLPATH" == "/" ] || [ "$SHELLPATH" == "" ]; then
SHELLPATH="/"
elif [[ "$SHELLPATH" == ".."* ]]; then
ARGS="$SHELLPATH"
SHELLPATH="$OLDPATH"
for colons in `echo $ARGS | sed -e 's|/| |g'`; do
SHELLPATH="`dirname $SHELLPATH | sed -e 's|^\.||'`"
done
fi
# Ensure path is absolute
if echo "$SHELLPATH" | grep -v -q -e "^/"; then
SHELLPATH="/$OLDPATH/$SHELLPATH"
fi
# Removing multiple slashes
SHELLPATH="`echo $SHELLPATH | sed -e 's/\/\+/\//g'`"
# Check if path exists
if [ ! -d "$KEYDIR/$SHELLPATH" ]; then
echo "No such folder $SHELLPATH"
SHELLPATH="$OLDPATH"
fi
elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then
# If line is not empty or commented, process command
RELATIVE_PATH="$SHELLPATH" keyringer "$KEYRING" $STDIN
fi
done
|