tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ATF as nonprivilegied user

On Wed, Nov 14, 2012 at 10:10:27AM +0100, Martin Husemann wrote:
> Where is that?

In not yet committed testcase.

>     t_spawnattr: [0.000165s] Skipped: Requires root privileges

We are not talking about the same issue: you run as unprivilegied a
test that need root privileges. I want to run as root a test that
seteuid to an unprivilegied user.

But I found a workaround:

#define SU_ATF_REQUIRE(x) do {  \
        seteuid(0);             \
        setegid(0);             \
        ATF_REQUIRE(x);         \
} while (0 /* CONSTCOND */);

And once it runs unprivilegied, it uses SU_ATF_REQUIRE instead of ATF_REQUIRE.

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index