All of lore.kernel.org
 help / color / mirror / Atom feed
* /sys/ file access
@ 2013-07-12  8:55 kernel kernel
  2013-07-15  9:34 ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: kernel kernel @ 2013-07-12  8:55 UTC (permalink / raw)
  To: cpufreq

I wish to read the file "/sys/devices/system/cpu/cpu0/cpufreq" as an
unprivileged user. The default permissions on this file are:

-r-------- 1 root root

What is the rationale behind this? All other files in this directory
are world readable.

Best Regards,

Ken

--
Ken O'Brien
PhD Researcher
Simulation Science and Extreme Events Cluster,
3B1, UCD CASL,
8 Belfield Business Park,
Dublin 4,
Ireland.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /sys/ file access
  2013-07-12  8:55 /sys/ file access kernel kernel
@ 2013-07-15  9:34 ` Viresh Kumar
  2013-07-16 22:14   ` kernel kernel
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2013-07-15  9:34 UTC (permalink / raw)
  To: kernel kernel; +Cc: cpufreq

On Fri, Jul 12, 2013 at 2:25 PM, kernel kernel <kernel@kenobrien.org> wrote:
> I wish to read the file "/sys/devices/system/cpu/cpu0/cpufreq" as an
> unprivileged user. The default permissions on this file are:
>
> -r-------- 1 root root
>
> What is the rationale behind this? All other files in this directory
> are world readable.

Permissions as shown on my Thinkpad with ubuntu 12.04

viresh@blr-linut-001:$ ll /sys/devices/system/cpu/cpu0/
drwxr-xr-x 3 root root    0 Jul 11 17:53 cpufreq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /sys/ file access
  2013-07-15  9:34 ` Viresh Kumar
@ 2013-07-16 22:14   ` kernel kernel
  2013-07-17  4:49     ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: kernel kernel @ 2013-07-16 22:14 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: cpufreq

Apologies,

I gave the wrong filename. I'm attempting to read

-r-------- 1 root root 4096 Jul 16 21:03 cpuinfo_cur_freq

as an unprivileged user. Why is this not world readable by default?

Best Regards,

Ken

On Mon, Jul 15, 2013 at 10:34 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On Fri, Jul 12, 2013 at 2:25 PM, kernel kernel <kernel@kenobrien.org> wrote:
>> I wish to read the file "/sys/devices/system/cpu/cpu0/cpufreq" as an
>> unprivileged user. The default permissions on this file are:
>>
>> -r-------- 1 root root
>>
>> What is the rationale behind this? All other files in this directory
>> are world readable.
>
> Permissions as shown on my Thinkpad with ubuntu 12.04
>
> viresh@blr-linut-001:$ ll /sys/devices/system/cpu/cpu0/
> drwxr-xr-x 3 root root    0 Jul 11 17:53 cpufreq/



-- 
Ken O'Brien
PhD Researcher
Simulation Science and Extreme Events Cluster,
3B1, UCD CASL,
8 Belfield Business Park,
Dublin 4,
Ireland.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /sys/ file access
  2013-07-16 22:14   ` kernel kernel
@ 2013-07-17  4:49     ` Viresh Kumar
  2013-07-17 10:35       ` kernel kernel
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2013-07-17  4:49 UTC (permalink / raw)
  To: kernel kernel; +Cc: cpufreq

On 17 July 2013 03:44, kernel kernel <kernel@kenobrien.org> wrote:
> Apologies,
>
> I gave the wrong filename. I'm attempting to read
>
> -r-------- 1 root root 4096 Jul 16 21:03 cpuinfo_cur_freq
>
> as an unprivileged user. Why is this not world readable by default?

This one actually reads the values directly from the hardware underneath
and so doesn't have permissions for everyone to do it.

Whereas /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq gets
the value which cpufreq core believes is currently set and so is readable
by everybody.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /sys/ file access
  2013-07-17  4:49     ` Viresh Kumar
@ 2013-07-17 10:35       ` kernel kernel
  0 siblings, 0 replies; 5+ messages in thread
From: kernel kernel @ 2013-07-17 10:35 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: cpufreq

Thank you very much. This solves my issue.

On Wed, Jul 17, 2013 at 5:49 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 17 July 2013 03:44, kernel kernel <kernel@kenobrien.org> wrote:
>> Apologies,
>>
>> I gave the wrong filename. I'm attempting to read
>>
>> -r-------- 1 root root 4096 Jul 16 21:03 cpuinfo_cur_freq
>>
>> as an unprivileged user. Why is this not world readable by default?
>
> This one actually reads the values directly from the hardware underneath
> and so doesn't have permissions for everyone to do it.
>
> Whereas /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq gets
> the value which cpufreq core believes is currently set and so is readable
> by everybody.



-- 
Ken O'Brien
PhD Researcher
Simulation Science and Extreme Events Cluster,
3B1, UCD CASL,
8 Belfield Business Park,
Dublin 4,
Ireland.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-17 10:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12  8:55 /sys/ file access kernel kernel
2013-07-15  9:34 ` Viresh Kumar
2013-07-16 22:14   ` kernel kernel
2013-07-17  4:49     ` Viresh Kumar
2013-07-17 10:35       ` kernel kernel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.