From: Felix Zielcke <fzielcke@z-51.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: chmod of generated grub.cfg
Date: Sun, 06 Sep 2009 16:58:40 +0200 [thread overview]
Message-ID: <1252249120.3895.53.camel@fz.local> (raw)
In-Reply-To: <20090906135742.GJ13423@riva.ucam.org>
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
Am Sonntag, den 06.09.2009, 14:57 +0100 schrieb Colin Watson:
> On Sun, Sep 06, 2009 at 03:43:46PM +0200, Felix Zielcke wrote:
> > Am Sonntag, den 06.09.2009, 14:38 +0100 schrieb Colin Watson:
> > > I think it'd be more sensible to do this in grub-mkconfig itself - it
> > > doesn't really fit well into the /etc/grub.d/ hook system, which is
> > > really just for generating output.
> >
> > You mean we check with grep if there's a password line in the generated
> > config and then just use chmod 400 instead of 444?
> > Sounds good.
>
> Yeah, that kind of thing.
>
Ok here's now a patch.
Robert do you think this can go into 1.97?
--
Felix Zielcke
Proud Debian Maintainer
[-- Attachment #2: chmod.diff --]
[-- Type: text/x-patch, Size: 804 bytes --]
2009-09-06 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkconfig.in: Make generated config file mode 400 if
it contains a password and print a warning if it fails.
Index: util/grub-mkconfig.in
===================================================================
--- util/grub-mkconfig.in (revision 2574)
+++ util/grub-mkconfig.in (working copy)
@@ -260,6 +260,11 @@ for i in ${grub_mkconfig_dir}/* ; do
esac
done
+if [ "x${grub_cfg}" != "x" ] && grep -q "^password " ${grub_cfg}.new ; then
+ chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\
+ This means your password is readable by everyone"
+fi
+
if test "x${grub_cfg}" != "x" ; then
# none of the children aborted with error, install the new grub.cfg
mv -f ${grub_cfg}.new ${grub_cfg}
next prev parent reply other threads:[~2009-09-06 14:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-06 12:29 chmod of generated grub.cfg Felix Zielcke
2009-09-06 13:38 ` Colin Watson
2009-09-06 13:43 ` Felix Zielcke
2009-09-06 13:57 ` Colin Watson
2009-09-06 14:58 ` Felix Zielcke [this message]
2009-09-06 15:09 ` Robert Millan
2009-09-06 15:17 ` Felix Zielcke
2009-09-06 19:32 ` Robert Millan
2009-09-06 15:01 ` Robert Millan
2009-09-06 17:22 ` Vladimir 'phcoder' Serbinenko
2009-09-07 1:21 ` richardvoigt
2009-09-07 9:06 ` Felix Zielcke
2009-09-08 14:48 ` Robert Millan
2009-09-08 14:51 ` Felix Zielcke
2009-09-10 18:56 ` Robert Millan
2009-09-10 19:04 ` Felix Zielcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1252249120.3895.53.camel@fz.local \
--to=fzielcke@z-51.de \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.