diff options
author | Mark Bellon <mbellon@mvista.com> | 2006-04-11 01:54:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:43 -0400 |
commit | 31cc48bfeef7a021d6e29f3454a4505edcfd6daa (patch) | |
tree | d2059a46e39ce4582fbf93483892ffef4ff6dd6d /drivers/char | |
parent | 14a6283eb5c1c70e6deee985c85dcce884150737 (diff) |
[PATCH] MPBL0010 driver sysfs permissions wide open
The MPBL0010 Telco clock driver (drivers/char/tlclk.c) uses 0222 (anyone
can write) permissions on its writable sysfs entries. Alter the
permissions to 0220 (owner and group can write).
The use case for this driver is to configure the fail over behavior of the
clock hardware. That should be done by the more privileged users.
Signed-off-by: Mark Bellon <mbellon@mvista.com>
Acked-by: "Gross, Mark" <mark.gross@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tlclk.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 2546637a55c0..f58ad7f68267 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c | |||
@@ -327,7 +327,7 @@ static ssize_t store_received_ref_clk3a(struct device *d, | |||
327 | return strnlen(buf, count); | 327 | return strnlen(buf, count); |
328 | } | 328 | } |
329 | 329 | ||
330 | static DEVICE_ATTR(received_ref_clk3a, S_IWUGO, NULL, | 330 | static DEVICE_ATTR(received_ref_clk3a, (S_IWUSR|S_IWGRP), NULL, |
331 | store_received_ref_clk3a); | 331 | store_received_ref_clk3a); |
332 | 332 | ||
333 | 333 | ||
@@ -349,7 +349,7 @@ static ssize_t store_received_ref_clk3b(struct device *d, | |||
349 | return strnlen(buf, count); | 349 | return strnlen(buf, count); |
350 | } | 350 | } |
351 | 351 | ||
352 | static DEVICE_ATTR(received_ref_clk3b, S_IWUGO, NULL, | 352 | static DEVICE_ATTR(received_ref_clk3b, (S_IWUSR|S_IWGRP), NULL, |
353 | store_received_ref_clk3b); | 353 | store_received_ref_clk3b); |
354 | 354 | ||
355 | 355 | ||
@@ -371,7 +371,7 @@ static ssize_t store_enable_clk3b_output(struct device *d, | |||
371 | return strnlen(buf, count); | 371 | return strnlen(buf, count); |
372 | } | 372 | } |
373 | 373 | ||
374 | static DEVICE_ATTR(enable_clk3b_output, S_IWUGO, NULL, | 374 | static DEVICE_ATTR(enable_clk3b_output, (S_IWUSR|S_IWGRP), NULL, |
375 | store_enable_clk3b_output); | 375 | store_enable_clk3b_output); |
376 | 376 | ||
377 | static ssize_t store_enable_clk3a_output(struct device *d, | 377 | static ssize_t store_enable_clk3a_output(struct device *d, |
@@ -392,7 +392,7 @@ static ssize_t store_enable_clk3a_output(struct device *d, | |||
392 | return strnlen(buf, count); | 392 | return strnlen(buf, count); |
393 | } | 393 | } |
394 | 394 | ||
395 | static DEVICE_ATTR(enable_clk3a_output, S_IWUGO, NULL, | 395 | static DEVICE_ATTR(enable_clk3a_output, (S_IWUSR|S_IWGRP), NULL, |
396 | store_enable_clk3a_output); | 396 | store_enable_clk3a_output); |
397 | 397 | ||
398 | static ssize_t store_enable_clkb1_output(struct device *d, | 398 | static ssize_t store_enable_clkb1_output(struct device *d, |
@@ -413,7 +413,7 @@ static ssize_t store_enable_clkb1_output(struct device *d, | |||
413 | return strnlen(buf, count); | 413 | return strnlen(buf, count); |
414 | } | 414 | } |
415 | 415 | ||
416 | static DEVICE_ATTR(enable_clkb1_output, S_IWUGO, NULL, | 416 | static DEVICE_ATTR(enable_clkb1_output, (S_IWUSR|S_IWGRP), NULL, |
417 | store_enable_clkb1_output); | 417 | store_enable_clkb1_output); |
418 | 418 | ||
419 | 419 | ||
@@ -435,7 +435,7 @@ static ssize_t store_enable_clka1_output(struct device *d, | |||
435 | return strnlen(buf, count); | 435 | return strnlen(buf, count); |
436 | } | 436 | } |
437 | 437 | ||
438 | static DEVICE_ATTR(enable_clka1_output, S_IWUGO, NULL, | 438 | static DEVICE_ATTR(enable_clka1_output, (S_IWUSR|S_IWGRP), NULL, |
439 | store_enable_clka1_output); | 439 | store_enable_clka1_output); |
440 | 440 | ||
441 | static ssize_t store_enable_clkb0_output(struct device *d, | 441 | static ssize_t store_enable_clkb0_output(struct device *d, |
@@ -456,7 +456,7 @@ static ssize_t store_enable_clkb0_output(struct device *d, | |||
456 | return strnlen(buf, count); | 456 | return strnlen(buf, count); |
457 | } | 457 | } |
458 | 458 | ||
459 | static DEVICE_ATTR(enable_clkb0_output, S_IWUGO, NULL, | 459 | static DEVICE_ATTR(enable_clkb0_output, (S_IWUSR|S_IWGRP), NULL, |
460 | store_enable_clkb0_output); | 460 | store_enable_clkb0_output); |
461 | 461 | ||
462 | static ssize_t store_enable_clka0_output(struct device *d, | 462 | static ssize_t store_enable_clka0_output(struct device *d, |
@@ -477,7 +477,7 @@ static ssize_t store_enable_clka0_output(struct device *d, | |||
477 | return strnlen(buf, count); | 477 | return strnlen(buf, count); |
478 | } | 478 | } |
479 | 479 | ||
480 | static DEVICE_ATTR(enable_clka0_output, S_IWUGO, NULL, | 480 | static DEVICE_ATTR(enable_clka0_output, (S_IWUSR|S_IWGRP), NULL, |
481 | store_enable_clka0_output); | 481 | store_enable_clka0_output); |
482 | 482 | ||
483 | static ssize_t store_select_amcb2_transmit_clock(struct device *d, | 483 | static ssize_t store_select_amcb2_transmit_clock(struct device *d, |
@@ -519,7 +519,7 @@ static ssize_t store_select_amcb2_transmit_clock(struct device *d, | |||
519 | return strnlen(buf, count); | 519 | return strnlen(buf, count); |
520 | } | 520 | } |
521 | 521 | ||
522 | static DEVICE_ATTR(select_amcb2_transmit_clock, S_IWUGO, NULL, | 522 | static DEVICE_ATTR(select_amcb2_transmit_clock, (S_IWUSR|S_IWGRP), NULL, |
523 | store_select_amcb2_transmit_clock); | 523 | store_select_amcb2_transmit_clock); |
524 | 524 | ||
525 | static ssize_t store_select_amcb1_transmit_clock(struct device *d, | 525 | static ssize_t store_select_amcb1_transmit_clock(struct device *d, |
@@ -560,7 +560,7 @@ static ssize_t store_select_amcb1_transmit_clock(struct device *d, | |||
560 | return strnlen(buf, count); | 560 | return strnlen(buf, count); |
561 | } | 561 | } |
562 | 562 | ||
563 | static DEVICE_ATTR(select_amcb1_transmit_clock, S_IWUGO, NULL, | 563 | static DEVICE_ATTR(select_amcb1_transmit_clock, (S_IWUSR|S_IWGRP), NULL, |
564 | store_select_amcb1_transmit_clock); | 564 | store_select_amcb1_transmit_clock); |
565 | 565 | ||
566 | static ssize_t store_select_redundant_clock(struct device *d, | 566 | static ssize_t store_select_redundant_clock(struct device *d, |
@@ -581,7 +581,7 @@ static ssize_t store_select_redundant_clock(struct device *d, | |||
581 | return strnlen(buf, count); | 581 | return strnlen(buf, count); |
582 | } | 582 | } |
583 | 583 | ||
584 | static DEVICE_ATTR(select_redundant_clock, S_IWUGO, NULL, | 584 | static DEVICE_ATTR(select_redundant_clock, (S_IWUSR|S_IWGRP), NULL, |
585 | store_select_redundant_clock); | 585 | store_select_redundant_clock); |
586 | 586 | ||
587 | static ssize_t store_select_ref_frequency(struct device *d, | 587 | static ssize_t store_select_ref_frequency(struct device *d, |
@@ -602,7 +602,7 @@ static ssize_t store_select_ref_frequency(struct device *d, | |||
602 | return strnlen(buf, count); | 602 | return strnlen(buf, count); |
603 | } | 603 | } |
604 | 604 | ||
605 | static DEVICE_ATTR(select_ref_frequency, S_IWUGO, NULL, | 605 | static DEVICE_ATTR(select_ref_frequency, (S_IWUSR|S_IWGRP), NULL, |
606 | store_select_ref_frequency); | 606 | store_select_ref_frequency); |
607 | 607 | ||
608 | static ssize_t store_filter_select(struct device *d, | 608 | static ssize_t store_filter_select(struct device *d, |
@@ -623,7 +623,7 @@ static ssize_t store_filter_select(struct device *d, | |||
623 | return strnlen(buf, count); | 623 | return strnlen(buf, count); |
624 | } | 624 | } |
625 | 625 | ||
626 | static DEVICE_ATTR(filter_select, S_IWUGO, NULL, store_filter_select); | 626 | static DEVICE_ATTR(filter_select, (S_IWUSR|S_IWGRP), NULL, store_filter_select); |
627 | 627 | ||
628 | static ssize_t store_hardware_switching_mode(struct device *d, | 628 | static ssize_t store_hardware_switching_mode(struct device *d, |
629 | struct device_attribute *attr, const char *buf, size_t count) | 629 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -643,7 +643,7 @@ static ssize_t store_hardware_switching_mode(struct device *d, | |||
643 | return strnlen(buf, count); | 643 | return strnlen(buf, count); |
644 | } | 644 | } |
645 | 645 | ||
646 | static DEVICE_ATTR(hardware_switching_mode, S_IWUGO, NULL, | 646 | static DEVICE_ATTR(hardware_switching_mode, (S_IWUSR|S_IWGRP), NULL, |
647 | store_hardware_switching_mode); | 647 | store_hardware_switching_mode); |
648 | 648 | ||
649 | static ssize_t store_hardware_switching(struct device *d, | 649 | static ssize_t store_hardware_switching(struct device *d, |
@@ -664,7 +664,7 @@ static ssize_t store_hardware_switching(struct device *d, | |||
664 | return strnlen(buf, count); | 664 | return strnlen(buf, count); |
665 | } | 665 | } |
666 | 666 | ||
667 | static DEVICE_ATTR(hardware_switching, S_IWUGO, NULL, | 667 | static DEVICE_ATTR(hardware_switching, (S_IWUSR|S_IWGRP), NULL, |
668 | store_hardware_switching); | 668 | store_hardware_switching); |
669 | 669 | ||
670 | static ssize_t store_refalign (struct device *d, | 670 | static ssize_t store_refalign (struct device *d, |
@@ -684,7 +684,7 @@ static ssize_t store_refalign (struct device *d, | |||
684 | return strnlen(buf, count); | 684 | return strnlen(buf, count); |
685 | } | 685 | } |
686 | 686 | ||
687 | static DEVICE_ATTR(refalign, S_IWUGO, NULL, store_refalign); | 687 | static DEVICE_ATTR(refalign, (S_IWUSR|S_IWGRP), NULL, store_refalign); |
688 | 688 | ||
689 | static ssize_t store_mode_select (struct device *d, | 689 | static ssize_t store_mode_select (struct device *d, |
690 | struct device_attribute *attr, const char *buf, size_t count) | 690 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -704,7 +704,7 @@ static ssize_t store_mode_select (struct device *d, | |||
704 | return strnlen(buf, count); | 704 | return strnlen(buf, count); |
705 | } | 705 | } |
706 | 706 | ||
707 | static DEVICE_ATTR(mode_select, S_IWUGO, NULL, store_mode_select); | 707 | static DEVICE_ATTR(mode_select, (S_IWUSR|S_IWGRP), NULL, store_mode_select); |
708 | 708 | ||
709 | static ssize_t store_reset (struct device *d, | 709 | static ssize_t store_reset (struct device *d, |
710 | struct device_attribute *attr, const char *buf, size_t count) | 710 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -724,7 +724,7 @@ static ssize_t store_reset (struct device *d, | |||
724 | return strnlen(buf, count); | 724 | return strnlen(buf, count); |
725 | } | 725 | } |
726 | 726 | ||
727 | static DEVICE_ATTR(reset, S_IWUGO, NULL, store_reset); | 727 | static DEVICE_ATTR(reset, (S_IWUSR|S_IWGRP), NULL, store_reset); |
728 | 728 | ||
729 | static struct attribute *tlclk_sysfs_entries[] = { | 729 | static struct attribute *tlclk_sysfs_entries[] = { |
730 | &dev_attr_current_ref.attr, | 730 | &dev_attr_current_ref.attr, |