FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 05-09-2011, 07:39 AM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

Hello everybody,
I'm writing this mail to gather comments about a serious bug I received some
time ago, for which I haven't yet had time to make a proper fix. The bug is
#612918, against wicd, "Uses /etc/wicd/wireless-settings.conf as state file".

My opinion is that wireless networks with some kind of configuration provided
(say, a key, or a DNS server, or some static IP, [..]), should be saved there
(so the bug really is: «don't uselessly save all the networks you encounter»
-- and I already have a fix for that).

The reporter's opinion is that no GUI should ever write to /etc/.

However, WICD clients are run from privileged users, i.e. those in the `netdev'
group, and are added there by root. So I think that's perfectly fine.

I took a look at how NetworkManager handles that: it stores configuration using
gconf, so it's not really comparable. I'd like to stick with files under /etc/,
possibly.

What's your opinion on this?
I haven't searched thoroughly through the archive, but I guess there are other
UIs run by privileged non-root users that write to /etc/?

Didier, I hope I correctly summarised the bug you reported. If not, please
reply

Thanks for your suggestions,
David

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 
Old 05-09-2011, 07:40 AM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 9 May 2011 09:39:07 +0200, David Paleino wrote:

> ...

Gah, I clicked "Reply" instead of "Compose". Sorry everybody.

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 
Old 05-09-2011, 09:12 AM
Adam Borowski
 
Default Writing to /etc/ from a "privileged" UI

On Mon, May 09, 2011 at 09:39:07AM +0200, David Paleino wrote:
> Hello everybody,
> I'm writing this mail to gather comments about a serious bug I received some
> time ago, for which I haven't yet had time to make a proper fix. The bug is
> #612918, against wicd, "Uses /etc/wicd/wireless-settings.conf as state file".
>
> My opinion is that wireless networks with some kind of configuration provided
> (say, a key, or a DNS server, or some static IP, [..]), should be saved there
> (so the bug really is: «don't uselessly save all the networks you encounter»
> -- and I already have a fix for that).
>
> The reporter's opinion is that no GUI should ever write to /etc/.
>
> However, WICD clients are run from privileged users, i.e. those in the `netdev'
> group, and are added there by root. So I think that's perfectly fine.
>
> I took a look at how NetworkManager handles that: it stores configuration using
> gconf, so it's not really comparable. I'd like to stick with files under /etc/,
> possibly.
>
> What's your opinion on this?
> I haven't searched thoroughly through the archive, but I guess there are other
> UIs run by privileged non-root users that write to /etc/?

/etc may include only _static_ configuration. What you have is variable
state which belongs in /var. It's no different from a database, or dpkg's
status data.

--
1KB // Microsoft corollary to Hanlon's razor:
// Never attribute to stupidity what can be
// adequately explained by malice.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110509091253.GA7470@angband.pl">http://lists.debian.org/20110509091253.GA7470@angband.pl
 
Old 05-09-2011, 09:20 AM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 9 May 2011 11:12:53 +0200, Adam Borowski wrote:

> /etc may include only _static_ configuration. What you have is variable
> state which belongs in /var. It's no different from a database, or dpkg's
> status data.

Static IPs, DNS servers and WEP/WPA keys for a given wireless network are
"variable state"? Sorry, I disagree.

I already said that I have a patch not to save networks for which no
configuration is made -- which is the "variable state" thing at the moment. The
question was different

David

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 
Old 05-09-2011, 09:21 AM
Simon McVittie
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 09 May 2011 at 09:39:07 +0200, David Paleino wrote:
> I took a look at how NetworkManager handles that: it stores configuration using
> gconf, so it's not really comparable

NM can go either way - it'll use the current user's gconf for connections
that are not "shared with other users", which is the default, or flat files
in /etc for connections that are shared.

I seem to remember newer NM versions (in experimental) have changed the
default to be the other way round, on the basis that network connections are
system-wide, so their configuration should be system-wide too.

S


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110509092121.GB28527@reptile.pseudorandom.co.uk" >http://lists.debian.org/20110509092121.GB28527@reptile.pseudorandom.co.uk
 
Old 05-09-2011, 09:29 AM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 9 May 2011 10:21:21 +0100, Simon McVittie wrote:

