aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/pam_access/pam_access.c2
-rw-r--r--modules/pam_env/pam_env.c2
-rw-r--r--modules/pam_faillock/faillock_config.c8
-rw-r--r--modules/pam_filter/upperLOWER/upperLOWER.c6
-rw-r--r--modules/pam_group/pam_group.c16
-rw-r--r--modules/pam_lastlog/pam_lastlog.c2
-rw-r--r--modules/pam_limits/pam_limits.c8
-rw-r--r--modules/pam_namespace/argv_parse.c4
-rw-r--r--modules/pam_namespace/pam_namespace.c2
-rw-r--r--modules/pam_pwhistory/opasswd.c4
-rw-r--r--modules/pam_securetty/pam_securetty.c2
-rw-r--r--modules/pam_sepermit/pam_sepermit.c4
-rw-r--r--modules/pam_time/pam_time.c14
-rw-r--r--modules/pam_unix/support.c2
-rw-r--r--modules/pam_usertype/pam_usertype.c2
15 files changed, 39 insertions, 39 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c
index 985dc7de..04d7306b 100644
--- a/modules/pam_access/pam_access.c
+++ b/modules/pam_access/pam_access.c
@@ -456,7 +456,7 @@ login_access (pam_handle_t *pamh, struct login_info *item)
}
if (line[0] == '#')
continue; /* comment line */
- while (end > 0 && isspace(line[end - 1]))
+ while (end > 0 && isspace((unsigned char)line[end - 1]))
end--;
line[end] = 0; /* strip trailing whitespace */
if (line[0] == 0) /* skip blank lines */
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index d2b4cb10..d2d12ad6 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -965,7 +965,7 @@ _parse_env_file(pam_handle_t *pamh, int ctrl, const char *file)
}
for ( i = 0 ; key[i] != '=' && key[i] != '\0' ; i++ )
- if (!isalnum(key[i]) && key[i] != '_') {
+ if (!isalnum((unsigned char)key[i]) && key[i] != '_') {
pam_syslog(pamh, LOG_ERR,
"non-alphanumeric key '%s' in %s', ignoring",
key, file);
diff --git a/modules/pam_faillock/faillock_config.c b/modules/pam_faillock/faillock_config.c
index 0d14aad1..5d796240 100644
--- a/modules/pam_faillock/faillock_config.c
+++ b/modules/pam_faillock/faillock_config.c
@@ -121,7 +121,7 @@ read_config_file(pam_handle_t *pamh, struct options *opts, const char *cfgfile)
/* drop terminating whitespace including the \n */
while (ptr > linebuf) {
- if (!isspace(*(ptr-1))) {
+ if (!isspace((unsigned char)*(ptr-1))) {
*ptr = '\0';
break;
}
@@ -129,7 +129,7 @@ read_config_file(pam_handle_t *pamh, struct options *opts, const char *cfgfile)
}
/* skip initial whitespace */
- for (ptr = linebuf; isspace(*ptr); ptr++);
+ for (ptr = linebuf; isspace((unsigned char)*ptr); ptr++);
if (*ptr == '\0')
continue;
@@ -137,7 +137,7 @@ read_config_file(pam_handle_t *pamh, struct options *opts, const char *cfgfile)
eq = 0;
name = ptr;
while (*ptr != '\0') {
- if (isspace(*ptr) || *ptr == '=') {
+ if (isspace((unsigned char)*ptr) || *ptr == '=') {
eq = *ptr == '=';
*ptr = '\0';
++ptr;
@@ -149,7 +149,7 @@ read_config_file(pam_handle_t *pamh, struct options *opts, const char *cfgfile)
/* grab the key value */
while (*ptr != '\0') {
if (*ptr != '=' || eq) {
- if (!isspace(*ptr)) {
+ if (!isspace((unsigned char)*ptr)) {
break;
}
} else {
diff --git a/modules/pam_filter/upperLOWER/upperLOWER.c b/modules/pam_filter/upperLOWER/upperLOWER.c
index 25e70a5a..700e0ed1 100644
--- a/modules/pam_filter/upperLOWER/upperLOWER.c
+++ b/modules/pam_filter/upperLOWER/upperLOWER.c
@@ -24,10 +24,10 @@ static void do_transpose(char *buffer,int len)
{
int i;
for (i=0; i<len; ++i) {
- if (islower(buffer[i])) {
- buffer[i] = toupper(buffer[i]);
+ if (islower((unsigned char)buffer[i])) {
+ buffer[i] = toupper((unsigned char)buffer[i]);
} else {
- buffer[i] = tolower(buffer[i]);
+ buffer[i] = tolower((unsigned char)buffer[i]);
}
}
}
diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c
index 6877849e..2525e048 100644
--- a/modules/pam_group/pam_group.c
+++ b/modules/pam_group/pam_group.c
@@ -232,7 +232,7 @@ static int logic_member(const char *string, int *at)
break;
default:
- if (isalpha(c) || c == '*' || isdigit(c) || c == '_'
+ if (isalpha((unsigned char)c) || c == '*' || isdigit((unsigned char)c) || c == '_'
|| c == '-' || c == '.' || c == '/' || c == ':') {
token = 1;
} else if (token) {
@@ -266,7 +266,7 @@ logic_field (const pam_handle_t *pamh, const void *me,
if (next == VAL) {
if (c == '!')
not = !not;
- else if (isalpha(c) || c == '*' || isdigit(c) || c == '_'
+ else if (isalpha((unsigned char)c) || c == '*' || isdigit((unsigned char)c) || c == '_'
|| c == '-' || c == '.' || c == '/' || c == ':') {
right = not ^ agrees(pamh, me, x+at, l, rule);
if (oper == AND)
@@ -394,13 +394,13 @@ check_time (const pam_handle_t *pamh, const void *AT,
not = FALSE;
}
- for (marked_day = 0; len > 0 && isalpha(times[j]); --len) {
+ for (marked_day = 0; len > 0 && isalpha((unsigned char)times[j]); --len) {
int this_day=-1;
D(("%c%c ?", times[j], times[j+1]));
for (i=0; days[i].d != NULL; ++i) {
- if (tolower(times[j]) == days[i].d[0]
- && tolower(times[j+1]) == days[i].d[1] ) {
+ if (tolower((unsigned char)times[j]) == days[i].d[0]
+ && tolower((unsigned char)times[j+1]) == days[i].d[1] ) {
this_day = days[i].bit;
break;
}
@@ -419,7 +419,7 @@ check_time (const pam_handle_t *pamh, const void *AT,
D(("day range = 0%o", marked_day));
time_start = 0;
- for (i=0; len > 0 && i < 4 && isdigit(times[i+j]); ++i, --len) {
+ for (i=0; len > 0 && i < 4 && isdigit((unsigned char)times[i+j]); ++i, --len) {
time_start *= 10;
time_start += times[i+j]-'0'; /* is this portable? */
}
@@ -427,7 +427,7 @@ check_time (const pam_handle_t *pamh, const void *AT,
if (times[j] == '-') {
time_end = 0;
- for (i=1; len > 0 && i < 5 && isdigit(times[i+j]); ++i, --len) {
+ for (i=1; len > 0 && i < 5 && isdigit((unsigned char)times[i+j]); ++i, --len) {
time_end *= 10;
time_end += times[i+j]-'0'; /* is this portable? */
}
@@ -497,7 +497,7 @@ static int find_member(const char *string, int *at)
break;
default:
- if (isalpha(c) || isdigit(c) || c == '_' || c == '*'
+ if (isalpha((unsigned char)c) || isdigit((unsigned char)c) || c == '_' || c == '*'
|| c == '-') {
token = 1;
} else if (token) {
diff --git a/modules/pam_lastlog/pam_lastlog.c b/modules/pam_lastlog/pam_lastlog.c
index ec515f56..831dbe3b 100644
--- a/modules/pam_lastlog/pam_lastlog.c
+++ b/modules/pam_lastlog/pam_lastlog.c
@@ -205,7 +205,7 @@ get_lastlog_uid_max(pam_handle_t *pamh)
return uid_max;
ep = s + strlen(s);
- while (ep > s && isspace(*(--ep))) {
+ while (ep > s && isspace((unsigned char)*(--ep))) {
*ep = '\0';
}
errno = 0;
diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c
index 8b1755b7..cc41435f 100644
--- a/modules/pam_limits/pam_limits.c
+++ b/modules/pam_limits/pam_limits.c
@@ -852,7 +852,7 @@ parse_config_file(pam_handle_t *pamh, const char *uname, uid_t uid, gid_t gid,
line = buf;
/* skip the leading white space */
- while (*line && isspace(*line))
+ while (*line && isspace((unsigned char)*line))
line++;
/* Rip off the comments */
@@ -874,7 +874,7 @@ parse_config_file(pam_handle_t *pamh, const char *uname, uid_t uid, gid_t gid,
i, domain, ltype, item, value));
for(j=0; j < strlen(ltype); j++)
- ltype[j]=tolower(ltype[j]);
+ ltype[j]=tolower((unsigned char)ltype[j]);
if ((rngtype=parse_uid_range(pamh, domain, &min_uid, &max_uid)) < 0) {
pam_syslog(pamh, LOG_WARNING, "invalid uid range '%s' - skipped", domain);
@@ -883,9 +883,9 @@ parse_config_file(pam_handle_t *pamh, const char *uname, uid_t uid, gid_t gid,
if (i == 4) { /* a complete line */
for(j=0; j < strlen(item); j++)
- item[j]=tolower(item[j]);
+ item[j]=tolower((unsigned char)item[j]);
for(j=0; j < strlen(value); j++)
- value[j]=tolower(value[j]);
+ value[j]=tolower((unsigned char)value[j]);
if (strcmp(uname, domain) == 0) /* this user have a limit */
process_limit(pamh, LIMITS_DEF_USER, ltype, item, value, ctrl, pl);
diff --git a/modules/pam_namespace/argv_parse.c b/modules/pam_namespace/argv_parse.c
index 40510542..7d418e05 100644
--- a/modules/pam_namespace/argv_parse.c
+++ b/modules/pam_namespace/argv_parse.c
@@ -56,7 +56,7 @@ int argv_parse(const char *in_buf, int *ret_argc, char ***ret_argv)
outcp = buf;
for (cp = in_buf; (ch = *cp); cp++) {
if (state == STATE_WHITESPACE) {
- if (isspace((int) ch))
+ if (isspace((unsigned char)ch))
continue;
/* Not whitespace, so start a new token */
state = STATE_TOKEN;
@@ -81,7 +81,7 @@ int argv_parse(const char *in_buf, int *ret_argc, char ***ret_argv)
continue;
}
/* Must be processing characters in a word */
- if (isspace((int) ch)) {
+ if (isspace((unsigned char)ch)) {
/*
* Terminate the current word and start
* looking for the beginning of the next word.
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
index f34ce934..48690b8d 100644
--- a/modules/pam_namespace/pam_namespace.c
+++ b/modules/pam_namespace/pam_namespace.c
@@ -485,7 +485,7 @@ static int process_line(char *line, const char *home, const char *rhome,
/*
* skip the leading white space
*/
- while (*line && isspace(*line))
+ while (*line && isspace((unsigned char)*line))
line++;
/*
diff --git a/modules/pam_pwhistory/opasswd.c b/modules/pam_pwhistory/opasswd.c
index fc610e2f..6e44ed2a 100644
--- a/modules/pam_pwhistory/opasswd.c
+++ b/modules/pam_pwhistory/opasswd.c
@@ -199,7 +199,7 @@ check_old_pass, const char *user, const char *newpass, const char *filename, int
tmp = strchr (cp, '#'); /* remove comments */
if (tmp)
*tmp = '\0';
- while (isspace ((int)*cp)) /* remove spaces and tabs */
+ while (isspace ((unsigned char)*cp)) /* remove spaces and tabs */
++cp;
if (*cp == '\0') /* ignore empty lines */
continue;
@@ -420,7 +420,7 @@ save_old_pass, const char *user, int howmany, const char *filename, int debug UN
tmp = strchr (cp, '#'); /* remove comments */
if (tmp)
*tmp = '\0';
- while (isspace ((int)*cp)) /* remove spaces and tabs */
+ while (isspace ((unsigned char)*cp)) /* remove spaces and tabs */
++cp;
if (*cp == '\0') /* ignore empty lines */
goto write_old_data;
diff --git a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c
index 47a5cd9f..837c871b 100644
--- a/modules/pam_securetty/pam_securetty.c
+++ b/modules/pam_securetty/pam_securetty.c
@@ -148,7 +148,7 @@ securetty_perform_check (pam_handle_t *pamh, int ctrl,
return PAM_SERVICE_ERR;
}
- if (isdigit(uttyname[0])) {
+ if (isdigit((unsigned char)uttyname[0])) {
snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
} else {
ptname[0] = '\0';
diff --git a/modules/pam_sepermit/pam_sepermit.c b/modules/pam_sepermit/pam_sepermit.c
index 5fbc8fdd..7e00a77f 100644
--- a/modules/pam_sepermit/pam_sepermit.c
+++ b/modules/pam_sepermit/pam_sepermit.c
@@ -299,10 +299,10 @@ sepermit_match(pam_handle_t *pamh, const char *cfgfile, const char *user,
continue;
start = line;
- while (isspace(*start))
+ while (isspace((unsigned char)*start))
++start;
n = strlen(start);
- while (n > 0 && isspace(start[n-1])) {
+ while (n > 0 && isspace((unsigned char)start[n-1])) {
--n;
}
if (n == 0)
diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c
index 6b7adefc..af276059 100644
--- a/modules/pam_time/pam_time.c
+++ b/modules/pam_time/pam_time.c
@@ -286,7 +286,7 @@ logic_member(const char *string, int *at)
break;
default:
- if (isalpha(c) || c == '*' || isdigit(c) || c == '_'
+ if (isalpha((unsigned char)c) || c == '*' || isdigit((unsigned char)c) || c == '_'
|| c == '-' || c == '.' || c == '/' || c == ':') {
token = 1;
} else if (token) {
@@ -319,7 +319,7 @@ logic_field(pam_handle_t *pamh, const void *me, const char *x, int rule,
if (next == VAL) {
if (c == '!')
not = !not;
- else if (isalpha(c) || c == '*' || isdigit(c) || c == '_'
+ else if (isalpha((unsigned char)c) || c == '*' || isdigit((unsigned char)c) || c == '_'
|| c == '-' || c == '.' || c == '/' || c == ':') {
right = not ^ agrees(pamh, me, x+at, l, rule);
if (oper == AND)
@@ -449,13 +449,13 @@ check_time(pam_handle_t *pamh, const void *AT, const char *times,
not = FALSE;
}
- for (marked_day = 0; len > 0 && isalpha(times[j]); --len) {
+ for (marked_day = 0; len > 0 && isalpha((unsigned char)times[j]); --len) {
int this_day=-1;
D(("%c%c ?", times[j], times[j+1]));
for (i=0; days[i].d != NULL; ++i) {
- if (tolower(times[j]) == days[i].d[0]
- && tolower(times[j+1]) == days[i].d[1] ) {
+ if (tolower((unsigned char)times[j]) == days[i].d[0]
+ && tolower((unsigned char)times[j+1]) == days[i].d[1] ) {
this_day = days[i].bit;
break;
}
@@ -474,7 +474,7 @@ check_time(pam_handle_t *pamh, const void *AT, const char *times,
D(("day range = 0%o", marked_day));
time_start = 0;
- for (i=0; len > 0 && i < 4 && isdigit(times[i+j]); ++i, --len) {
+ for (i=0; len > 0 && i < 4 && isdigit((unsigned char)times[i+j]); ++i, --len) {
time_start *= 10;
time_start += times[i+j]-'0'; /* is this portable? */
}
@@ -482,7 +482,7 @@ check_time(pam_handle_t *pamh, const void *AT, const char *times,
if (times[j] == '-') {
time_end = 0;
- for (i=1; len > 0 && i < 5 && isdigit(times[i+j]); ++i, --len) {
+ for (i=1; len > 0 && i < 5 && isdigit((unsigned char)times[i+j]); ++i, --len) {
time_end *= 10;
time_end += times[i+j]-'0'; /* is this portable */
}
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
index 7bed0a56..a84ced60 100644
--- a/modules/pam_unix/support.c
+++ b/modules/pam_unix/support.c
@@ -327,7 +327,7 @@ int _unix_getpwnam(pam_handle_t *pamh, const char *name,
if ((buf[userlen] == ':') &&
(strncmp(name, buf, userlen) == 0)) {
p = buf + strlen(buf) - 1;
- while (isspace(*p) && (p >= buf)) {
+ while (isspace((unsigned char)*p) && (p >= buf)) {
*p-- = '\0';
}
matched = 1;
diff --git a/modules/pam_usertype/pam_usertype.c b/modules/pam_usertype/pam_usertype.c
index cfd9c8bb..a50a5a7c 100644
--- a/modules/pam_usertype/pam_usertype.c
+++ b/modules/pam_usertype/pam_usertype.c
@@ -169,7 +169,7 @@ pam_usertype_get_id(pam_handle_t *pamh,
/* taken from get_lastlog_uid_max() */
ep = value + strlen(value);
- while (ep > value && isspace(*(--ep))) {
+ while (ep > value && isspace((unsigned char)*(--ep))) {
*ep = '\0';
}