wget can resolve addresses only when executed as super user

Bug #630717 reported by Rohit R
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wget (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: wget

strace -eopen wget www.google.com
returns this

1.when not su :

open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/i686/cmov/libssl.so.0.9.8", O_RDONLY) = 3
open("/lib/i686/cmov/libcrypto.so.0.9.8", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/librt.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
open("/lib/libz.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libpthread.so.0", O_RDONLY) = 3
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) = 3
open("/usr/lib/locale/en_IN/LC_IDENTIFICATION", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MEASUREMENT", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TELEPHONE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_ADDRESS", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NAME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_PAPER", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MONETARY", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_COLLATE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TIME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NUMERIC", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_CTYPE", O_RDONLY) = 3
open("/etc/wgetrc", O_RDONLY|O_LARGEFILE) = 3
open("/home/rohit/.wgetrc", O_RDONLY|O_LARGEFILE) = 3
open("/etc/localtime", O_RDONLY) = 3
--2010-09-05 13:32:20-- http://www.google.com/
open("/usr/share/locale/en_IN/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_IN/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)
Resolving www.google.com... open("/etc/nsswitch.conf", O_RDONLY) = 3
open("/etc/host.conf", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_files.so.2", O_RDONLY) = 3
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_mdns4_minimal.so.2", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_dns.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libresolv.so.2", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_mdns4.so.2", O_RDONLY) = 3
open("/etc/mdns.allow", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_IN/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_IN/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
failed: Name or service not known.
wget: unable to resolve host address `www.google.com'

2.when su :

open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/i686/cmov/libssl.so.0.9.8", O_RDONLY) = 3
open("/lib/i686/cmov/libcrypto.so.0.9.8", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/librt.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
open("/lib/libz.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libpthread.so.0", O_RDONLY) = 3
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) = 3
open("/usr/lib/locale/en_IN/LC_IDENTIFICATION", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MEASUREMENT", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TELEPHONE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_ADDRESS", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NAME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_PAPER", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MONETARY", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_COLLATE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TIME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NUMERIC", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_CTYPE", O_RDONLY) = 3
open("/etc/wgetrc", O_RDONLY|O_LARGEFILE) = 3
open("/home/rohit/.wgetrc", O_RDONLY|O_LARGEFILE) = 3
open("/etc/localtime", O_RDONLY) = 3
--2010-09-05 13:32:20-- http://www.google.com/
open("/usr/share/locale/en_IN/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_IN/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)
Resolving www.google.com... open("/etc/nsswitch.conf", O_RDONLY) = 3
open("/etc/host.conf", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_files.so.2", O_RDONLY) = 3
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_mdns4_minimal.so.2", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_dns.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libresolv.so.2", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_mdns4.so.2", O_RDONLY) = 3
open("/etc/mdns.allow", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_IN/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_IN/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
failed: Name or service not known.
wget: unable to resolve host address `www.google.com'
rohit@rohit-laptop:~$ clear

rohit@rohit-laptop:~$ sudo su
[sudo] password for rohit:
root@rohit-laptop:/home/rohit# strace -eopen wget www.google.com
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/i686/cmov/libssl.so.0.9.8", O_RDONLY) = 3
open("/lib/i686/cmov/libcrypto.so.0.9.8", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/librt.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
open("/lib/libz.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libpthread.so.0", O_RDONLY) = 3
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) = 3
open("/usr/lib/locale/en_IN/LC_IDENTIFICATION", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MEASUREMENT", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TELEPHONE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_ADDRESS", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NAME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_PAPER", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_MONETARY", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_COLLATE", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_TIME", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_NUMERIC", O_RDONLY) = 3
open("/usr/lib/locale/en_IN/LC_CTYPE", O_RDONLY) = 3
open("/etc/wgetrc", O_RDONLY|O_LARGEFILE) = 3
open("/etc/localtime", O_RDONLY) = 3
--2010-09-05 13:34:32-- http://www.google.com/
open("/usr/share/locale/en_IN/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_IN/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)
Connecting to 10.3.100.211:8080... connected.
Proxy request sent, awaiting response... 302 Found
open("/usr/lib/locale/en_IN\347!/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_IN\347!/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
Location: http://www.google.co.in/ [following]
--2010-09-05 13:34:33-- http://www.google.co.in/
Connecting to 10.3.100.211:8080... connected.
Proxy request sent, awaiting response... 200 OK
open("/usr/lib/locale/C\2604/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/C\2604/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
Length: unspecified [text/html]
open("index.html", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0666) = 4
Saving to: `index.html'

open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 5
    [ <=> ] 9,964 --.-K/s in 0s

2010-09-05 13:34:35 (20.8 MB/s) - `index.html' saved [9964]
ls -la /etc/resolv.conf returned

-rw-r--r-- 1 root root 30 2010-09-05 13:07 /etc/resolv.conf

ls -la /etc/nsswitch.conf returns
-rw-r--r-- 1 root root 513 2010-08-16 15:19 /etc/nsswitch.conf

lsb_release -rd returns

Description: Ubuntu 10.04.1 LTS
Release: 10.04

apt-cache policy wget returns

wget:
  Installed: 1.12-1.1ubuntu2
  Candidate: 1.12-1.1ubuntu2.1
  Version table:
     1.12-1.1ubuntu2.1 0
        500 http://in.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
 *** 1.12-1.1ubuntu2 0
        500 http://in.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

Rohit R (rr0hit)
Changed in wget (Ubuntu):
status: New → Confirmed
Revision history for this message
Mechanical snail (replicator-snail) wrote :

(1) wget has always worked for me. I'm setting it to unconfirmed until someone else can reproduce the problem.
(2) Try upgrading wget; the latest version in Ubuntu Lucid is 1.12-1.1ubuntu2.1
(3) Do you have a firewall set up? It might be blocking requests from un-privileged users.

Changed in wget (Ubuntu):
status: Confirmed → New
Revision history for this message
Rohit R (rr0hit) wrote :

>> i tried the same after executing "ufw disable" but still i could not run wget without administrative privilages.
     So i assume there is no firewall set up blocking my request.

>> I have tried the same from other ubuntu installations and could reproduce the problem.

Revision history for this message
Rohit R (rr0hit) wrote :

The problem was due to some environment variable mix up...worked fine after reinstallation.

Changed in wget (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.