diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2011-10-26 23:56:54 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2011-10-26 23:56:54 +0000 |
commit | 1814aec611a5f9e03eceee81237ad3a3f51c954a (patch) | |
tree | 9f0ab1c38d5fbdd5f8ed8f792bf5649bcd50a416 /libpam | |
parent | fc772e7236a7aea9c9c26b0be2ee6f3ed8ae444a (diff) | |
download | pam-1814aec611a5f9e03eceee81237ad3a3f51c954a.tar.gz pam-1814aec611a5f9e03eceee81237ad3a3f51c954a.tar.bz2 pam-1814aec611a5f9e03eceee81237ad3a3f51c954a.zip |
Fix whitespace issues
Cleanup trailing whitespaces, indentation that uses spaces before tabs,
and blank lines at EOF. Make the project free of warnings reported by
git diff --check 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD
Diffstat (limited to 'libpam')
-rw-r--r-- | libpam/.cvsignore | 1 | ||||
-rw-r--r-- | libpam/pam_audit.c | 4 | ||||
-rw-r--r-- | libpam/pam_delay.c | 1 | ||||
-rw-r--r-- | libpam/pam_dispatch.c | 8 | ||||
-rw-r--r-- | libpam/pam_dynamic.c | 10 | ||||
-rw-r--r-- | libpam/pam_handlers.c | 18 | ||||
-rw-r--r-- | libpam/pam_item.c | 6 | ||||
-rw-r--r-- | libpam/pam_misc.c | 2 | ||||
-rw-r--r-- | libpam/pam_modutil_getgrgid.c | 12 | ||||
-rw-r--r-- | libpam/pam_modutil_getgrnam.c | 8 | ||||
-rw-r--r-- | libpam/pam_modutil_getpwnam.c | 8 | ||||
-rw-r--r-- | libpam/pam_modutil_getpwuid.c | 12 | ||||
-rw-r--r-- | libpam/pam_modutil_getspnam.c | 8 | ||||
-rw-r--r-- | libpam/pam_modutil_ingroup.c | 2 | ||||
-rw-r--r-- | libpam/pam_prelude.h | 1 | ||||
-rw-r--r-- | libpam/pam_session.c | 2 | ||||
-rw-r--r-- | libpam/pam_tokens.h | 4 |
17 files changed, 52 insertions, 55 deletions
diff --git a/libpam/.cvsignore b/libpam/.cvsignore index e1a7920a..c281f21f 100644 --- a/libpam/.cvsignore +++ b/libpam/.cvsignore @@ -6,4 +6,3 @@ Makefile.in .libs *.la *.lo - diff --git a/libpam/pam_audit.c b/libpam/pam_audit.c index 7f2e0b2c..531746ab 100644 --- a/libpam/pam_audit.c +++ b/libpam/pam_audit.c @@ -161,7 +161,7 @@ pam_modutil_audit_write(pam_handle_t *pamh, int type, { int audit_fd; int rc; - + if ((audit_fd=_pam_audit_open(pamh)) == -1) { return PAM_SYSTEM_ERR; } else if (audit_fd == -2) { @@ -171,7 +171,7 @@ pam_modutil_audit_write(pam_handle_t *pamh, int type, rc = _pam_audit_writelog(pamh, audit_fd, type, message, retval); audit_close(audit_fd); - + return rc < 0 ? PAM_SYSTEM_ERR : PAM_SUCCESS; } diff --git a/libpam/pam_delay.c b/libpam/pam_delay.c index a9cfa802..cb6c9d5c 100644 --- a/libpam/pam_delay.c +++ b/libpam/pam_delay.c @@ -156,4 +156,3 @@ int pam_fail_delay(pam_handle_t *pamh, unsigned int usec) return PAM_SUCCESS; } - diff --git a/libpam/pam_dispatch.c b/libpam/pam_dispatch.c index 98c69c60..eb52c824 100644 --- a/libpam/pam_dispatch.c +++ b/libpam/pam_dispatch.c @@ -261,16 +261,16 @@ static int _pam_dispatch_aux(pam_handle_t *pamh, int flags, struct handler *h, if (impression == _PAM_UNDEF || (impression == _PAM_POSITIVE && status == PAM_SUCCESS) ) { - if ( retval != PAM_IGNORE || cached_retval == retval ) { + if ( retval != PAM_IGNORE || cached_retval == retval ) { impression = _PAM_POSITIVE; - status = retval; - } + status = retval; + } } } /* this means that we need to skip #action stacked modules */ while (h->next != NULL && h->next->stack_level >= stack_level && action > 0) { - do { + do { h = h->next; ++depth; } while (h->next != NULL && h->next->stack_level > stack_level); diff --git a/libpam/pam_dynamic.c b/libpam/pam_dynamic.c index 5be33c36..e1155e50 100644 --- a/libpam/pam_dynamic.c +++ b/libpam/pam_dynamic.c @@ -55,8 +55,8 @@ void *_pam_dlopen(const char *mod_path) NSObjectFileImage ofile; void *ret = NULL; - if (NSCreateObjectFileImageFromFile(mod_path, &ofile) != - NSObjectFileImageSuccess ) + if (NSCreateObjectFileImageFromFile(mod_path, &ofile) != + NSObjectFileImageSuccess ) return NULL; ret = NSLinkModule(ofile, mod_path, NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); @@ -68,7 +68,7 @@ void *_pam_dlopen(const char *mod_path) #endif } -servicefn _pam_dlsym(void *handle, const char *symbol) +servicefn _pam_dlsym(void *handle, const char *symbol) { #ifdef PAM_SHL char *_symbol = NULL; @@ -83,7 +83,7 @@ servicefn _pam_dlsym(void *handle, const char *symbol) return NULL; strcpy(_symbol, SHLIB_SYM_PREFIX); strcat(_symbol, symbol); - if( shl_findsym(&handle, _symbol, + if( shl_findsym(&handle, _symbol, (short) TYPE_PROCEDURE, &ret ){ free(_symbol); return NULL; @@ -92,7 +92,7 @@ servicefn _pam_dlsym(void *handle, const char *symbol) } return ret; - + #elif defined(PAM_DYLD) NSSymbol nsSymbol; char *_symbol; diff --git a/libpam/pam_handlers.c b/libpam/pam_handlers.c index 59a1929f..02714f78 100644 --- a/libpam/pam_handlers.c +++ b/libpam/pam_handlers.c @@ -194,16 +194,16 @@ static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f tok = _pam_StrTok(NULL, " \n\t", &nexttok); if (pam_include) { - if (substack) { + if (substack) { res = _pam_add_handler(pamh, PAM_HT_SUBSTACK, other, - stack_level, module_type, actions, tok, - 0, NULL, 0); + stack_level, module_type, actions, tok, + 0, NULL, 0); if (res != PAM_SUCCESS) { pam_syslog(pamh, LOG_ERR, "error adding substack %s", tok); D(("failed to load module - aborting")); return PAM_ABORT; - } - } + } + } if (_pam_load_conf_file(pamh, tok, this_service, module_type, stack_level + substack #ifdef PAM_READ_BOTH_CONFS @@ -625,7 +625,7 @@ _pam_load_module(pam_handle_t *pamh, const char *mod_path, int handler_type) struct loaded_module *mod; D(("_pam_load_module: loading module `%s'", mod_path)); - + mod = pamh->handlers.module; /* First, ensure the module is loaded */ @@ -774,12 +774,12 @@ int _pam_add_handler(pam_handle_t *pamh /* if we get here with NULL it means allocation error */ return PAM_ABORT; } - + mod_type = mod->type; } - + if (mod_path == NULL) - mod_path = UNKNOWN_MODULE; + mod_path = UNKNOWN_MODULE; /* * At this point 'mod' points to the stored/loaded module. diff --git a/libpam/pam_item.c b/libpam/pam_item.c index 00e00c29..8148fd57 100644 --- a/libpam/pam_item.c +++ b/libpam/pam_item.c @@ -315,8 +315,8 @@ int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt) if (pamh->former.want_user) { /* must have a prompt to resume with */ if (! pamh->former.prompt) { - pam_syslog(pamh, LOG_ERR, - "pam_get_user: failed to resume with prompt" + pam_syslog(pamh, LOG_ERR, + "pam_get_user: failed to resume with prompt" ); return PAM_ABORT; } @@ -324,7 +324,7 @@ int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt) /* must be the same prompt as last time */ if (strcmp(pamh->former.prompt, use_prompt)) { pam_syslog(pamh, LOG_ERR, - "pam_get_user: resumed with different prompt"); + "pam_get_user: resumed with different prompt"); return PAM_ABORT; } diff --git a/libpam/pam_misc.c b/libpam/pam_misc.c index 0e607276..aac0e923 100644 --- a/libpam/pam_misc.c +++ b/libpam/pam_misc.c @@ -312,7 +312,7 @@ void _pam_parse_control(int *control_array, char *tok) break; } } - if (act > 0) { + if (act > 0) { /* * Either we have a number or we have hit an error. In * principle, there is nothing to stop us accepting diff --git a/libpam/pam_modutil_getgrgid.c b/libpam/pam_modutil_getgrgid.c index 600946a1..386d6f4b 100644 --- a/libpam/pam_modutil_getgrgid.c +++ b/libpam/pam_modutil_getgrgid.c @@ -16,7 +16,7 @@ #include <stdlib.h> static int intlen(int number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -26,7 +26,7 @@ static int intlen(int number) } static int longlen(long number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -72,7 +72,7 @@ pam_modutil_getgrgid(pam_handle_t *pamh, gid_t gid) int i; data_name = malloc(strlen("_pammodutil_getgrgid") + 1 + - longlen((long)gid) + 1 + intlen(INT_MAX) + 1); + longlen((long)gid) + 1 + intlen(INT_MAX) + 1); if ((pamh != NULL) && (data_name == NULL)) { D(("was unable to register the data item [%s]", pam_strerror(pamh, status))); @@ -83,7 +83,7 @@ pam_modutil_getgrgid(pam_handle_t *pamh, gid_t gid) if (pamh != NULL) { for (i = 0; i < INT_MAX; i++) { sprintf(data_name, "_pammodutil_getgrgid_%ld_%d", - (long) gid, i); + (long) gid, i); status = PAM_NO_MODULE_DATA; if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) { status = pam_set_data(pamh, data_name, @@ -114,7 +114,7 @@ pam_modutil_getgrgid(pam_handle_t *pamh, gid_t gid) /* no sense in repeating the call */ break; } - + length <<= PWD_LENGTH_SHIFT; } while (length < PWD_ABSURD_PWD_LENGTH); @@ -131,7 +131,7 @@ pam_modutil_getgrgid(pam_handle_t *pamh, gid_t gid) * Sorry, there does not appear to be a reentrant version of * getgrgid(). So, we use the standard libc function. */ - + return getgrgid(gid); #endif /* def HAVE_GETGRGID_R */ diff --git a/libpam/pam_modutil_getgrnam.c b/libpam/pam_modutil_getgrnam.c index adf7daa2..cbb1551d 100644 --- a/libpam/pam_modutil_getgrnam.c +++ b/libpam/pam_modutil_getgrnam.c @@ -16,7 +16,7 @@ #include <stdlib.h> static int intlen(int number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -62,7 +62,7 @@ pam_modutil_getgrnam(pam_handle_t *pamh, const char *group) int i; data_name = malloc(strlen("_pammodutil_getgrnam") + 1 + - strlen(group) + 1 + intlen(INT_MAX) + 1); + strlen(group) + 1 + intlen(INT_MAX) + 1); if ((pamh != NULL) && (data_name == NULL)) { D(("was unable to register the data item [%s]", pam_strerror(pamh, status))); @@ -103,7 +103,7 @@ pam_modutil_getgrnam(pam_handle_t *pamh, const char *group) /* no sense in repeating the call */ break; } - + length <<= PWD_LENGTH_SHIFT; } while (length < PWD_ABSURD_PWD_LENGTH); @@ -120,7 +120,7 @@ pam_modutil_getgrnam(pam_handle_t *pamh, const char *group) * Sorry, there does not appear to be a reentrant version of * getgrnam(). So, we use the standard libc function. */ - + return getgrnam(group); #endif /* def HAVE_GETGRNAM_R */ diff --git a/libpam/pam_modutil_getpwnam.c b/libpam/pam_modutil_getpwnam.c index f4e4d80e..8132c769 100644 --- a/libpam/pam_modutil_getpwnam.c +++ b/libpam/pam_modutil_getpwnam.c @@ -16,7 +16,7 @@ #include <stdlib.h> static int intlen(int number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -62,7 +62,7 @@ pam_modutil_getpwnam(pam_handle_t *pamh, const char *user) int i; data_name = malloc(strlen("_pammodutil_getpwnam") + 1 + - strlen(user) + 1 + intlen(INT_MAX) + 1); + strlen(user) + 1 + intlen(INT_MAX) + 1); if ((pamh != NULL) && (data_name == NULL)) { D(("was unable to register the data item [%s]", pam_strerror(pamh, status))); @@ -103,7 +103,7 @@ pam_modutil_getpwnam(pam_handle_t *pamh, const char *user) /* no sense in repeating the call */ break; } - + length <<= PWD_LENGTH_SHIFT; } while (length < PWD_ABSURD_PWD_LENGTH); @@ -120,7 +120,7 @@ pam_modutil_getpwnam(pam_handle_t *pamh, const char *user) * Sorry, there does not appear to be a reentrant version of * getpwnam(). So, we use the standard libc function. */ - + return getpwnam(user); #endif /* def HAVE_GETPWNAM_R */ diff --git a/libpam/pam_modutil_getpwuid.c b/libpam/pam_modutil_getpwuid.c index 33a6cf49..3a435937 100644 --- a/libpam/pam_modutil_getpwuid.c +++ b/libpam/pam_modutil_getpwuid.c @@ -16,7 +16,7 @@ #include <stdlib.h> static int intlen(int number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -26,7 +26,7 @@ static int intlen(int number) } static int longlen(long number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -72,7 +72,7 @@ pam_modutil_getpwuid(pam_handle_t *pamh, uid_t uid) int i; data_name = malloc(strlen("_pammodutil_getpwuid") + 1 + - longlen((long) uid) + 1 + intlen(INT_MAX) + 1); + longlen((long) uid) + 1 + intlen(INT_MAX) + 1); if ((pamh != NULL) && (data_name == NULL)) { D(("was unable to register the data item [%s]", pam_strerror(pamh, status))); @@ -83,7 +83,7 @@ pam_modutil_getpwuid(pam_handle_t *pamh, uid_t uid) if (pamh != NULL) { for (i = 0; i < INT_MAX; i++) { sprintf(data_name, "_pammodutil_getpwuid_%ld_%d", - (long) uid, i); + (long) uid, i); status = PAM_NO_MODULE_DATA; if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) { status = pam_set_data(pamh, data_name, @@ -114,7 +114,7 @@ pam_modutil_getpwuid(pam_handle_t *pamh, uid_t uid) /* no sense in repeating the call */ break; } - + length <<= PWD_LENGTH_SHIFT; } while (length < PWD_ABSURD_PWD_LENGTH); @@ -131,7 +131,7 @@ pam_modutil_getpwuid(pam_handle_t *pamh, uid_t uid) * Sorry, there does not appear to be a reentrant version of * getpwuid(). So, we use the standard libc function. */ - + return getpwuid(uid); #endif /* def HAVE_GETPWUID_R */ diff --git a/libpam/pam_modutil_getspnam.c b/libpam/pam_modutil_getspnam.c index 7cc64881..032709ed 100644 --- a/libpam/pam_modutil_getspnam.c +++ b/libpam/pam_modutil_getspnam.c @@ -16,7 +16,7 @@ #include <stdlib.h> static int intlen(int number) -{ +{ int len = 2; while (number != 0) { number /= 10; @@ -62,7 +62,7 @@ pam_modutil_getspnam(pam_handle_t *pamh, const char *user) int i; data_name = malloc(strlen("_pammodutil_getspnam") + 1 + - strlen(user) + 1 + intlen(INT_MAX) + 1); + strlen(user) + 1 + intlen(INT_MAX) + 1); if ((pamh != NULL) && (data_name == NULL)) { D(("was unable to register the data item [%s]", pam_strerror(pamh, status))); @@ -103,7 +103,7 @@ pam_modutil_getspnam(pam_handle_t *pamh, const char *user) /* no sense in repeating the call */ break; } - + length <<= PWD_LENGTH_SHIFT; } while (length < PWD_ABSURD_PWD_LENGTH); @@ -120,7 +120,7 @@ pam_modutil_getspnam(pam_handle_t *pamh, const char *user) * Sorry, there does not appear to be a reentrant version of * getspnam(). So, we use the standard libc function. */ - + return getspnam(user); #endif /* def HAVE_GETSPNAM_R */ diff --git a/libpam/pam_modutil_ingroup.c b/libpam/pam_modutil_ingroup.c index 7a15f712..875cf3e2 100644 --- a/libpam/pam_modutil_ingroup.c +++ b/libpam/pam_modutil_ingroup.c @@ -74,7 +74,7 @@ pam_modutil_user_in_group_common(pam_handle_t *pamh UNUSED, return 0; } -int +int pam_modutil_user_in_group_nam_nam(pam_handle_t *pamh, const char *user, const char *group) { diff --git a/libpam/pam_prelude.h b/libpam/pam_prelude.h index 13ee6fdb..196b1418 100644 --- a/libpam/pam_prelude.h +++ b/libpam/pam_prelude.h @@ -13,4 +13,3 @@ void prelude_send_alert(pam_handle_t *pamh, int authval); #endif /* _SECURITY_PAM_PRELUDE_H */ - diff --git a/libpam/pam_session.c b/libpam/pam_session.c index 34532bce..512153f2 100644 --- a/libpam/pam_session.c +++ b/libpam/pam_session.c @@ -24,7 +24,7 @@ int pam_open_session(pam_handle_t *pamh, int flags) #ifdef HAVE_LIBAUDIT retval = _pam_auditlog(pamh, PAM_OPEN_SESSION, retval, flags); -#endif +#endif return retval; } diff --git a/libpam/pam_tokens.h b/libpam/pam_tokens.h index fcda7ec2..1412fa31 100644 --- a/libpam/pam_tokens.h +++ b/libpam/pam_tokens.h @@ -89,13 +89,13 @@ const char * const _pam_token_returns[_PAM_RETURN_VALUES+1] = { * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. - * + * * ALTERNATIVELY, this product may be distributed under the terms of * the GNU Public License, in which case the provisions of the GPL are * required INSTEAD OF the above restrictions. (This clause is * necessary due to a potential bad interaction between the GPL and * the restrictions contained in a BSD-style copyright.) - * + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |