X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=security%2Fcommoncap.c;h=04b80f9912bfc3357f1c4b51dd8877ca345df3cc;hb=99efb9369c54fa98fc354a9ad4bc8c59f3212ff4;hp=5e632b4857e443d8031eaa17c0e2bd7e877b3d14;hpb=8b66a16f25f819bb1f132f075c5c01a288776cf8;p=net-next-2.6.git diff --git a/security/commoncap.c b/security/commoncap.c index 5e632b4857e..04b80f9912b 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -895,6 +895,8 @@ int cap_syslog(int type, bool from_file) { if (type != SYSLOG_ACTION_OPEN && from_file) return 0; + if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) + return -EPERM; if ((type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER) && !capable(CAP_SYS_ADMIN)) return -EPERM;