diff options
author | Jeremy Allison <jra@samba.org> | 2005-06-24 21:18:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:58:01 -0500 |
commit | b20239df942527c0cbf70d779df56a4a56518315 (patch) | |
tree | bd7ce90d90e0c90a3b932dd3cdb32e0dfee976da | |
parent | 19ca97a70f6b7b41d251eaa76e4d3c980c6eedff (diff) | |
download | samba-b20239df942527c0cbf70d779df56a4a56518315.tar.gz samba-b20239df942527c0cbf70d779df56a4a56518315.tar.bz2 samba-b20239df942527c0cbf70d779df56a4a56518315.zip |
r7886: Fix building with pam_smbpass.
Jeremy.
(This used to be commit 22a796fe012e212f7744f0d63a8512e6942a5324)
-rw-r--r-- | source3/include/includes.h | 1 | ||||
-rw-r--r-- | source3/pam_smbpass/support.c | 28 |
2 files changed, 15 insertions, 14 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 9ff87557ff..d35123dc73 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -29,6 +29,7 @@ #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define protected #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES #define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES diff --git a/source3/pam_smbpass/support.c b/source3/pam_smbpass/support.c index f5682480eb..82d51103d2 100644 --- a/source3/pam_smbpass/support.c +++ b/source3/pam_smbpass/support.c @@ -232,23 +232,23 @@ void _cleanup( pam_handle_t * pamh, void *x, int error_status ) */ char * smbpXstrDup( const char *x ) { - register char *new = NULL; + register char *newstr = NULL; if (x != NULL) { register int i; for (i = 0; x[i]; ++i); /* length of string */ - if ((new = SMB_MALLOC_ARRAY(char, ++i)) == NULL) { + if ((newstr = SMB_MALLOC_ARRAY(char, ++i)) == NULL) { i = 0; _log_err( LOG_CRIT, "out of memory in smbpXstrDup" ); } else { while (i-- > 0) { - new[i] = x[i]; + newstr[i] = x[i]; } } x = NULL; } - return new; /* return the duplicate or NULL on error */ + return newstr; /* return the duplicate or NULL on error */ } /* ************************************************************** * @@ -374,21 +374,21 @@ int _smb_verify_password( pam_handle_t * pamh, SAM_ACCOUNT *sampass, pam_get_item( pamh, PAM_SERVICE, (const void **)&service ); if (data_name != NULL) { - struct _pam_failed_auth *new = NULL; + struct _pam_failed_auth *newauth = NULL; const struct _pam_failed_auth *old = NULL; /* get a failure recorder */ - new = SMB_MALLOC_P( struct _pam_failed_auth ); + newauth = SMB_MALLOC_P( struct _pam_failed_auth ); - if (new != NULL) { + if (newauth != NULL) { /* any previous failures for this user ? */ pam_get_data(pamh, data_name, (const void **) &old); if (old != NULL) { - new->count = old->count + 1; - if (new->count >= SMB_MAX_RETRIES) { + newauth->count = old->count + 1; + if (newauth->count >= SMB_MAX_RETRIES) { retval = PAM_MAXTRIES; } } else { @@ -396,17 +396,17 @@ int _smb_verify_password( pam_handle_t * pamh, SAM_ACCOUNT *sampass, "failed auth request by %s for service %s as %s", uidtoname(getuid()), service ? service : "**unknown**", name); - new->count = 1; + newauth->count = 1; } - if (!NT_STATUS_IS_OK(sid_to_uid(pdb_get_user_sid(sampass), &(new->id)))) { + if (!NT_STATUS_IS_OK(sid_to_uid(pdb_get_user_sid(sampass), &(newauth->id)))) { _log_err(LOG_NOTICE, "failed auth request by %s for service %s as %s", uidtoname(getuid()), service ? service : "**unknown**", name); } - new->user = smbpXstrDup( name ); - new->agent = smbpXstrDup( uidtoname( getuid() ) ); - pam_set_data( pamh, data_name, new, _cleanup_failures ); + newauth->user = smbpXstrDup( name ); + newauth->agent = smbpXstrDup( uidtoname( getuid() ) ); + pam_set_data( pamh, data_name, newauth, _cleanup_failures ); } else { _log_err( LOG_CRIT, "no memory for failure recorder" ); |