diff options
author | Bryan Kadzban <bryan@kadzban.is-a-geek.net> | 2007-10-16 04:28:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:13 -0400 |
commit | 9d013d3b14f4c81bdfe6c81fc506037d60007036 (patch) | |
tree | c85405897df18b5dae8530a45586811913136716 /drivers/rtc/rtc-dev.c | |
parent | 06c65eb45578c52d1bc69d044239646d4c90e7ea (diff) |
rtc: allow validated RTC_PIE_ON for non-root
drivers/char/rtc.c allowed RTC_PIE_ON ioctls for non-root users, as long as
the current interval (set via RTC_IRQP_SET) is <= max_user_freq. Allow
RTC_PIE_ON under the same conditions when /dev/rtc* is handled by the rtc
subsystem.
Signed-off-by: Bryan Kadzban <bryan@kdzbn.homelinux.net>
Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 87d4add6b7f6..814583bd2fe7 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -233,7 +233,8 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, | |||
233 | break; | 233 | break; |
234 | 234 | ||
235 | case RTC_PIE_ON: | 235 | case RTC_PIE_ON: |
236 | if (!capable(CAP_SYS_RESOURCE)) | 236 | if (rtc->irq_freq > rtc->max_user_freq && |
237 | !capable(CAP_SYS_RESOURCE)) | ||
237 | return -EACCES; | 238 | return -EACCES; |
238 | break; | 239 | break; |
239 | } | 240 | } |