[Postfixbuch-users] Postfix: "Unkown User" trotz Eintrag

André Gerritzen senekha at gmx.de
Do Sep 7 13:53:24 CEST 2006


> > > Also irgendwie sieht alles so aus, als ob der User nicht gefunden
wird.
> > >
> > > Hmm, habe mal ein kleines Test-Script gemacht.
>> > >
> > > ----------------- getpwnam.c ------------------------------
> > > #include <stdio.h>
> > > #include <stdlib.h>
> > > #include <pwd.h>
> > >
> > > int main(int argc, char *argv[])
> > > {
> > >    struct passwd *pwd;
> > >
> > >    if ( argc > 1) {
> > >        if ( NULL != ( pwd = getpwnam(argv[1]))) {
> > >           printf("%s: Gefunden.\n", argv[1]);
> > >        }
> > >        else {
> > >             printf("%s: Nicht gefunden.\n", argv[1]);
> > >         }
> > >    }
> > > }
> > > -----------------------------------------------------------
> > >
> > > $ gcc -o getpwnam getpwnam.c
> > > # su postfix -s /bin/sh -c './getpwnam andre.gerritzen'
> > >
> > > Würde mich mal interessieren. Vielleicht bin ich ja auch auf dem
falschen
> > > Pfad.
> >
> > Das Script gibt ein klares
> > "andre.gerritzen: Nicht gefunden."
>> aus!

> Das dachte ich mir. Das dürfte das "unknown user" in Postfix erklären.

> Führ es mal als root aus. Evtl. stimmt mit den Zugriffsrechten auf die
passwd,
> nsswitch.conf, /lib/security,... oder so was nicht.

# su root -s /bin/sh -c './getpwnam andre.gerritzen'
andre.gerritzen: Gefunden.

Jetzt habe ich die passwd von 0600 auf 0644 geändert und es funktioniert.
Die Mail kommt durch.
Mit der Lösung bin ich aber nicht ganz zufrieden, da die passwd nicht ohne
Grund auf 0600 steht.

> Ansonsten mal ein strace davor stellen und schauen ob er bis zur passwd
kommt.

> # strace -eopen su postfix -s /bin/sh -c './getpwnam andre.gerritzen'

open("/usr/local/pgsql/lib/tls/i686/sse2/libcrypt.so.1", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/local/pgsql/lib/tls/i686/libcrypt.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/local/pgsql/lib/tls/sse2/libcrypt.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/local/pgsql/lib/tls/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/local/pgsql/lib/i686/sse2/libcrypt.so.1", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/local/pgsql/lib/i686/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/local/pgsql/lib/sse2/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/local/pgsql/lib/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
open("/lib/libpam.so.0", O_RDONLY)      = 3
open("/lib/libpam_misc.so.0", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY)       = 3
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
open("/etc/nsswitch.conf", O_RDONLY)    = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libnss_compat.so.2", O_RDONLY) = 3
open("/lib/libnsl.so.1", O_RDONLY)      = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libnss_nis.so.2", O_RDONLY)  = 3
open("/lib/libnss_files.so.2", O_RDONLY) = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/etc/pam.d/su", O_RDONLY|O_LARGEFILE) = 3
open("/lib/security/pam_rootok.so", O_RDONLY) = 4
open("/etc/pam.d/common-auth", O_RDONLY|O_LARGEFILE) = 4
open("/lib/security/pam_env.so", O_RDONLY) = 5
open("/lib/security/pam_unix2.so", O_RDONLY) = 5
open("/etc/ld.so.cache", O_RDONLY)      = 5
open("/lib/libxcrypt.so.1", O_RDONLY)   = 5
open("/lib/libselinux.so.1", O_RDONLY)  = 5
open("/proc/mounts", O_RDONLY|O_LARGEFILE) = 5
open("/etc/pam.d/common-account", O_RDONLY|O_LARGEFILE) = 4
open("/etc/pam.d/common-password", O_RDONLY|O_LARGEFILE) = 4
open("/lib/security/pam_pwcheck.so", O_RDONLY) = 5
open("/etc/ld.so.cache", O_RDONLY)      = 5
open("/usr/lib/libcrack.so.2", O_RDONLY) = 5
open("/etc/pam.d/common-session", O_RDONLY|O_LARGEFILE) = 4
open("/lib/security/pam_limits.so", O_RDONLY) = 5
open("/lib/security/pam_xauth.so", O_RDONLY) = 4
open("/etc/pam.d/other", O_RDONLY|O_LARGEFILE) = 3
open("/lib/security/pam_warn.so", O_RDONLY) = 4
open("/lib/security/pam_deny.so", O_RDONLY) = 4
open("/var/run/utmp", O_RDWR)           = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/etc/security/pam_unix2.conf", O_RDONLY) = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/etc/shadow", O_RDONLY)           = -1 ENOENT (No such file or
directory)
open("/var/run/utmp", O_RDWR)           = 3
open("/etc/localtime", O_RDONLY)        = 3
open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 3
open("/etc/group", O_RDONLY)            = 3
open("/etc/passwd", O_RDONLY)           = 3
open("//etc/security/limits.conf", O_RDONLY|O_LARGEFILE) = 3
open("/etc/security/pam_unix2.conf", O_RDONLY) = 3
andre.gerritzen: Gefunden.
open("/etc/security/pam_unix2.conf", O_RDONLY) = 3

Ich merke gerade, das ich noch einiges Lernen muß.
Erstmal nachschlagen was das alles bedeutet!
Zu den Fehlermeldungen zu pdsql: Vor ein paar Monaten habe ich pgSQL mal
kurzzeitig installiert um es mal zu testen, aber es wieder entfernt.(Dachte
ich)



André




Mehr Informationen über die Mailingliste Postfixbuch-users