File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
packages/app-builder-lib/templates/linux Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " app-builder-lib " : patch
3
+ ---
4
+
5
+ fix: don't setuid chrome-sandbox when not required
Original file line number Diff line number Diff line change 10
10
ln -sf ' /opt/${sanitizedProductName}/${executable}' ' /usr/bin/${executable}'
11
11
fi
12
12
13
- # SUID chrome-sandbox for Electron 5+
14
- chmod 4755 ' /opt/${sanitizedProductName}/chrome-sandbox' || true
13
+ # Check if user namespaces are supported by the kernel and working with a quick test:
14
+ if ! { [[ -L /proc/self/ns/user ]] && unshare --user true ; }; then
15
+ # Use SUID chrome-sandbox only on systems without user namespaces:
16
+ chmod 4755 ' /opt/${sanitizedProductName}/chrome-sandbox' || true
17
+ else
18
+ chmod 0755 ' /opt/${sanitizedProductName}/chrome-sandbox' || true
19
+ fi
15
20
16
21
if hash update-mime-database 2> /dev/null; then
17
22
update-mime-database /usr/share/mime || true
Original file line number Diff line number Diff line change @@ -530,8 +530,13 @@ else
530
530
ln -sf '/opt/foo/Boo' '/usr/bin/Boo'
531
531
fi
532
532
533
- # SUID chrome-sandbox for Electron 5+
534
- chmod 4755 '/opt/foo/chrome-sandbox' || true
533
+ # Check if user namespaces are supported by the kernel and working with a quick test:
534
+ if ! { [[ - L / proc / self / ns / user ]] && unshare -- user true ; } ; then
535
+ # Use SUID chrome-sandbox only on systems without user namespaces:
536
+ chmod 4755 '/opt/foo/chrome-sandbox' || true
537
+ else
538
+ chmod 0755 '/opt/foo/chrome-sandbox' || true
539
+ fi
535
540
536
541
if hash update-mime-database 2>/dev/null; then
537
542
update-mime-database /usr/share/mime || true
You can’t perform that action at this time.
0 commit comments