[gnome-boxes] express,fedora: Don't require password
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] express,fedora: Don't require password
- Date: Mon, 13 Aug 2012 09:15:54 +0000 (UTC)
commit 77034f14fb41a0cf11e9aa27690510b823a8d8b4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Aug 8 16:16:25 2012 +0300
express,fedora: Don't require password
We now make use of kickstart file's post installation setup to manually
setup user and root passwords. This makes it possible for us to unset
passwords when needed (user doesn't specify password in 'setup').
This makes Fedora's password policy consistent with Windows XP and 7.
https://bugzilla.gnome.org/show_bug.cgi?id=680825
data/fedora.ks | 14 ++++++++++----
src/fedora-installer.vala | 1 -
src/unattended-installer.vala | 5 -----
3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/data/fedora.ks b/data/fedora.ks
index 33f6366..dafdc66 100644
--- a/data/fedora.ks
+++ b/data/fedora.ks
@@ -2,7 +2,7 @@ install
keyboard BOXES_FEDORA_KBD
lang BOXES_LANG
network --onboot yes --device eth0 --bootproto dhcp --noipv6 --hostname=BOXES_HOSTNAME --activate
-rootpw BOXES_PASSWORD
+rootpw dummyPa55w0rd # Actual password set (or unset) in %post below
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --enforcing
@@ -21,7 +21,6 @@ logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow
logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
reboot
-user --name=BOXES_USERNAME --password=BOXES_PASSWORD
%packages
@base
@@ -38,8 +37,15 @@ BOXES_FEDORA_SPICE_PACKAGES
%post --erroronfail
-# Add user to admin group
-usermod -a -G wheel BOXES_USERNAME
+useradd -G wheel BOXES_USERNAME # Add user
+if test -z BOXES_PASSWORD; then
+ # Make both user and root account passwordless
+ passwd -d BOXES_USERNAME
+ passwd -d root
+else
+ echo BOXES_PASSWORD |passwd --stdin BOXES_USERNAME
+ echo BOXES_PASSWORD |passwd --stdin root
+fi
# Set user avatar
mkdir /mnt/unattended-media
diff --git a/src/fedora-installer.vala b/src/fedora-installer.vala
index b169a3f..0fa0662 100644
--- a/src/fedora-installer.vala
+++ b/src/fedora-installer.vala
@@ -32,7 +32,6 @@ private class Boxes.FedoraInstaller: UnattendedInstaller {
var source_path = get_unattended ("fedora.ks");
base.from_media (media, source_path, "ks.cfg");
- password_mandatory = true;
kbd = fetch_console_kbd_layout ();
}
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 6fb1e99..6893461 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -41,7 +41,6 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
public DataStreamNewlineType newline_type;
public File? disk_file;
- protected bool password_mandatory;
protected GLib.List<UnattendedFile> unattended_files;
protected Gtk.Table setup_table;
@@ -167,10 +166,6 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
if (username == "")
throw new UnattendedInstallerError.SETUP_INCOMPLETE (_("No username provided"));
-
- if (password_mandatory && password == "")
- throw new UnattendedInstallerError.SETUP_INCOMPLETE
- (_("Password required for express installation of %s"), label);
}
public override List<Pair> get_vm_properties () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]