-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unprivileged manipulation of storage devices
- Loading branch information
Showing
5 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Copyright (C) 2021 Piotr Chmielnicki | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
set -e | ||
set -x | ||
|
||
cd "$(dirname $(readlink -f "${0}"))"/.. | ||
|
||
if [ "${BUILD_STAGE}" != 2 ] | ||
then | ||
echo "Error: this script should no be run manually." >&2 | ||
exit -1 | ||
fi | ||
|
||
cp conf/udisk-polkit.rules "${USERLAND_ROOT}/etc/polkit-1/localauthority/10-vendor.d/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../build-stage2-available.d/74allow-disk-operations.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
addRule(function(action, subject) { | ||
var authorized = ["org.freedesktop.udisks2.filesystem-mount", | ||
"org.freedesktop.udisks2.encrypted-unlock", | ||
"org.freedesktop.udisks2.encrypted-change-passphrase", | ||
"org.freedesktop.udisks2.power-off-drive", | ||
"org.freedesktop.udisks2.eject-media", | ||
"org.freedesktop.udisks2.modify-device", | ||
"org.freedesktop.udisks2.rescan", | ||
"org.freedesktop.udisks2.ata-smart-update", | ||
"org.freedesktop.udisks2.ata-secure-erase", | ||
"org.freedesktop.udisks2.cancel-job"]; | ||
|
||
for (var i = 0; i < authorized.length; i++) { | ||
if (action.id === authorized[i]) { | ||
return polkit.Result.YES; | ||
} | ||
} | ||
return polkit.Result.NOT_HANDLED; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ caja-seahorse | |
console-data | ||
firmware-linux-nonfree | ||
git | ||
gnome-disk-utility | ||
htop | ||
hunspell-af | ||
hunspell-an | ||
|