summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-09-30 11:48:21 +0000
committerJakub Hrozek <jhrozek@redhat.com>2011-09-30 11:48:21 +0000
commitd466186b241d36ab51f43c7c2f61037624735bd3 (patch)
treee1071d07e96a17d26f93dbc7d8f5b573dee411c9
parente284523521a8aa2b529240ea741978bfdd723215 (diff)
Use an explicit base of 10 for strtouid()/strtogid()/strtol() calls
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1547 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/cfg.c4
-rw-r--r--nslcd/group.c2
-rw-r--r--nslcd/passwd.c6
-rw-r--r--nslcd/protocol.c2
-rw-r--r--nslcd/rpc.c2
-rw-r--r--nslcd/service.c2
-rw-r--r--nslcd/shadow.c6
7 files changed, 12 insertions, 12 deletions
diff --git a/nslcd/cfg.c b/nslcd/cfg.c
index 00dd8c4..e5c3b1a 100644
--- a/nslcd/cfg.c
+++ b/nslcd/cfg.c
@@ -431,7 +431,7 @@ static void get_uid(const char *filename,int lnr,
check_argumentcount(filename,lnr,keyword,get_token(line,token,sizeof(token))!=NULL);
/* check if it is a valid numerical uid */
errno=0;
- *var=strtouid(token,&tmp,0);
+ *var=strtouid(token,&tmp,10);
if ((*token!='\0')&&(*tmp=='\0')&&(errno==0))
return;
/* find by name */
@@ -457,7 +457,7 @@ static void get_gid(const char *filename,int lnr,
check_argumentcount(filename,lnr,keyword,get_token(line,token,sizeof(token))!=NULL);
/* check if it is a valid numerical gid */
errno=0;
- *var=strtogid(token,&tmp,0);
+ *var=strtogid(token,&tmp,10);
if ((*token!='\0')&&(*tmp=='\0')&&(errno==0))
return;
/* find by name */
diff --git a/nslcd/group.c b/nslcd/group.c
index 41d8f8f..4725295 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -281,7 +281,7 @@ static int write_group(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqname,
else
{
errno=0;
- gids[numgids]=strtogid(gidvalues[numgids],&tmp,0);
+ gids[numgids]=strtogid(gidvalues[numgids],&tmp,10);
if ((*(gidvalues[numgids])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index ab097c6..9eba10c 100644
--- a/nslcd/passwd.c
+++ b/nslcd/passwd.c
@@ -195,7 +195,7 @@ static int entry_has_valid_uid(MYLDAP_ENTRY *entry)
else
{
errno=0;
- uid=strtouid(values[i],&tmp,0);
+ uid=strtouid(values[i],&tmp,10);
if ((*(values[i])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
@@ -492,7 +492,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
else
{
errno=0;
- uids[numuids]=strtouid(tmpvalues[numuids],&tmp,0);
+ uids[numuids]=strtouid(tmpvalues[numuids],&tmp,10);
if ((*(tmpvalues[numuids])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
@@ -530,7 +530,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
return 0;
}
errno=0;
- gid=strtogid(gidbuf,&tmp,0);
+ gid=strtogid(gidbuf,&tmp,10);
if ((gidbuf[0]=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
diff --git a/nslcd/protocol.c b/nslcd/protocol.c
index 45d1f9e..90327b8 100644
--- a/nslcd/protocol.c
+++ b/nslcd/protocol.c
@@ -144,7 +144,7 @@ static int write_protocol(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqname)
myldap_get_dn(entry),attmap_protocol_ipProtocolNumber);
}
errno=0;
- proto=(int)strtol(protos[0],&tmp,0);
+ proto=(int)strtol(protos[0],&tmp,10);
if ((*(protos[0])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
diff --git a/nslcd/rpc.c b/nslcd/rpc.c
index 68d0f9b..90cb89e 100644
--- a/nslcd/rpc.c
+++ b/nslcd/rpc.c
@@ -145,7 +145,7 @@ static int write_rpc(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqname)
myldap_get_dn(entry),attmap_rpc_oncRpcNumber);
}
errno=0;
- number=(int)strtol(numbers[0],&tmp,0);
+ number=(int)strtol(numbers[0],&tmp,10);
if ((*(numbers[0])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",
diff --git a/nslcd/service.c b/nslcd/service.c
index f8a08bc..d0db52d 100644
--- a/nslcd/service.c
+++ b/nslcd/service.c
@@ -173,7 +173,7 @@ static int write_service(TFILE *fp,MYLDAP_ENTRY *entry,
myldap_get_dn(entry),attmap_service_ipServicePort);
}
errno=0;
- port=(int)strtol(ports[0],&tmp,0);
+ port=(int)strtol(ports[0],&tmp,10);
if ((*(ports[0])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric value",
diff --git a/nslcd/shadow.c b/nslcd/shadow.c
index df7f18b..eb5ffcb 100644
--- a/nslcd/shadow.c
+++ b/nslcd/shadow.c
@@ -130,7 +130,7 @@ static long to_date(const char *dn,const char *date,const char *attr)
strncpy(buffer,date,l);
buffer[l]='\0';
errno=0;
- value=strtol(date,&tmp,0);
+ value=strtol(date,&tmp,10);
if ((*date=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",dn,attr);
@@ -146,7 +146,7 @@ static long to_date(const char *dn,const char *date,const char *attr)
and some value that needs to be added */
}
errno=0;
- value=strtol(date,&tmp,0);
+ value=strtol(date,&tmp,10);
if ((*date=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"%s: %s: non-numeric",dn,attr);
@@ -169,7 +169,7 @@ static long to_date(const char *dn,const char *date,const char *attr)
if (tmpvalue==NULL) \
tmpvalue=""; \
errno=0; \
- var=strtol(tmpvalue,&tmp,0); \
+ var=strtol(tmpvalue,&tmp,10); \
if ((*(tmpvalue)=='\0')||(*tmp!='\0')) \
{ \
log_log(LOG_WARNING,"%s: %s: non-numeric", \