Skip to content

Commit eded50c

Browse files
committed
[fix] (Linux) World-writable permissions on UI files
ivpn/desktop-app-shadow#175
1 parent add593c commit eded50c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ui/References/Linux/package_scripts/after-install.sh

+13-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
echo "[*] After install (<%= version %> : <%= pkg %> : $1)"
44

5-
DIR=/usr/share/applications
6-
DESKTOP_FILE=$DIR/IVPN.desktop
7-
if [ -d "$DIR" ]; then
5+
# update permissions for .desktop file and icon
6+
DESKTOP_SRC_FILE=/opt/ivpn/ui/IVPN.desktop
7+
ICON_SRC_FILE=/opt/ivpn/ui/ivpnicon.svg
8+
sudo chmod 744 $DESKTOP_SRC_FILE
9+
sudo chmod 744 $ICON_SRC_FILE
10+
11+
# create link to .desktop file
12+
APPS_DIR=/usr/share/applications
13+
DESKTOP_APPS_FILE=$APPS_DIR/IVPN.desktop
14+
if [ -d "$APPS_DIR" ]; then
815
echo "[ ] Installing .desktop file..."
9-
ln -fs /opt/ivpn/ui/IVPN.desktop $DESKTOP_FILE || echo "[!] Failed to create .desktop file: '$DESKTOP_FILE'"
16+
ln -fs $DESKTOP_SRC_FILE $DESKTOP_APPS_FILE || echo "[!] Failed to create link to .desktop file: '$DESKTOP_SRC_FILE' -> '$DESKTOP_APPS_FILE'"
1017
else
11-
echo "[!] Unable to install .desktop file. Folder '$DIR' not exists"
18+
echo "[!] Unable to install .desktop file. Folder '$APPS_DIR' not exists"
1219
fi
1320

21+
# electron app requires 'chrome-sandbox' to be setuid root in some systems
1422
sudo chmod 4755 /opt/ivpn/ui/bin/chrome-sandbox || echo "[!] Failed to 'chmod' for '/opt/ivpn/ui/bin/chrome-sandbox'"

0 commit comments

Comments
 (0)