Re: systemd CAP_DAC_READ_SEARCH

Christian Perle <[email protected]>
Newsgroups gmane.user-groups.linux.dresden
Organization Silmor
Message-ID <[email protected]>
Hallo Liste,

nach ein paar Bier und etwas Rumpro"bier"en hat sich folgendes
rausgestellt:

Obwohl der Splunk-Prozess die korrekte Capability in den entsprechenden
Sets hat, gibt es den Fehler, weil er *vor* dem eigentlich open()
auf die Datei ein access() respektive faccessat() darauf loslaesst.

Die Capability CAP_DAC_READ_SEARCH erlaubt zwar open()/openat()
auf eine sonst nicht lesbare Datei, aber die access()-Familie liefert
einen Fehler. Ob das jetzt inkonsistentes Verhalten des Kernels
ist, sei mal dahingestellt.

Simples Testprogramm, schlaegt trotz CAP_DAC_READ_SEARCH fehl:

---------------------------------------------------------------------
#define _POSIX_C_SOURCE 200809L

#include <stdio.h>
#include <unistd.h>

int main()
{
        int ret;

        ret = access("/var/log/kern.log", R_OK);

        if (-1 == ret) {
                perror("access");
                return 1;
        }

        return 0;
}
---------------------------------------------------------------------

Gruss,
  Christian
-- 
Christian Perle                                    chris AT linuxinfotag.de
010111                                              http://chris.silmor.de/
101010                          LinuxGuitarKitesBicyclesBeerPizzaRaytracing
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.