> On Mon, 09 May 2011 at 09:39:07 +0200, David Paleino wrote:
> > I took a look at how NetworkManager handles that: it stores configuration
> > using gconf, so it's not really comparable
>
> NM can go either way - it'll use the current user's gconf for connections
> that are not "shared with other users", which is the default, or flat files
> in /etc for connections that are shared.
>
> I seem to remember newer NM versions (in experimental) have changed the
> default to be the other way round, on the basis that network connections are
> system-wide, so their configuration should be system-wide too.

That's what I tend to think as well.
In the bugreport, I first thought about per-user configuration (something like
~/.config/wicd/...), but then I realised that it's non-sense, since network
connections are system-wide AFAIK.

David

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 
Old 05-09-2011, 09:55 AM
Jan Hauke Rahm
 
Default Writing to /etc/ from a "privileged" UI

On Mon, May 09, 2011 at 09:39:07AM +0200, David Paleino wrote:
> Hello everybody,
> I'm writing this mail to gather comments about a serious bug I received some
> time ago, for which I haven't yet had time to make a proper fix. The bug is
> #612918, against wicd, "Uses /etc/wicd/wireless-settings.conf as state file".
>
> My opinion is that wireless networks with some kind of configuration provided
> (say, a key, or a DNS server, or some static IP, [..]), should be saved there
> (so the bug really is: «don't uselessly save all the networks you encounter»
> -- and I already have a fix for that).
>
> The reporter's opinion is that no GUI should ever write to /etc/.
>
> However, WICD clients are run from privileged users, i.e. those in the `netdev'
> group, and are added there by root. So I think that's perfectly fine.

Aside from privileges wicd needs or has to write in /etc, how does it
handle read-only / (including /etc)? Does it fall back to /var?

Hauke

--
.'`. Jan Hauke Rahm <jhr@debian.org> www.jhr-online.de
: :' : Debian Developer www.debian.org
`. `'` Member of the Linux Foundation www.linux.com
`- Fellow of the Free Software Foundation Europe www.fsfe.org
 
Old 05-09-2011, 10:05 AM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 9 May 2011 11:55:39 +0200, Jan Hauke Rahm wrote:

> Aside from privileges wicd needs or has to write in /etc, how does it
> handle read-only / (including /etc)? Does it fall back to /var?

No.

I haven't tried, but it should be able to connect without a writable /(etc)
(it already uses /var/lib/wicd/ to store runtime config): network configuration
will "just" be lost on wicd-daemon shutdown. Still, I'll need to confirm this
(maybe it'll throw an exception when trying to write the config files), and
eventually fix it to support at least this behaviour.

Is there some document I should be reading?

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 
Old 05-09-2011, 01:45 PM
Marvin Renich
 
Default Writing to /etc/ from a "privileged" UI

* David Paleino <dapal@debian.org> [110509 04:19]:
> On Mon, 9 May 2011 11:12:53 +0200, Adam Borowski wrote:
>
> > /etc may include only _static_ configuration. What you have is variable
> > state which belongs in /var. It's no different from a database, or dpkg's
> > status data.
>
> Static IPs, DNS servers and WEP/WPA keys for a given wireless network are
> "variable state"? Sorry, I disagree.
>
> I already said that I have a patch not to save networks for which no
> configuration is made -- which is the "variable state" thing at the moment. The
> question was different

This isn't about whether the data saved in the config file is variable,
it is about whether the config file is variable. Files in /etc should
only be modified when the sysadmin is doing what (s)he considers to be
"configuration", not when a user is running a program.

The specific data shown in the bug report is clearly variable "state"
information and not static configuration info, but even adding and
removing more permanent wireless access point info should not be done in
/etc during the normal, continuous operation of a daemon.

If I were designing the config structure, since each AP is a distinct
entity that doesn't depend on any other AP (maybe that should be essid,
not AP), I would have a .d directory where each essid had its own config
file. There could be corresponding /etc/wicd/something.d and
/var/lib/wicd/something.d directories. The admin could place files in
/etc that he didn't want users messing with. Non-conflicting files in
/etc, /var/lib, and ~user/.wicd (or better, ~user/.config/wicd), would
be treated equally by wicd, with preference to ~user/.config/wicd then
/var/lib/wicd, then /etc/wicd for any conflicting entries.

Actually, one normal user should not be able to override the admin
defaults for another user, so if there is already an entry in /etc, wicd
should place any user change to that entry in ~user, but new,
non-conflicting entries should go in /var/lib. Then, the order of
preference should be ~user, /etc, /var/lib.

Transient state information, like signal strength and quality should
_not_ go in these files, but rather in /var/run/wicd/ (soon to be
/run/wicd/).

...Marvin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110509134541.GB633@cleo.wdw">http://lists.debian.org/20110509134541.GB633@cleo.wdw
 
Old 05-09-2011, 02:59 PM
David Paleino
 
Default Writing to /etc/ from a "privileged" UI

On Mon, 9 May 2011 09:45:41 -0400, Marvin Renich wrote:

> * David Paleino <dapal@debian.org> [110509 04:19]:
> > On Mon, 9 May 2011 11:12:53 +0200, Adam Borowski wrote:
> >
> > > /etc may include only _static_ configuration. What you have is variable
> > > state which belongs in /var. It's no different from a database, or dpkg's
> > > status data.
> >
> > Static IPs, DNS servers and WEP/WPA keys for a given wireless network are
> > "variable state"? Sorry, I disagree.
> >
> > I already said that I have a patch not to save networks for which no
> > configuration is made -- which is the "variable state" thing at the moment.
> > The question was different
>
> This isn't about whether the data saved in the config file is variable,
> it is about whether the config file is variable. Files in /etc should
> only be modified when the sysadmin is doing what (s)he considers to be
> "configuration", not when a user is running a program.

So the CUPS web interface, and GNOME/KDE settings UIs, and such other things are
all RC-buggy, because the info under /etc/ was not edited using
vim/nano/emacs/... but through a UI?

I repeat myself: users capable of running a wicd ui are enabled by root, by
adding them to a specific system group (`netdev').

