mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-08 03:54:18 +01:00
Make code C90 compliant
This moves variable declrations to the beginning of a block to be C90-compliant.
This commit is contained in:
parent
80e7484aea
commit
a68d3be1bc
@ -245,6 +245,7 @@ authorize_user_token_ldap (struct cfg *cfg,
|
||||
struct berval **vals;
|
||||
int rc;
|
||||
size_t i;
|
||||
int j;
|
||||
|
||||
char *filter = NULL;
|
||||
char *find = NULL;
|
||||
@ -308,7 +309,7 @@ authorize_user_token_ldap (struct cfg *cfg,
|
||||
DBG ("Failed allocating %zu bytes", i);
|
||||
goto done;
|
||||
}
|
||||
int j = snprintf (find, i, "%s=%s,%s", cfg->user_attr, user, cfg->ldapdn);
|
||||
j = snprintf (find, i, "%s=%s,%s", cfg->user_attr, user, cfg->ldapdn);
|
||||
if (j < 0 || j >= i) {
|
||||
DBG ("Failed to format string");
|
||||
goto done;
|
||||
|
8
util.c
8
util.c
@ -62,13 +62,14 @@ get_user_cfgfile_path(const char *common_path, const char *filename, const struc
|
||||
*/
|
||||
char *userfile;
|
||||
size_t len;
|
||||
int i;
|
||||
|
||||
if (common_path != NULL) {
|
||||
len = strlen(common_path) + 1 + strlen(filename) + 1;
|
||||
if ((userfile = malloc(len)) == NULL) {
|
||||
return 0;
|
||||
}
|
||||
int i = snprintf(userfile, len, "%s/%s", common_path, filename);
|
||||
i = snprintf(userfile, len, "%s/%s", common_path, filename);
|
||||
if (i < 0 || i >= len) {
|
||||
return 0;
|
||||
}
|
||||
@ -82,7 +83,7 @@ get_user_cfgfile_path(const char *common_path, const char *filename, const struc
|
||||
if ((userfile = malloc(len)) == NULL) {
|
||||
return 0;
|
||||
}
|
||||
int i = snprintf(userfile, len, "%s/.yubico/%s", user->pw_dir, filename);
|
||||
i = snprintf(userfile, len, "%s/.yubico/%s", user->pw_dir, filename);
|
||||
if (i < 0 || i >= len) {
|
||||
return 0;
|
||||
}
|
||||
@ -306,6 +307,7 @@ check_user_challenge_file(const char *chalresp_path, const struct passwd *user,
|
||||
*/
|
||||
size_t len;
|
||||
int r;
|
||||
int i;
|
||||
int ret = AUTH_NOT_FOUND;
|
||||
char *userfile = NULL;
|
||||
char *userfile_pattern = NULL;
|
||||
@ -339,7 +341,7 @@ check_user_challenge_file(const char *chalresp_path, const struct passwd *user,
|
||||
goto out;
|
||||
}
|
||||
|
||||
int i = snprintf(userfile_pattern, len, "%s-*", userfile);
|
||||
i = snprintf(userfile_pattern, len, "%s-*", userfile);
|
||||
|
||||
if (i < 0 || i >= len) {
|
||||
D (debug_file, "Failed to format string correctly");
|
||||
|
Loading…
x
Reference in New Issue
Block a user