From b515aa81acf355d154cd7483c975415723e01165 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sun, 18 Feb 2024 15:53:29 +0300 Subject: [PATCH] attempt to fix user creation --- Cargo.toml | 2 +- debian/changelog | 2 +- src/first_setup/user_carousel/mod.rs | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 70e2b89..f5c6bc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pika-first-setup-gtk4" -version = "0.1.0" +version = "1.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/debian/changelog b/debian/changelog index f7618a2..45c1558 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pika-first-setup (1.0.0-100pika1) pikauwu; urgency=low +pika-first-setup (1.0.1-100pika1) pikauwu; urgency=low * First release diff --git a/src/first_setup/user_carousel/mod.rs b/src/first_setup/user_carousel/mod.rs index 9bba886..a2fdc72 100644 --- a/src/first_setup/user_carousel/mod.rs +++ b/src/first_setup/user_carousel/mod.rs @@ -21,12 +21,12 @@ USERNAME="$0" PASSWORD="$1" FULLNAME="$2" adduser --quiet --disabled-password --shell /bin/bash --gecos "${FULLNAME}" "${USERNAME}" -echo "${USERNAME}":"${PASSWORD}" | /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh chpasswd -usermod -a -G /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh "${USERNAME}" +echo "${USERNAME}":"${PASSWORD}" | chpasswd +usermod -a -G sudo "${USERNAME}" mkdir -p /home/"${USERNAME}" cp -rvf /etc/skel/.* /home/"${USERNAME}"/ || true chown -R "${USERNAME}":"${USERNAME}" /home/"${USERNAME}" -usermod -a -G adm,cdrom,/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh,render,dip,video,plugdev,input,render,lpadmin "${USERNAME}" +usermod -a -G adm,cdrom,sudo,render,dip,video,plugdev,input,render,lpadmin "${USERNAME}" rm -rf /etc/sddm.conf.d/zautologin.conf || true "###; @@ -281,7 +281,8 @@ pub fn user_carousel(first_setup_carousel: &adw::Carousel) { })); user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_password, @weak user_info_full_name => move |_| { - let _ = cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read(); + let result cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read(); + assert!(result.is_ok()); first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true); })); }