All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/quagga: Fix directories and permissions
Date: Thu, 12 May 2016 08:58:09 +0200	[thread overview]
Message-ID: <20160512085809.5615a161@free-electrons.com> (raw)
In-Reply-To: <5733E878.4090700@gmail.com>

Hello,

On Thu, 12 May 2016 10:20:40 +0800, Nathaniel Roach wrote:

> If you're using vtysh to configure Quagga, yes, it absolutely needs 
> write permissions to the config folder, as it's more than likely you'd 
> want to save your config. (Running commands in vtysh is very similar to 
> Cisco routers, there's a "running-config" and a "startup-config" - 
> commands are saved into running, but are not copied into startup by default)
> 
> The daemons themselves don't write to /etc unless you tell it to:
> 
> $sudo vtysh
> ...
> charon# copy run start
> Building Configuration...
> Configuration saved to /etc/quagga/zebra.conf
> Configuration saved to /etc/quagga/ospfd.conf
> [OK]
> 
> It needs write permissions to the folder as it moves the old config and 
> writes a new one, rather than just overwriting.
> 
> In the instance that /etc/ is RO, the user simply won't be able to save 
> an updated configuration.

Right, makes sense. Then, perhaps you want to add a comment on top of
QUAGGA_CONF_OPTS to indicate why we override localstatedir and
sysconfdir. Just something like:

# Override localstatedir and sysconfdir so that quagga has its own
# directories, which is will access with its own user.

or something along those lines (I'm sure a better wording is possible).

> >> +define QUAGGA_PERMISSIONS
> >> +	/etc/quagga r 600 quagga quagga - - - - -
> >> +	/etc/quagga d 755 quagga quagga - - - - -  
> > Hum, does this actually work?  
> Yup, unfortunately wildcards don't, and I didn't feel that adding a line 
> for each daemon was appropriate. (There's one for each daemon, and it's 
> only installed if that daemon is selected, hence why I need to 
> effectively do a wildcard chmod here)

So you need the first line to make every file in /etc/quagga owned by
quagga, 600, and then the second line to make the /etc/quagga directory
owned by the quagga user and 755, so that quagga can create more files
in this directory, right?

> >> +define QUAGGA_INSTALL_INIT_SYSTEMD
> >> +	mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d  
> > This mkdir -p is useless, as $(INSTALL) -D creates all sub-directories
> > needed to be able to copy to the destination path.  
> Huh, thanks! I believe I copied this from somewhere else, but I'll take 
> it out in the next revision.

If you've seen it somewhere, try to remember where so that we can fix
this place as well :-)

So overall, looks good. Just fix the very minor nits that I mentioned,
and it's good to go.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2016-05-12  6:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  8:01 [Buildroot] [PATCH 1/1] package/quagga: Fix directories and permissions Nathaniel Roach
2016-05-11 21:33 ` Thomas Petazzoni
2016-05-12  2:20   ` Nathaniel Roach
2016-05-12  6:58     ` Thomas Petazzoni [this message]
2016-05-12  7:01       ` Nathaniel Roach

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=20160512085809.5615a161@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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.