> The specific data shown in the bug report is clearly variable "state"
> information and not static configuration info, [..]

Again, I disagree.
BSSID, ESSID, encryption key, "automatic connection"-flag all sound like
configuration to me. Granted, there are more things to purge (channel and mode,
for example), but that's a bug with a different solution than "move everything
to /var/".

> but even adding and removing more permanent wireless access point info should
> not be done in /etc during the normal, continuous operation of a daemon.

Why not? It works.

> If I were designing the config structure, since each AP is a distinct
> entity that doesn't depend on any other AP (maybe that should be essid,
> not AP), I would have a .d directory where each essid had its own config
> file. There could be corresponding /etc/wicd/something.d and
> /var/lib/wicd/something.d directories. The admin could place files in
> /etc that he didn't want users messing with. Non-conflicting files in
> /etc, /var/lib, and ~user/.wicd (or better, ~user/.config/wicd), would
> be treated equally by wicd, with preference to ~user/.config/wicd then
> /var/lib/wicd, then /etc/wicd for any conflicting entries.
>
> Actually, one normal user should not be able to override the admin
> defaults for another user, so if there is already an entry in /etc, wicd
> should place any user change to that entry in ~user, but new,
> non-conflicting entries should go in /var/lib. Then, the order of
> preference should be ~user, /etc, /var/lib.

I can't understand all this. Network connections are system-wide by their own
nature -- or do you know cases where there could be different concurrent
connections used by different users?

> Transient state information, like signal strength and quality should
> _not_ go in these files, but rather in /var/run/wicd/ (soon to be
> /run/wicd/).

I probably haven't been clear enough. That's not configuration, and they
shouldn't go in any config file. And that's already fixed.

http://git.debian.org/?p=collab-maint/wicd.git;a=blob;f=debian/patches/34-dont_save_useless_config.patch

There I drop 'quality', 'strength', 'bitrates' and 'has_profile' from the
configuration file. As stated before in this mail, that list could include
'mode' and 'channel', but I prefer to be careful, since those are passed to
iwconfig.

Kindly,
David

--
. '`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
 

Thread Tools




All times are GMT. The time now is 07:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org