Skip to content

Commit

Permalink
fix sometimes hanging during postinstall (keybase#22829)
Browse files Browse the repository at this point in the history
  • Loading branch information
heronhaye authored Mar 3, 2020
1 parent 730e870 commit 9e2a87b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packaging/linux/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ autorestart_enabled() {
}

make_mountpoint() {
if redirector_enabled ; then
local_is_redirector_enabled="$1"
if [ -n "$local_is_redirector_enabled" ]; then
if ! mountpoint "$rootmount" &> /dev/null; then
mkdir -p "$rootmount"
chown root:root "$rootmount"
Expand Down Expand Up @@ -177,9 +178,14 @@ if command -v gtk-update-icon-cache &> /dev/null ; then
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
fi

is_redirector_enabled=""
if redirector_enabled; then
is_redirector_enabled="1"
fi

# Set suid on redirector before we restart it, in case package manager reverted
# permissions.
if redirector_enabled ; then
if [ -n "$is_redirector_enabled" ]; then
chown root:root "$krbin"
chmod 4755 "$krbin"
else
Expand Down Expand Up @@ -215,7 +221,7 @@ elif [ -d "$rootmount" ] ; then
fi
rmdir "$rootmount"
echo You must run run_keybase to restore file system access.
elif ! redirector_enabled ; then
elif [ -z "$is_redirector_enabled" ]; then
if killall "$(basename "$krbin")" &> /dev/null ; then
echo "Stopping existing root redirector."
fi
Expand Down Expand Up @@ -266,4 +272,4 @@ elif [ -d "$rootmount" ] ; then
fi

# Make the mountpoint if it doesn't already exist by this point.
make_mountpoint
make_mountpoint "$is_redirector_enabled"

0 comments on commit 9e2a87b

Please sign in to comment.