Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] non-root users cant use network


Wasnt too sure what to check when it came to locales.

echo ${LANG} returned blank so I set LANG=en_AU.iso88591

didnt make any difference to wget or what strace shows when running wget.

but interestingly i ran strace with ifconfig and that shows a few
interesting bits. not quite sure what it means at this stage.


<SNIP>
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/locale/en_AU.iso88591/LC_IDENTIFICATION", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_AU/LC_IDENTIFICATION", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/lib/locale/en.iso88591/LC_IDENTIFICATION", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_IDENTIFICATION", O_RDONLY) = -1 ENOENT (No
such file or directory)
uname({sys="Linux", node="netbook", ...}) = 0
access("/proc/net", R_OK)               = 0
access("/proc/net/unix", R_OK)          = 0
socket(PF_FILE, SOCK_DGRAM, 0)          = 3
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = -1 EACCES (Permission denied)
access("/proc/net/if_inet6", R_OK)      = -1 ENOENT (No such file or directory)
access("/proc/net/ax25", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/nr", R_OK)            = -1 ENOENT (No such file or directory)
access("/proc/net/rose", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/ipx", R_OK)           = -1 ENOENT (No such file or directory)
access("/proc/net/appletalk", R_OK)     = -1 ENOENT (No such file or directory)
access("/proc/sys/net/econet", R_OK)    = -1 ENOENT (No such file or directory)
access("/proc/sys/net/ash", R_OK)       = -1 ENOENT (No such file or directory)
access("/proc/net/x25", R_OK)           = -1 ENOENT (No such file or directory)
open("/proc/net/dev", O_RDONLY)         = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40020000
read(4, "Inter-|   Receive               "..., 1024) = 692
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0x40020000, 4096)                = 0
write(2, "warning: no inet socket availabl"..., 61) = 61
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = -1 EACCES (Permission denied)
access("/proc/net/if_inet6", R_OK)      = -1 ENOENT (No such file or directory)
access("/proc/net/ax25", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/nr", R_OK)            = -1 ENOENT (No such file or directory)
access("/proc/net/rose", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/ipx", R_OK)           = -1 ENOENT (No such file or directory)
access("/proc/net/appletalk", R_OK)     = -1 ENOENT (No such file or directory)
access("/proc/sys/net/econet", R_OK)    = -1 ENOENT (No such file or directory)
access("/proc/sys/net/ash", R_OK)       = -1 ENOENT (No such file or directory)
access("/proc/net/x25", R_OK)           = -1 ENOENT (No such file or directory)
ioctl(3, SIOCGIFCONF, {64, {{"lo", {AF_INET, inet_addr("127.0.0.1")}},
{"eth2", {AF_INET, inet_addr("10.42.43.55")}}}}) = 0
</SNIP>

The bit of particular interest to me is that the last line shows the
ip address of the interfaces lo and eth2 and yet outside of strace
this appears to be the only piece of information ifconfig doesnt
display to regular users.


and this is strace of ifconfig run as root

unlike the strace run as the regular user this strace didnt show any
lines like the first 6 above relating to locale files.

<SNIP>
uname({sys="Linux", node="netbook", ...}) = 0
access("/proc/net", R_OK)               = 0
access("/proc/net/unix", R_OK)          = 0
socket(PF_FILE, SOCK_DGRAM, 0)          = 3
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
access("/proc/net/if_inet6", R_OK)      = -1 ENOENT (No such file or directory)
access("/proc/net/ax25", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/nr", R_OK)            = -1 ENOENT (No such file or directory)
access("/proc/net/rose", R_OK)          = -1 ENOENT (No such file or directory)
access("/proc/net/ipx", R_OK)           = -1 ENOENT (No such file or directory)
access("/proc/net/appletalk", R_OK)     = -1 ENOENT (No such file or directory)
access("/proc/sys/net/econet", R_OK)    = -1 ENOENT (No such file or directory)
access("/proc/sys/net/ash", R_OK)       = -1 ENOENT (No such file or directory)
access("/proc/net/x25", R_OK)           = -1 ENOENT (No such file or directory)
open("/proc/net/dev", O_RDONLY)         = 5
fstat64(5, {st_mode=S_IFREG|0777, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40020000
read(5, "Inter-|   Receive               "..., 1024) = 692
read(5, "", 1024)                       = 0
close(5)                                = 0
munmap(0x40020000, 4096)                = 0
ioctl(4, SIOCGIFCONF, {64, {{"lo", {AF_INET, inet_addr("127.0.0.1")}},
{"eth2", {AF_INET, inet_addr("10.42.43.55")}}}}) = 0
</SNIP>

so i does kinda look like a locale problem i guess.

On Mon, Aug 29, 2011 at 9:17 PM, Mark Walkom <markwalkom@xxxxxxxxx> wrote:
> Here's my strace, I just cut the parts around where you highlighted to save
> on the wall of text;
> stat64("/home/mark/.netrc", 0xbff3cb44) = -1 ENOENT (No such file or
> directory)
> socket(PF_NETLINK, SOCK_RAW, 0)         = 3
> bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
> getsockname(3, {sa_family=AF_NETLINK, pid=3489, groups=00000000}, [12]) = 0
> time(NULL)                              = 1314616478
> sendto(3, "\24\0\0\0\26\0\1\3\236t[N\0\0\0\0\0\0\0\0", 20, 0,
> {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
> recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000},
> msg_iov(1)=[{"0\0\0\0\24\0\2\0\236t[N\241\r\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"...,
> 4096}], msg_controllen=0, msg_flags=0}, 0) = 160
> recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000},
> msg_iov(1)=[{"@\0\0\0\24\0\2\0\236t[N\241\r\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"...,
> 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
> recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000},
> msg_iov(1)=[{"\24\0\0\0\3\0\2\0\236t[N\241\r\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"...,
> 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
> close(3)                                = 0
> open("/usr/share/locale/en_AU.utf8/LC_MESSAGES/wget.mo", O_RDONLY) = -1
> ENOENT (No such file or directory)
> open("/usr/share/locale/en_AU/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/share/locale/en.utf8/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/share/locale/en/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/share/locale-langpack/en_AU.utf8/LC_MESSAGES/wget.mo", O_RDONLY)
> = -1 ENOENT (No such file or directory)
> open("/usr/share/locale-langpack/en_AU/LC_MESSAGES/wget.mo", O_RDONLY) = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=15587, ...}) = 0
> mmap2(NULL, 15587, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb745f000
> close(3)                                = 0
> open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/wget.mo", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/share/locale-langpack/en/LC_MESSAGES/wget.mo", O_RDONLY) = -1
> ENOENT (No such file or directory)
> write(2, "Connecting to 127.0.0.1:80... ", 30Connecting to 127.0.0.1:80... )
> = 30
>
> Maybe check your locales?
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>



-- 
Kind Regards,

Christopher Barnes
Microsoft Certified Systems Engineer
Microsoft Certified IT Professional

e. chris.p.barnes@xxxxxxxxx