Skip to content

Commit

Permalink
rtc: allow validated RTC_PIE_ON for non-root
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan Kadzban authored and Linus Torvalds committed Oct 16, 2007
1 parent 06c65eb commit 9d013d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
break;

case RTC_PIE_ON:
if (!capable(CAP_SYS_RESOURCE))
if (rtc->irq_freq > rtc->max_user_freq &&
!capable(CAP_SYS_RESOURCE))
return -EACCES;
break;
}
Expand Down

0 comments on commit 9d013d3

Please sign in to comment.