Question about profile.d scripts definition in Spec file

Michael Schwendt mschwendt at gmail.com
Sun Aug 2 21:15:53 UTC 2015


On Sun, 2 Aug 2015 16:29:06 +0200, Marcin Haba wrote:

> >> A) if a shell script can be treated as configuration file?
> > 
> > Certainly. It's a cheap way to set a program's runtime configuration
> > instead of implementing a full config file loader/parser.
> 
> My image of configuration files is that they are files for read/write
> purpose by design, because they enables _configure_ something
> (application, service, single program, script...whatever). If they are
> dedicated only for reading then from my point of view they lose
> "configuration" meaning (something like WORM storage ;-) ).

Why would you say that?

There are read-only config files to set the system-wide default for
everyone. The program reads them first before looking for user's local
config files to override the defaults. The program would never write
the system-wide file file in /etc, but at most the user's local file.

And in general, whether a program can write its own config files is purely
a question of design. Clearly, over the years there have been programs that
only read config files somebody [or some tool] can create.

/etc/bashrc, /etc/profile are examples of %config files where the file
format is shell language code to be interpreted by a shell.

> >> B) does in rpmlint aspect non-executable mean 'without execute
> >> permissions' or 'non-executable at all' (directly and by any interpreter) ?
> > 
> > It refers to the exec permission bit. Executables files in /etc being
> > marked as %config would be another mistake.
> 
> If rpmlint refers 'non-executable' only to the exec permission, what I
> believe takes place, and the contents of the file that matter for
> determine 'executable/non-executable' type, it means that rpmlint search
> 'executable' property not there where it should search.
> 
> Partially I understand this searching for executable files because it
> might be difficult clearly qualify some file to some specific type of
> files basing on a file content or just interpreter definition.
> 
> However I believe that exist some tools or libraries that can do this
> content analyze for rpmlint.

What would be the benefit?  rpmlint cannot get it 100% right
anyway. There could be corner-cases, where a config file gets executed
instead of being "sourced" like a shell include file.

> > It's some sort of white-list to assume that files in /etc meant to be
> > executed (such as initscripts related files) are not configuration
> > files in any way. Admin may decide to edit such executables nevertheless
> > (for reasons unknown), but the next update would overwrite the changes.
> 
> Good to know that mentioned white-list exists. Could you indicate me
> where can I find this white-list?

With "some sort of white-list" I mean the simplification -- the
simplified assumption -- that files with execute permission are
believed to be executables and not configuration files. And vice
versa. Real configuration files being marked executable are believed
to be mistakes.


More information about the devel mailing list