Skip to content

Commit

Permalink
add chwon chrome-sandbox to postinst script
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Aug 6, 2024
1 parent 1583f55 commit 058e008
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/extend-deb-postinst.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ console.log('.deb file unpacked.');
const posinstPath = `${unpackDirectory}/DEBIAN/postinst`;
const postinstScript = fs.readFileSync(posinstPath, 'utf-8');
const postinstScriptModified = postinstScript.replace(
"chrome-sandbox' || true",
'# SUID chrome-sandbox for Electron 5+',
`chrome-sandbox' || true
if [ -e /etc/lsb-release ]; then
Expand All @@ -48,6 +48,9 @@ if [ -e /etc/lsb-release ]; then
if [ $release_version == "24.04" ]; then
# chown the sandbox on Ubuntu 24.04
chown '/opt/${productName}/chrome-sandbox' || true
# add AppArmor profile on Ubuntu 24.04
profile_content="# This profile allows everything and only exists to give the
# application a name instead of having the label "unconfined"
Expand All @@ -64,9 +67,13 @@ profile ${appId} '/opt/${productName}/${appId}' flags=(unconfined) {
echo "$profile_content" > /etc/apparmor.d/${appId}
systemctl reload apparmor.service
fi
fi
# SUID chrome-sandbox for Electron 5+
`,
);

Expand Down

0 comments on commit 058e008

Please sign in to comment.