Skip to content

Commit 4724ab5

Browse files
Anaple布丁狗~
and
布丁狗~
authored
fix SUID chrome-sandbox (#12)
Co-authored-by: 布丁狗~ <pompurin404@mihomo.party>
1 parent 2d6e8f5 commit 4724ab5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

build/linux/deb/postinst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
if type update-alternatives 2>/dev/null >&1; then
4+
# Remove previous link if it doesn't use update-alternatives
5+
if [ -L '/usr/bin/mihomo-party' -a -e '/usr/bin/mihomo-party' -a "`readlink '/usr/bin/mihomo-party'`" != '/etc/alternatives/mihomo-party' ]; then
6+
rm -f '/usr/bin/mihomo-party'
7+
fi
8+
update-alternatives --install '/usr/bin/mihomo-party' 'mihomo-party' '/opt/mihomo-party/mihomo-party' 100 || ln -sf '/opt/mihomo-party/mihomo-party' '/usr/bin/mihomo-party'
9+
else
10+
ln -sf '/opt/mihomo-party/mihomo-party' '/usr/bin/mihomo-party'
11+
fi
12+
13+
chmod 4755 '/opt/mihomo-party/chrome-sandbox' || true
14+
15+
if hash update-mime-database 2>/dev/null; then
16+
update-mime-database /usr/share/mime || true
17+
fi
18+
19+
if hash update-desktop-database 2>/dev/null; then
20+
update-desktop-database /usr/share/applications || true
21+
fi

electron-builder.yml

+2
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ linux:
5858
maintainer: mihomo-party
5959
category: Utility
6060
artifactName: ${name}-linux-${version}-${arch}.${ext}
61+
deb:
62+
afterInstall: "build/linux/deb/postinst"
6163
npmRebuild: true
6264
publish: []

0 commit comments

Comments
 (0)