From 3a7685561df0a4d80e727e5b26fbf413ad0586f2 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Fri, 26 Aug 2011 21:56:56 +0000 Subject: [PATCH] =?utf8?q?Ajout=20fonctionalit=C3=A9=20pour=20qu'un=20usag?= =?utf8?q?er=20normal=20puisse=20faire=20un=20shutdown.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- TODO | 9 +-------- stage1/create-config-files | 4 ++++ stage1/create-groups | 5 +++-- stage2/pkg/sysvinit | 10 ++++++++++ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index cbefc6f..59aba44 100644 --- a/TODO +++ b/TODO @@ -14,7 +14,7 @@ -Enlever automatiquement les patches antérieures du style: [module]-[version]-[nom_patch]-[version_patch] --install guitartex et lilypond automatiquement: +-install guitartex -installer modes emacs: php, html, css, etc. @@ -56,11 +56,6 @@ Octave: install gnuplot install libf2c/libf2c.a /usr/lib flex-2.5.4? --> temporarirement dans /opt... -reboot ne fonctionne pas... (must be superuser) même avec l'usager -dans /etc/shutdown.allow -Permettre aux usagers de rebooter (sauf pour serveur): - chmod u+s /sbin/halt - Simplifier fonction 'var_add()' Simplify scanner support in sysinfos @@ -71,8 +66,6 @@ doit d doivent l'exporter automatiquement (ne doit plus être lue à partir du fichier sysinfos). -Ajouter une variable "package_location" dans sysinfos - Faire un script de test (tester la présence de certains programmes à la toute fin de l'installation (ou dans chaque script d'installation) diff --git a/stage1/create-config-files b/stage1/create-config-files index 32c6399..e2b284e 100755 --- a/stage1/create-config-files +++ b/stage1/create-config-files @@ -211,6 +211,10 @@ cat > ${LFS}/etc/shells << "EOF" EOF chmod 644 ${LFS}/etc/shells +# This file contains a list of users (1 per line) who are allowed to shutdown +# the computer. This doesn't mean that these users can invoke the shutdown +# (or reboot or halt) command(s). Instead, it means that an authorized user +# can shut down the computer by pressing ctrl+alt+del. echo "Creating /etc/shutdown.allow" echo "${REGUSER}" > ${LFS}/etc/shutdown.allow diff --git a/stage1/create-groups b/stage1/create-groups index 3b57abc..88d3015 100755 --- a/stage1/create-groups +++ b/stage1/create-groups @@ -23,10 +23,11 @@ usb:x:14: cdrom:x:15: # Used by MTAs (Mail Transport Agents) mail:x:30:mail -# Default group used by some programs that do not require a group. -nogroup:x:65533: +shutdown:x:999: # The default GID used by shadow for new users users:x:1000: +# Default group used by some programs that do not require a group. +nogroup:x:65533: EOF exit $? diff --git a/stage2/pkg/sysvinit b/stage2/pkg/sysvinit index 4a80bd8..853c904 100644 --- a/stage2/pkg/sysvinit +++ b/stage2/pkg/sysvinit @@ -17,3 +17,13 @@ hvbuild() make -j ${MAKEJOBS} -C src make -C src install } + +hvbuild_post() +{ + chown root:shutdown /sbin/{halt,poweroff,reboot,shutdown} + chmod 750 /sbin/{halt,poweroff,reboot,shutdown} + chmod u+s /sbin/{halt,poweroff,reboot,shutdown} + + # Il faut ajouter l'usager régulier au groupe shutdown. + gpasswd -a ${REGUSER} shutdown +} -- 2.20.1