summaryrefslogtreecommitdiff
path: root/nslcd/passwd.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-08-27 21:22:40 +0000
committerArthur de Jong <arthur@arthurdejong.org>2011-08-27 21:22:40 +0000
commita0058c9c879aa255f480c2f7a96d2f6b34ad0c5a (patch)
treee34c9c8a668d93a31391f9a27f81ed5fde5b409a /nslcd/passwd.c
parentdb932574059069ddb8b3fe2b8c06ca854fff7342 (diff)
provide strtouid() and strtogid() functions that use strtoul() or strtoull() (thanks Jakub Hrozek)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1524 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/passwd.c')
-rw-r--r--nslcd/passwd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index d20531d..06e33c2 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=(uid_t)strtol(values[i],&tmp,0);
+ uid=strtouid(values[i],&tmp,0);
if ((*(values[i])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"passwd entry %s contains non-numeric %s value",
@@ -489,7 +489,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
else
{
errno=0;
- uids[numuids]=(uid_t)strtol(tmpvalues[numuids],&tmp,0);
+ uids[numuids]=strtouid(tmpvalues[numuids],&tmp,0);
if ((*(tmpvalues[numuids])=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"passwd entry %s contains non-numeric %s value",
@@ -527,7 +527,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
return 0;
}
errno=0;
- gid=(gid_t)strtol(gidbuf,&tmp,0);
+ gid=strtogid(gidbuf,&tmp,0);
if ((gidbuf[0]=='\0')||(*tmp!='\0'))
{
log_log(LOG_WARNING,"passwd entry %s contains non-numeric %s value",