Skip to content

Commit

Permalink
fix(provd): use provd group, not gnome-initial-setup group
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-hagemann committed Apr 11, 2024
1 parent 11f8ce5 commit 964fbc4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
7 changes: 7 additions & 0 deletions provd/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
provd (0.1.2) noble; urgency=medium

* provd to use provd group, not gnome-initial-setup group.
* Fixed issues preventing use of sbuild.

-- Matthew Gary Hagemann <matt.hagemann@canonical.com> Tue, 11 Apr 2024 07:48:45 +0200

provd (0.1.1) noble; urgency=medium

* provd now pre-depends on gnome-initial-setup for gnome-initial-setup group.
Expand Down
10 changes: 7 additions & 3 deletions provd/debian/provd.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e

case "$1" in
configure)
# Create the provd group and add gnome-initial-setup to it.
addgroup --system provd
usermod -G provd gnome-initial-setup

# Set ownership and permissions for launch-desktop-provision-init.sh
chown gnome-initial-setup:gnome-initial-setup /usr/libexec/launch-desktop-provision-init
chown gnome-initial-setup:provd /usr/libexec/launch-desktop-provision-init
chmod 750 /usr/libexec/launch-desktop-provision-init

# Set ownership and permissions for bin's
chown root:gnome-initial-setup /usr/libexec/sprovd
chown root:gnome-initial-setup /usr/libexec/provd
chown root:provd /usr/libexec/sprovd
chown root:provd /usr/libexec/provd
chmod u+s /usr/libexec/sprovd
;;
esac
Expand Down
17 changes: 17 additions & 0 deletions provd/debian/provd.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -e

case "$1" in
purge)
# Revert gnome-initial-setup to nogroup
usermod -G nogroup gnome-initial-setup

# Remove provd group
groupdel provd
;;
esac

#DEBHELPER#

exit 0
2 changes: 1 addition & 1 deletion provd/sprovd/sprovd.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func chown(username string) error {
}

// #nosec:G204 // We are in control of the username and validate we can find it on the system before executing.
cmd := exec.Command("chown", fmt.Sprintf("%s:gnome-initial-setup", username), "/run/gnome-initial-setup")
cmd := exec.Command("chown", fmt.Sprintf("%s:provd", username), "/run/gnome-initial-setup")
_, err = cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("executing chown command: %w", err)
Expand Down

0 comments on commit 964fbc4

Please sign in to comment.