You are not logged in.

#1 2016-01-17 00:38:18

loki
Member
Registered: 2015-12-26
Posts: 34

/proc/net/wireless Doesn't display entries as standard user [solved]

So I'm setting up i3blocks and one of the scripts I am using requires information taken from /proc/net/wireless, but I cannot get any information from it as a standard user. However when I run as root I get results from all wireless interfaces that are up.
Example code:

 $ cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22

# cat /proc/net/wirelss
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   61. -49. -256       0      0      0      0      0       0

Last edited by loki (2016-01-26 16:41:13)


*Ironic fork bomb*
        sad){ neutral:& };:

Offline

#2 2016-01-17 02:12:28

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

Check permission of the file with ls -l

ls -l /proc/net/wireless

It should be something like below, third 'r' is read permission for user

-r--r--r-- 1 root root 0 Jan 17 07:37 /proc/net/wireless

if not, you can add that with below command, (ideally this permission should be default but anyway..)

sudo chmod o+r /proc/net/wireless

EDIT: I misunderstood, as I re-read your question, you can cat /proc* but it doesn't show your interface. Just ignore my reply.

sure you can use 'sudo chmod u+s /proc/net/wireless' but that would be a dirty fix., If it fix!

Last edited by Docbroke (2016-01-18 02:37:25)

Offline

#3 2016-01-26 16:40:57

loki
Member
Registered: 2015-12-26
Posts: 34

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

I never did find an actual fix, but I did find a workaround.  I made the script that was calling this line call the line as root and then added that script to my sudo file so that no password is needed.


*Ironic fork bomb*
        sad){ neutral:& };:

Offline

#4 2016-01-26 16:43:32

loki
Member
Registered: 2015-12-26
Posts: 34

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

Docbroke wrote:

sure you can use 'sudo chmod u+s /proc/net/wireless' but that would be a dirty fix., If it fix!

That actually won't work as the permissions get reset with every reboot because the file is generated in runtime.


*Ironic fork bomb*
        sad){ neutral:& };:

Offline

#5 2016-01-27 02:36:14

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

yes, missed that, actually I had similar problem for i3status getting status for ppp*.pid (when called from netctl) but it worked with wvdial which creates user readable ppp*.pid file

Offline

#6 2016-01-27 03:20:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,576
Website

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

I was wondering if /proc/net/wireless might be limited to certain groups that your user might lack.  To test, I ran `sudo -u nobody cat /proc/net/wireless` and it still showed up fine for me.  This suggests that anybody should be able to cat the contents (ironic isn't it: "nobody" can cat the file, therefore anybody can cat the file).

But I also realized this same test might determine if there is some other setting of your user that is interfering.  Does cat'ing the contents as 'nobody' work?

Also, are other files in /proc/net similarly limited - try /proc/net/igmp and/or /proc/net/igmp6 for example.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2016-01-27 03:46:52

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

@Trilby, kindly look this link, is it similar issue?

https://bbs.archlinux.org/viewtopic.php?id=207054

Offline

#8 2016-01-27 03:49:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,576
Website

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

No it doesn't seem similar to me.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2016-01-27 07:03:49

loki
Member
Registered: 2015-12-26
Posts: 34

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

So I tried both of the other /proc/net files and they both put out the same wether I was root, myself or a member of nobody but when trying to cat /proc/net/wireless as a member of nobody I still get the empty return.

I believe that this may be because of something with the drivers as I had to remove the ones provided by default and install boadcom-wl-dkms. I have no reason to believe this, and it could be entirely not even close, that's just the only thing I can think of that is different on my system compared to a majority of systems regaurding the wireless.


*Ironic fork bomb*
        sad){ neutral:& };:

Offline

#10 2016-01-27 12:44:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,576
Website

Re: /proc/net/wireless Doesn't display entries as standard user [solved]

Actually I was suspicious of driver-related issues, and -wl makes that more likely.

I don't know enough about how the drivers nor /proc/net/wireless works, but -wl is quite often a driver-of-last resort that will often help poorly supported cards connect, but have lots of odd side effects.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB