LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Slackware (http://www.linuxquestions.org/questions/forumdisplay.php?f=14)
-   -   Issue of Sendmail confAUTH_OPTIONS and saslauthd (http://www.linuxquestions.org/questions/showthread.php?t=4175444843)

cbastos 01-09-2013 11:51 AM

Issue of Sendmail confAUTH_OPTIONS and saslauthd
 
I was installing a server with Slackware 13.37 to rum a mail server, I had to stick to this version because of the new kernel doesnt support Dazuko anymore and we use it with the antivirus.

Every thing was just working fine until I start to setup the authentication on Sendmail. Email sent from the local network was going thrugh Sendmail and amavisd-new like a charm and authenticanted users couldnt authenticate themselves. I changed a lot the confAUTH_OPTIONS and DAEMON_OPTIONS in order to allow authentication without a secure channel being stabilished and even this way it kept not working.

I saw many posts conplaining about the issue of Sendmail and saslauthd and as I already had worked a lot on the Sendmail side I decided to take a closer look on saslauthd.

I started the server with strace

Code:

root@pop# strace -ff ./usr/sbin/saslauthd -a shadow
and used the testsaslautd command to test the server and "VOILA" I saw the error poping up at my eyes:

[pid 2720] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 8
[pid 2720] fcntl(8, F_GETFD) = 0x1 (flags FD_CLOEXEC)
[pid 2720] lseek(8, 0, SEEK_CUR) = 0
[pid 2720] fstat(8, {st_mode=S_IFREG|0644, st_size=226021, ...}) = 0
[pid 2720] mmap(NULL, 226021, PROT_READ, MAP_SHARED, 8, 0) = 0x7f9b1d975000
[pid 2720] lseek(8, 226021, SEEK_SET) = 226021
[pid 2720] munmap(0x7f9b1d975000, 226021) = 0
[pid 2720] close(8) = 0
[pid 2720] open("/etc/shadow", O_RDONLY|O_CLOEXEC) = 8
[pid 2720] lseek(8, 0, SEEK_CUR) = 0
[pid 2720] fstat(8, {st_mode=S_IFREG|0640, st_size=116218, ...}) = 0
[pid 2720] mmap(NULL, 116218, PROT_READ, MAP_SHARED, 8, 0) = 0x7f9b1d9b7000
[pid 2720] lseek(8, 116218, SEEK_SET) = 116218
[pid 2720] munmap(0x7f9b1d9b7000, 116218) = 0
[pid 2720] close(8) = 0
[pid 2720] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 2720 detached
[pid 2717] <... fcntl resumed> ) = ? ERESTARTSYS (To be restarted)
[pid 2717] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 2717] wait4(-1, NULL, WNOHANG, NULL) = 2720
[pid 2717] wait4(-1, NULL, WNOHANG, NULL) = 0
[pid 2717] rt_sigreturn(0xffffffffffffffff) = -1 EINTR (Interrupted system call)
[pid 2717] fcntl(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}

DANG!!!! The 64bit version of saslauthd was the reason of all the pain, crashing just after reading the shadow file.

As I already had compiled and installed a lot of programs in order to get Amavisd-new, spamassassin, clamav and so on working, going back to the 32bit version wasnt an option. The only way out I saw was intalling the Alienīs multilib http://alien.slackbook.org/dokuwiki/...kware:multilib I followed all the steps and after getting the package cyrus-sasl-compat32-2.1.23-x86_64-1.txz installed (this just install the lybriries) I download the package cyrus-sasl-2.1.23-i486-1.txz and stracted the sbin folder and moved it to /usr/sbin32

Code:

root@pop:/usr/local/down/32bit-pkg# tar -xvf cyrus-sasl-2.1.23-i486-1.txz usr/sbin
usr/sbin/
usr/sbin/pluginviewer
usr/sbin/sasldblistusers2
usr/sbin/testsaslauthd
usr/sbin/saslauthd
usr/sbin/saslpasswd2
root@pop:/usr/local/down/32bit-pkg# mkdir /usr/sbin32
root@pop:/usr/local/down/32bit-pkg# cd usr/sbin
root@pop:/usr/local/down/32bit-pkg/usr/sbin# mv * /usr/sbin32
root@pop:/usr/local/down/32bit-pkg/usr/sbin#

After I edited the script /etc/rc.d/rc.saslauthd and changed it

Code:

    #/usr/sbin/saslauthd -a shadow
    /usr/sbin32/saslauthd -a shadow

This saved all the work I had already done :-)

Saslauthd 32bit is working fine on my 64bit system, no more segmentation fault

[pid 10052] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 8
[pid 10052] _llseek(8, 0, [0], SEEK_CUR) = 0
[pid 10052] fstat64(8, {st_mode=S_IFREG|0644, st_size=226021, ...}) = 0
[pid 10052] mmap2(NULL, 226021, PROT_READ, MAP_SHARED, 8, 0) = 0xfffffffff74b1000
[pid 10052] _llseek(8, 226021, [226021], SEEK_SET) = 0
[pid 10052] munmap(0xf74b1000, 226021) = 0
[pid 10052] close(8) = 0
[pid 10052] time(NULL) = 1357748470
[pid 10052] open("/etc/shadow", O_RDONLY|O_CLOEXEC) = 8
[pid 10052] _llseek(8, 0, [0], SEEK_CUR) = 0
[pid 10052] fstat64(8, {st_mode=S_IFREG|0640, st_size=116218, ...}) = 0
[pid 10052] mmap2(NULL, 116218, PROT_READ, MAP_SHARED, 8, 0) = 0xfffffffff74cc000
[pid 10052] _llseek(8, 116218, [116218], SEEK_SET) = 0
[pid 10052] munmap(0xf74cc000, 116218) = 0
[pid 10052] close(8) = 0
[pid 10052] write(7, "\0\2", 2) = 2
[pid 10052] write(7, "OK", 2) = 2
[pid 10052] close(7) = 0

I hope this post can help people with this kind of issue.

Best regards,
Carlos Xavier.

cbastos 01-13-2013 03:28 PM

After doing all of this work I found out that I had to recompile the PHP package to add some features.

In order to recompile it, the php.Slackbuild script needs to recompile the package Alpine. Once you have multilib libraries installed the compilation of Alpine will not finish, it will end with errors.
To fix this new issue I had to modify the alpine.Slackbuild this way

Code:

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
  #SLKCFLAGS="-O2 -fPIC"
  SLKCFLAGS="-O2 -fPIC -L/usr/lib64"
fi

Regards,
Carlos


All times are GMT -5. The time now is 01:38 PM.