-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:[close #209] User does not always have permissions for changes
tested both on bare metal and vm, first setup does not prompt for the password. Side note: since this update will not be in the ISO immediately, the processor will replace it with the one in upstream. Be sure to replace it again on a tty before logging in again, otherwise it will ask for a password.
- Loading branch information
1 parent
66614a8
commit 541dcb8
Showing
8 changed files
with
104 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE policyconfig PUBLIC | ||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | ||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> | ||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> | ||
|
||
<policyconfig> | ||
<vendor>vanillaos</vendor> | ||
<vendor_url>https://github.com/vanillaos/first-setup</vendor_url> | ||
<icon_name>system-file-manager</icon_name> | ||
<action id="org.freedesktop.policykit.pkexec.org.vanillaos.FirstSetup"> | ||
<description>Run First Setup as Administrator</description> | ||
<defaults> | ||
<allow_any>auth_admin</allow_any> | ||
<allow_inactive>auth_admin</allow_inactive> | ||
<allow_active>auth_admin</allow_active> | ||
</defaults> | ||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/vanilla-first-setup</annotate> | ||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> | ||
</action> | ||
|
||
<action id="org.vanillaos.FirstSetup.exec"> | ||
<description>Run Vanilla OS First Setup</description> | ||
<message>Run the Vanilla OS First Setup with privileges</message> | ||
<defaults> | ||
<allow_any>no</allow_any> | ||
<allow_inactive>no</allow_inactive> | ||
<allow_active>auth_admin_keep</allow_active> | ||
</defaults> | ||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/vanilla-first-setup-exec</annotate> | ||
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate> | ||
</action> | ||
|
||
</policyconfig> |
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,8 @@ | ||
polkit.addRule(function(action, subject) { | ||
if (action.id == "org.vanillaos.FirstSetup.exec") | ||
{ | ||
polkit.log("action=" + action); | ||
polkit.log("subject=" + subject); | ||
return polkit.Result.YES; | ||
} | ||
}); |
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
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
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,43 @@ | ||
#!@PYTHON@ | ||
|
||
# vanilla-first-setup.in | ||
# | ||
# Copyright 2022 mirkobrombin | ||
# | ||
# 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 Foundationat version 3 of the License. | ||
# | ||
# 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, see <http://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
import signal | ||
import locale | ||
import gettext | ||
|
||
VERSION = '@VERSION@' | ||
pkgdatadir = '@pkgdatadir@' | ||
localedir = '@localedir@' | ||
|
||
sys.path.insert(1, pkgdatadir) | ||
signal.signal(signal.SIGINT, signal.SIG_DFL) | ||
locale.bindtextdomain('vanilla_first_setup', localedir) | ||
locale.textdomain('vanilla_first_setup') | ||
gettext.install('vanilla_first_setup', localedir) | ||
|
||
if __name__ == '__main__': | ||
import gi | ||
|
||
from gi.repository import Gio | ||
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'vanilla-first-setup.gresource')) | ||
resource._register() | ||
|
||
from vanilla_first_setup import main | ||
sys.exit(main.main(VERSION)) |
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 |
---|---|---|
@@ -1,43 +1,2 @@ | ||
#!@PYTHON@ | ||
|
||
# vanilla-first-setup.in | ||
# | ||
# Copyright 2022 mirkobrombin | ||
# | ||
# 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 Foundationat version 3 of the License. | ||
# | ||
# 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, see <http://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
import signal | ||
import locale | ||
import gettext | ||
|
||
VERSION = '@VERSION@' | ||
pkgdatadir = '@pkgdatadir@' | ||
localedir = '@localedir@' | ||
|
||
sys.path.insert(1, pkgdatadir) | ||
signal.signal(signal.SIGINT, signal.SIG_DFL) | ||
locale.bindtextdomain('vanilla_first_setup', localedir) | ||
locale.textdomain('vanilla_first_setup') | ||
gettext.install('vanilla_first_setup', localedir) | ||
|
||
if __name__ == '__main__': | ||
import gi | ||
|
||
from gi.repository import Gio | ||
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'vanilla-first-setup.gresource')) | ||
resource._register() | ||
|
||
from vanilla_first_setup import main | ||
sys.exit(main.main(VERSION)) | ||
#!/bin/sh | ||
pkexec vanilla-first-setup-exec "$@" |