[systemd-devel] [PATCH] sysv-generator: only allow regular files in enumerate_sysv()

Colin Guthrie gmane at colin.guthr.ie
Wed Jan 14 04:21:30 PST 2015

Cristian Rodríguez wrote on 14/01/15 05:51:
> Otherwise, if the directory contains other directories we fail
> at fopen in load_sysv() with EISDIR.

> -                        if (hidden_file(de->d_name))
> -                                continue;

Why are hidden files now processed? I'd still suggest you want to skip
files ending in ~ at very least, but I don't think any files beginning
with a . should be processed either.

> +                        dirent_ensure_type(d, de);

Should the return value be checked here? It's quite unlikely I know, so
maybe not.

> +
> +                        if (!dirent_is_file(de))
> +                            continue;

If I read the dirent_ensure_type and dirent_is_file code properly, this
would mean that symlinks to valid sysvinit scripts are now skipped.

Is this intended? I'd say someone will complain about that with some
kind of wierd setup (e.g. a symlink to some custom init script in /opt
or similar).



Colin Guthrie

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

More information about the systemd-devel mailing list