Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114507 - qmail-queue gets permission denied on libc.so.6
Summary: qmail-queue gets permission denied on libc.so.6
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Qmail Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 115496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-05 00:09 UTC by Henti Smith
Modified: 2006-02-06 14:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henti Smith 2005-12-05 00:09:16 UTC
When trying to use qmail I keep getting permission denied on qmail-queue
accessing libc.so.6. the error follows : 

bin/qmail-queue: error while loading shared libraries: libc.so.6: cannot open
shared object file: Permission denied
qmail-inject: fatal: qq temporary problem (#4.3.0)

This was wierd since I had libc.so.6 in /lib and it's listed in ldconfig. After
playing some and using strace I found this problem: 

open("/usr/lib/libc.so.6", O_RDONLY)    = -1 EACCES (Permission denied)
stat64("/usr/lib", 0xbfc6c00c)          = -1 EACCES (Permission denied)
writev(2, [{"bin/qmail-queue", 15}, {": ", 2}, {"error while loading shared
libra"..., 36}, {": ", 2}, {"libc.so.6", 9}, {": ", 2}, {"cannot open shared
object file", 30}, {": ", 2}, {"Permission denied", 17}, {"
\n", 1}], 10) = 116

As you can see qmail-queue tries to use /usr/lib/libc.so.6 instead of
/lib/libc.so.6 

not sure how to fix this ... since it seems like qmail-queue doens't have access
to anything in /usr/lib and I don't wanna make massive changes to permissions. 

This is a brand new installed machine. 

Reproducible: Always
Steps to Reproduce:
1. echo "test" | mail -s test user@domain
2.
3.



Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2,
2.6.12-gentoo-r6 i686)
=================================================================
System uname: 2.6.12-gentoo-r6 i686 Intel(R) Celeron(R) CPU 2.40GHz
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X acl alsa apache2 apm arts authdaemond avi berkdb bitmap-fonts bzip2
crypt cups curl eds emboss encode expat foomaticdb fortran gd gdbm gif gnome gpm
gstreamer gtk gtk2 imap imlib jpeg kde ldap libg++ libwww mad maildir mhash
mikmod motif mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pcre pdflib
perl png python qt quicktime readline samba sdl spell ssl tcpd tiff truetype
truetype-fonts type1-fonts udev valias vhosts vorbis xml2 xmms xv zlib
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 SpanKY gentoo-dev 2005-12-05 05:57:19 UTC
you should not have a /usr/lib/libc.so.6 file ... do you ?
Comment 2 Henti Smith 2005-12-05 06:42:50 UTC
no I don't .. 

libc.so.6 is in /lib only. 

still doens't explain why qmail-queue is looking for it in /usr/lib :) 

H
Comment 3 SpanKY gentoo-dev 2005-12-05 06:46:33 UTC
because /usr/lib is a standard search path to be used before /lib

what does `ls -ld /usr/lib*` show ?
Comment 4 Henti Smith 2005-12-06 04:42:23 UTC
/usr/lib is not in  /etc/ld.so.conf

ls -ld /usr/lib* returns 

drwxr-xr-x  31 root root 20016 Dec  5 11:57 /usr/lib
drwxr-xr-x   4 root root   128 Dec  4 23:36 /usr/libexec
Comment 5 SpanKY gentoo-dev 2005-12-06 06:20:34 UTC
it doesnt matter if /usr/lib is in ld.so.conf, it's hard coded into
the toolchain as is /lib

something is funky with your machine considering qmail cant even
stat /usr/lib without getting an EACCES error

you could try running fsck on the drive, or running `sudo -u qmails stat /usr/lib`
Comment 6 Henti Smith 2005-12-06 09:33:45 UTC
fsck checks out fine .. as for the sudo command : 

bin/qmail-queue: error while loading shared libraries: libc.so.6: cannot open
shared object file: Permission denied
qmail-inject: fatal: qq temporary problem (#4.3.0)

If this helps .. I installed using 2005.1 binary .... was there not a permission
problem on the stages if I recall ? 

I'll check .. 
Comment 7 SpanKY gentoo-dev 2005-12-06 10:07:57 UTC
umm, what you posted was not the sudo command i asked you to run ...
Comment 8 Henti Smith 2005-12-06 10:20:31 UTC
mail / # sudo -u qmails stat /usr/lib
sudo: can't open /etc/sudoers: Permission denied
mail / # bin/qmail-queue: error while loading shared libraries: libc.so.6:
cannot open shared object file: Permission denied
qmail-inject: fatal: qq temporary problem (#4.3.0)

*smile* 

it seems very much a permission issue ... but as I stated .. I didn't change ay
permissions .. 
Comment 9 SpanKY gentoo-dev 2005-12-06 10:23:26 UTC
try `su qmails -c "stat /usr/lib"` then
Comment 10 Henti Smith 2005-12-06 10:31:41 UTC
su: Authentication service cannot retrieve authentication info.
(Ignored)

P.S. I'm on freenode if it makes things easer 
Comment 11 SpanKY gentoo-dev 2005-12-14 05:47:39 UTC
*** Bug 115496 has been marked as a duplicate of this bug. ***
Comment 12 SpanKY gentoo-dev 2005-12-14 05:48:07 UTC
what is the permissions on your / and /usr directories ?  post the output of:
ls -ld / /usr
Comment 13 Henti Smith 2005-12-14 05:56:08 UTC
unfortunately I've had to move on and reinstalled with latest iso and stage
files ... 

works fine now .. 
Comment 14 daniel petre 2005-12-14 06:02:43 UTC
(In reply to comment #12)
> what is the permissions on your / and /usr directories ?  post the output of:
> ls -ld / /usr

delfix contrib # ls -ld / /usr
drwxr-xr-x  19 root root 4096 Dec 13 21:12 /
drwxr-xr-x  13 root root 4096 Dec 13 03:39 /usr
Comment 15 Henti Smith 2005-12-14 06:28:19 UTC
Sorry .. Id on't use qmail-scanner .. so can't comment on that .. 
Comment 16 Daniel Beckham 2006-01-02 08:42:13 UTC
This is a real legit issue. I'm having the same problem and it seems much larger than a qmail issue.

(In reply to comment #7)
> umm, what you posted was not the sudo command i asked you to run ...
> 

He did post the output of the command.  Sudo complains that it does not have permission to open the /etc/sudoers file, logs that to syslog and then attemps to send an email to root about the "issue".  What you are seeing is the same qmail error when the mail is being sent.


(In reply to comment #10)
> su: Authentication service cannot retrieve authentication info.
> (Ignored)
> 
> P.S. I'm on freenode if it makes things easer 

Qmail system users, by default, have /bin/false set as their shell.  Trying "usermod -s /bin/bash qmails" will temporarily enable the user to execute shell commands.  The output of those commands on my broken system are:

# su qmails -c "stat /usr/lib"
su: Authentication service cannot retrieve authentication info.
(Ignored)
  File: `/usr/lib'
  Size: 17896           Blocks: 35         IO Block: 131072 directory
Device: 803h/2051d      Inode: 4779        Links: 27
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2005-12-14 10:33:59.000000000 -0500
Modify: 2006-01-02 11:30:16.000000000 -0500
Change: 2006-01-02 11:30:16.000000000 -0500

# su qmails -c "stat /lib/libc.so.6"
su: Authentication service cannot retrieve authentication info.
(Ignored)
  File: `/lib/libc.so.6' -> `libc-2.3.5.so'
  Size: 13              Blocks: 0          IO Block: 131072 symbolic link
Device: 803h/2051d      Inode: 494         Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2006-01-02 11:12:51.000000000 -0500
Modify: 2006-01-02 11:12:51.000000000 -0500
Change: 2006-01-02 11:12:51.000000000 -0500

(In reply to comment #12)
> what is the permissions on your / and /usr directories ?  post the output of:
> ls -ld / /usr

The output of this command on my broken system:
# ls -ld / /usr
d-wxr----t  21 root root 568 Jan  2 03:10 /
drwxr-xr-x  13 root root 392 Dec 14 09:29 /usr

Something is wrong with glibc.
Comment 17 SpanKY gentoo-dev 2006-01-02 10:50:40 UTC
*nothing* is wrong with glibc

as your `ls` output showed, your permissions on / are screwed up, fix them
Comment 18 Daniel Beckham 2006-01-02 12:14:58 UTC
(In reply to comment #17)
> *nothing* is wrong with glibc
> 
> as your `ls` output showed, your permissions on / are screwed up, fix them
> 

This seems to have been the issue.  Thank you for your help.  

It's often very easy for the spirit of an online conversation to be misunderstood due to the medium, but frankly, you sounded like an jerk about this.  Yes, this has definitely nothing to do with glibc, but I do not go around futzing with my / directory permissions and as far as I know, there is no reason why the / directory's permissions should be any different than what they were in the 2005.1 stage3 tarball.  In addition, it would be helpful to others having this same problem, if you would recommend the proper set of permissions for the / directory.  I set mine to 0755 after checking the perms on a few of my other  boxes.

Comment 19 SpanKY gentoo-dev 2006-01-02 12:24:33 UTC
well, no stage should have / set like yours, so if it is, we need to get that fixed real fast ;)

as for the reason why you cant do that, it's a matter of basic unix permissions ... every directory in a path must be readable in order to get at the final file ... since the path is '/usr/lib/libc.so.6' and the first directory '/' is not readable by qmail, then the kernel (rightly) denies access
Comment 20 Henti Smith 2006-01-04 07:23:55 UTC
this is definatily my stage3. I installed another machine using it .. and I'm having the same problem .. with qmail-queue and other related tools .. 

how do I need to set permissions to fix this ? 
Comment 21 SpanKY gentoo-dev 2006-01-04 07:33:23 UTC
what stage tarball did you use ? (full file name)
Comment 22 Henti Smith 2006-01-04 07:40:10 UTC
stage3-pentium4-2005.1.tar.bz2
Comment 23 SpanKY gentoo-dev 2006-01-04 07:53:58 UTC
that tarball has correct permissions
Comment 24 Henti Smith 2006-01-04 08:02:26 UTC
d-wxr----t  21 root root   512 Jan  4 17:08 .
d-wxr----t  21 root root   512 Jan  4 17:08 ..
drwx------   2 root root    48 Jan  3 14:48 .reiserfs_priv
-rw-------   1 root root  1024 Jan  4 18:00 .rnd
drwxr-xr-x   2 root root  3632 Jan  4 17:07 bin
drwxr-xr-x   4 root root  1024 Jan  3 17:26 boot
drwxr-xr-x  21 root root 29720 Jan  3 17:38 dev
drwxr-xr-x  46 root root  3304 Jan  4 17:07 etc
drwxr-xr-x   2 root root    72 Jul 26 17:11 home
drwxr-xr-x   8 root root  3696 Jan  3 17:26 lib
drwxr-xr-x   5 root root   104 Jan  3 18:10 local
drwxr-xr-x   4 root root   120 Jul 26 17:11 mnt
drwxr-xr-x   2 root root    72 Jul 26 17:11 opt
drwxr-xr-x  94 root root     0 Jan  3 17:38 proc
drwxr-xr-x   4 root root   288 Jan  4 17:30 root
drwxr-xr-x   2 root root  3536 Jan  3 18:25 sbin
drwxr-xr-x   2 root root   168 Jan  3 18:37 service
drwxr-xr-x  10 root root     0 Jan  3 17:38 sys
drwxr-xr-x   6 root root   184 Jan  4 17:08 tmp
drwxr-xr-x  13 root root   392 Jan  3 14:51 usr
drwxr-xr-x  15 root root   408 Jan  3 20:02 var


permissions currently on machine .. as per change suggested on this forum .. 

I don't know what else to do ... I cannot get this working .. 
Comment 25 SpanKY gentoo-dev 2006-01-04 08:41:56 UTC
i dont know what you mean by "this forum" but if you're referring to this bug report, *no one* suggested you change your / permissions like that

in fact, we've said here you should be doing `chmod 0755 /`
Comment 26 Henti Smith 2006-01-04 08:43:19 UTC
"if you would recommend the proper set of
permissions for the / directory.  I set mine to 0755 after checking the perms
on a few of my other  boxes." 

thats what I did ;P 

anyway .. I've grabbed a new stage file .. and busy reinstalling .. 
Comment 27 SpanKY gentoo-dev 2006-02-06 14:07:52 UTC
should be all set now

if you can find something that is changing / perms on you, please report it