[PATCH] pam_smbpass for CVS HEAD

Alexander Bokovoy a.bokovoy at sam-solutions.net
Tue Dec 11 10:56:09 GMT 2001


Attached patch makes pam_smbpass compileable again in CVS HEAD.
I suspect that nobody uses pam_smbpass 'cause some of these problems
exist in SAMBA_2_2 branch as well for a while... But fixing it is
important as well.

-- 
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
  `Senior software developer and analyst for SaM-Solutions Ltd.`
---
Nov 21 20:58:58 alconost kernel: VFS: Busy inodes after unmount. 
		    Self-destruct in 5 seconds.  Have a nice day...
-------------- next part --------------
diff -urNk.original samba-ads/source/pam_smbpass/pam_smb_acct.c.original samba-ads/source/pam_smbpass/pam_smb_acct.c
--- samba-ads/source/pam_smbpass/pam_smb_acct.c.original	Tue Dec 11 19:24:53 2001
+++ samba-ads/source/pam_smbpass/pam_smb_acct.c	Tue Dec 11 20:39:13 2001
@@ -69,7 +69,7 @@
         _log_err( LOG_DEBUG, "acct: username [%s] obtained", name );
     }
 
-    if (!initialize_password_db()) {
+    if (!initialize_password_db(True)) {
         _log_err( LOG_ALERT, "Cannot access samba password database" );
         return PAM_AUTHINFO_UNAVAIL;
     }
diff -urNk.original samba-ads/source/pam_smbpass/pam_smb_auth.c.original samba-ads/source/pam_smbpass/pam_smb_auth.c
--- samba-ads/source/pam_smbpass/pam_smb_auth.c.original	Tue Dec 11 20:46:48 2001
+++ samba-ads/source/pam_smbpass/pam_smb_auth.c	Tue Dec 11 20:39:27 2001
@@ -93,7 +93,7 @@
         _log_err( LOG_DEBUG, "username [%s] obtained", name );
     }
 
-    if (!initialize_password_db()) {
+    if (!initialize_password_db(True)) {
         _log_err( LOG_ALERT, "Cannot access samba password database" );
         retval = PAM_AUTHINFO_UNAVAIL;
         AUTH_RETURN;
diff -urNk.original samba-ads/source/pam_smbpass/pam_smb_passwd.c.original samba-ads/source/pam_smbpass/pam_smb_passwd.c
--- samba-ads/source/pam_smbpass/pam_smb_passwd.c.original	Tue Dec 11 19:24:53 2001
+++ samba-ads/source/pam_smbpass/pam_smb_passwd.c	Tue Dec 11 20:39:41 2001
@@ -119,7 +119,7 @@
         _log_err( LOG_DEBUG, "username [%s] obtained", user );
     }
 
-    if (!initialize_password_db()) {
+    if (!initialize_password_db(True)) {
         _log_err( LOG_ALERT, "Cannot access samba password database" );
         return PAM_AUTHINFO_UNAVAIL;
     }
diff -urNk.original samba-ads/source/pam_smbpass/support.c.original samba-ads/source/pam_smbpass/support.c
--- samba-ads/source/pam_smbpass/support.c.original	Tue Dec 11 19:24:53 2001
+++ samba-ads/source/pam_smbpass/support.c	Tue Dec 11 20:47:39 2001
@@ -125,8 +125,7 @@
 int set_ctrl( int flags, int argc, const char **argv )
 {
     int i = 0;
-    static pstring servicesf = dyn_CONFIGFILE;
-    const char *service_file = servicesf;
+    const char *service_file = dyn_CONFIGFILE;
     unsigned int ctrl;
 
     ctrl = SMB_DEFAULTS;	/* the default selection of options */
@@ -214,32 +213,6 @@
 void _cleanup( pam_handle_t * pamh, void *x, int error_status )
 {
     x = _pam_delete( (char *) x );
-}
-
-/*
- * Safe duplication of character strings. "Paranoid"; don't leave
- * evidence of old token around for later stack analysis.
- */
-
-char * smb_xstrdup( const char *x )
-{
-    register char *new = NULL;
-
-    if (x != NULL) {
-        register int i;
-
-        for (i = 0; x[i]; ++i); /* length of string */
-        if ((new = malloc(++i)) == NULL) {
-            i = 0;
-            _log_err( LOG_CRIT, "out of memory in smb_xstrdup" );
-        } else {
-            while (i-- > 0) {
-                new[i] = x[i];
-            }
-        }
-        x = NULL;
-    }
-    return new;			/* return the duplicate or NULL on error */
 }
 
 /* ************************************************************** *


More information about the samba-technical mailing list