|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/bin/ |
Upload File : |
#!/bin/sh -e
# This script unmounts a user's private ecryptfs folder
# and clears the kernel keyring of the relevant keys
#
# Original by Michael Halcrow, IBM
# Extracted to a stand-alone script by Dustin Kirkland <kirkland@canonical.com>
if grep -qs "$HOME/.Private $PWD ecryptfs " /proc/mounts 2>/dev/null; then
pwd_mounted=1
fi
out=`/sbin/umount.ecryptfs_private 2>&1`
if [ -n "$out" ]; then
echo "$out"
fi
if echo "$out" | grep -q -v "Sessions still open"; then
for sig in `cat "$HOME/.ecryptfs/Private.sig"`; do
key_id=`keyctl show | grep "$sig$" | awk '{print $1}'`
keyctl unlink "$key_id" @u
done
fi
if [ "$pwd_mounted" = "1" ]; then
echo
echo "INFO: Your private directory has been unmounted."
echo "INFO: To see this change in your current shell:"
echo " cd $PWD"
echo
fi