pam_smbpass on solaris

Lauri Jesmin jesmin at ut.ee
Sat Nov 15 16:04:57 GMT 2003


The problem with pam_smbpass on Solaris was that it could not load
configuration or find samba password file and only generated error
message to syslog:

PAM_smbpass[2618]: [ID 772098 auth.alert] Cannot access samba password
database

Anyway, i looked at the problem, and found that probably the problem was
with solaris snprintf in samba vasprintf function which seemed not to
like null arguments for calculating string length. 
So this is why talloc_init didn't work and also lp_string and so on
failed. 

I don't know why they don't fail in samba itself, but they do fail in
pam_smbpass. 

Probably the problem can be solved with some autoconf magic, but this
hack at least let's me change passwords with pam_smbpass on solaris.

The first patch worked acidentally but i hope that this is better:

diff -u -w -r1.25.2.10 snprintf.c
--- source/lib/snprintf.c       24 Oct 2003 16:08:03 -0000     
1.25.2.10
+++ source/lib/snprintf.c       15 Nov 2003 09:10:44 -0000
@@ -852,7 +852,7 @@

        VA_COPY(ap2, ap);

-       ret = vsnprintf(NULL, 0, format, ap2);
+       ret = dopr(NULL, 0, format, ap2);
        if (ret <= 0) return ret;

        (*ptr) = (char *)malloc(ret+1);
@@ -860,7 +860,7 @@

        VA_COPY(ap2, ap);

-       ret = vsnprintf(*ptr, ret+1, format, ap2);
+       ret = dopr(*ptr, ret+1, format, ap2);

        return ret;
 }


Also, samba compiled on Solarise complains this to syslog:
Messages appear on every connection, only those four messages. 
Samba itselt seems working normally. I use Openldap 2.1.23 libraries.
And solaris is Solaris 9 on SPARC.

PID is not main samba process PID but child's PID. 

Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 91  Mesg: Error 0
Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 91  Mesg: Bad file number
Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 7  Mesg: Session error no available conn.
Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 91  Mesg: Error 0
Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 91  Mesg: Bad file number
Nov 15 11:05:11 computer smbd[5478]: [ID 293258 user.error] libsldap:
Status: 7  Mesg: Session error no available conn.


-- 
Lauri Jesmin <jesmin at ut.ee>
Tartu Ülikool, IT Osakond




More information about the samba-technical mailing list