Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source3/pam_smbpass
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/pam_smbpass/general.h

    r414 r740  
     1#include "../librpc/gen_ndr/samr.h"
     2#include "../libcli/auth/pam_errors.h"
     3#include "passdb.h"
     4
    15#ifndef LINUX
    26/* This is only needed by modules in the Sun implementation. */
     
    117121 */
    118122
    119 #define FAIL_PREFIX                     "-SMB-FAIL-"
    120123#define SMB_MAX_RETRIES                 3
    121124
  • vendor/current/source3/pam_smbpass/pam_smb_acct.c

    r414 r740  
    5858
    5959        /* Samba initialization. */
    60         load_case_tables();
     60        load_case_tables_library();
    6161        lp_set_in_client(True);
    6262
     
    8383        /* Getting into places that might use LDAP -- protect the app
    8484                from a SIGPIPE it's not expecting */
    85         oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
     85        oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
    8686        if (!initialize_password_db(True, NULL)) {
    8787          _log_err(pamh, LOG_ALERT, "Cannot access samba password database" );
    88                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     88                CatchSignal(SIGPIPE, oldsig_handler);
    8989                return PAM_AUTHINFO_UNAVAIL;
    9090        }
     
    9393
    9494        if (!(sampass = samu_new( NULL ))) {
    95                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     95                CatchSignal(SIGPIPE, oldsig_handler);
    9696                /* malloc fail. */
    9797                return nt_status_to_pam(NT_STATUS_NO_MEMORY);
     
    100100        if (!pdb_getsampwnam(sampass, name )) {
    101101                _log_err(pamh, LOG_DEBUG, "acct: could not identify user");
    102                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     102                CatchSignal(SIGPIPE, oldsig_handler);
    103103                return PAM_USER_UNKNOWN;
    104104        }
     
    106106        /* check for lookup failure */
    107107        if (!strlen(pdb_get_username(sampass)) ) {
    108                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     108                CatchSignal(SIGPIPE, oldsig_handler);
    109109                return PAM_USER_UNKNOWN;
    110110        }
     
    119119                        "please see your system administrator." );
    120120
    121                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     121                CatchSignal(SIGPIPE, oldsig_handler);
    122122                return PAM_ACCT_EXPIRED;
    123123        }
     
    125125        /* TODO: support for expired passwords. */
    126126
    127         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     127        CatchSignal(SIGPIPE, oldsig_handler);
    128128        return PAM_SUCCESS;
    129129}
  • vendor/current/source3/pam_smbpass/pam_smb_auth.c

    r414 r740  
    1919
    2020#include "includes.h"
    21 #include "debug.h"
     21#include "lib/util/debug.h"
    2222
    2323#ifndef LINUX
     
    4545do {                                                            \
    4646        /* Restore application signal handler */                \
    47         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);       \
     47        CatchSignal(SIGPIPE, oldsig_handler);                   \
    4848        if(ret_data) {                                          \
    4949                *ret_data = retval;                             \
     
    8181
    8282        /* Samba initialization. */
    83         load_case_tables();
     83        load_case_tables_library();
    8484        lp_set_in_client(True);
    8585
     
    9393        /* Getting into places that might use LDAP -- protect the app
    9494        from a SIGPIPE it's not expecting */
    95         oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
     95        oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
    9696
    9797        /* get the username */
  • vendor/current/source3/pam_smbpass/pam_smb_passwd.c

    r414 r740  
    106106
    107107    /* Samba initialization. */
    108     load_case_tables();
     108    load_case_tables_library();
    109109    lp_set_in_client(True);
    110110
     
    134134    /* Getting into places that might use LDAP -- protect the app
    135135       from a SIGPIPE it's not expecting */
    136     oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
     136    oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
    137137
    138138    if (!initialize_password_db(False, NULL)) {
    139139      _log_err(pamh, LOG_ALERT, "Cannot access samba password database" );
    140         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     140        CatchSignal(SIGPIPE, oldsig_handler);
    141141        return PAM_AUTHINFO_UNAVAIL;
    142142    }
     
    144144    /* obtain user record */
    145145    if ( !(sampass = samu_new( NULL )) ) {
    146         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     146        CatchSignal(SIGPIPE, oldsig_handler);
    147147        return nt_status_to_pam(NT_STATUS_NO_MEMORY);
    148148    }
     
    150150    if (!pdb_getsampwnam(sampass,user)) {
    151151        _log_err(pamh, LOG_ALERT, "Failed to find entry for user %s.", user);
    152         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     152        CatchSignal(SIGPIPE, oldsig_handler);
    153153        return PAM_USER_UNKNOWN;
    154154    }
     
    168168
    169169            TALLOC_FREE(sampass);
    170             CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     170            CatchSignal(SIGPIPE, oldsig_handler);
    171171            return PAM_SUCCESS;
    172172        }
     
    177177
    178178            /* tell user what is happening */
    179 #define greeting "Changing password for "
    180             Announce = SMB_MALLOC_ARRAY(char, sizeof(greeting)+strlen(user));
    181             if (Announce == NULL) {
    182                 _log_err(pamh, LOG_CRIT, "password: out of memory");
    183                 TALLOC_FREE(sampass);
    184                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
    185                 return PAM_BUF_ERR;
    186             }
    187             strncpy( Announce, greeting, sizeof(greeting) );
    188             strncpy( Announce+sizeof(greeting)-1, user, strlen(user)+1 );
    189 #undef greeting
     179                if (asprintf(&Announce, "Changing password for %s", user) == -1) {
     180                        _log_err(pamh, LOG_CRIT, "password: out of memory");
     181                        TALLOC_FREE(sampass);
     182                        CatchSignal(SIGPIPE, oldsig_handler);
     183                        return PAM_BUF_ERR;
     184                }
    190185
    191186            set( SMB__OLD_PASSWD, ctrl );
     
    198193                         "password - (old) token not obtained");
    199194                TALLOC_FREE(sampass);
    200                 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     195                CatchSignal(SIGPIPE, oldsig_handler);
    201196                return retval;
    202197            }
     
    213208        pass_old = NULL;
    214209        TALLOC_FREE(sampass);
    215         CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     210        CatchSignal(SIGPIPE, oldsig_handler);
    216211        return retval;
    217212
     
    243238            _log_err(pamh, LOG_NOTICE, "password: user not authenticated");
    244239            TALLOC_FREE(sampass);
    245             CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     240            CatchSignal(SIGPIPE, oldsig_handler);
    246241            return retval;
    247242        }
     
    271266            pass_old = NULL;                               /* tidy up */
    272267            TALLOC_FREE(sampass);
    273             CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     268            CatchSignal(SIGPIPE, oldsig_handler);
    274269            return retval;
    275270        }
     
    291286            pass_new = pass_old = NULL;               /* tidy up */
    292287            TALLOC_FREE(sampass);
    293             CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     288            CatchSignal(SIGPIPE, oldsig_handler);
    294289            return retval;
    295290        }
     
    340335
    341336    TALLOC_FREE(sampass);
    342     CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
     337    CatchSignal(SIGPIPE, oldsig_handler);
    343338    return retval;
    344339}
  • vendor/current/source3/pam_smbpass/support.c

    r414 r740  
    2020
    2121#include "support.h"
     22#include "secrets.h"
    2223
    2324#include "../libcli/auth/libcli_auth.h"
     
    9394{
    9495        va_list args;
    95         const char tag[] = "(pam_smbpass) ";
    9696        char *mod_format;
    9797
    98         mod_format = SMB_MALLOC_ARRAY(char, sizeof(tag) + strlen(format));
    99         /* try really, really hard to log something, since this may have
    100            been a message about a malloc() failure... */
    101         if (mod_format == NULL) {
     98        if (asprintf(&mod_format, "(pam_smbpass) %s", format) == -1) {
     99                /*
     100                 * try really, really hard to log something, since
     101                 * this may have been a message about a malloc()
     102                 * failure...
     103                 */
    102104                va_start(args, format);
    103105                vsyslog(err | LOG_AUTH, format, args);
     
    105107                return;
    106108        }
    107 
    108         strncpy(mod_format, tag, strlen(tag)+1);
    109         strlcat(mod_format, format, strlen(format)+1);
    110109
    111110        va_start(args, format);
     
    381380    }
    382381
    383     data_name = SMB_MALLOC_ARRAY(char, sizeof(FAIL_PREFIX) + strlen( name ));
    384     if (data_name == NULL) {
     382    if (asprintf(&data_name, "-SMB-FAIL- %s", name) == -1) {
    385383        _log_err(pamh, LOG_CRIT, "no memory for data-name" );
    386384        return PAM_AUTH_ERR;
    387385    }
    388     strncpy( data_name, FAIL_PREFIX, sizeof(FAIL_PREFIX) );
    389     strncpy( data_name + sizeof(FAIL_PREFIX) - 1, name, strlen( name ) + 1 );
    390386
    391387    /*
Note: See TracChangeset for help on using the changeset viewer.