Re: [PATCH] syslog: check cap_syslog when dmesg_restrict
From: Serge E. Hallyn
Date: Wed Dec 08 2010 - 11:41:55 EST
Quoting Eric Paris (eparis@xxxxxxxxxx):
> On Wed, 2010-12-08 at 15:19 +0000, Serge E. Hallyn wrote:
> Doesn't this return -EPERM right now?
Yes.
> I think the code might be
> incorrect today as well......
>
> I thought the flow was supposed to be
>
> if (capable(CAP_SYSLOG))
> all good
> else if (capable(CAP_SYS_ADMIN))
> WARN, but still good for now
I prefer warn and deny. Otherwise it's too easy to ignore warnings. So
I prefer the msg to be there to explain why it failed - not that I expect
it to fail for anyone today.
> else
> EPERM
>
> But it looks to me like the flow is
>
> if (capable(CAP_SYSLOG))
> all good
> else if (capable(CAP_SYS_ADMIN))
> WARN, EPERM
> else
> EPERM
>
> > }
Yup.
-serge
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/