Changeset 7b28cc85a1bc31833aad9c9189e7f8400a6bf16d

Show
Ignore:
Timestamp:
11/30/11 17:14:39 (2 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1322673279 -0500
git-parent:

[9d3260a4b8dbc4dd64a162b37f1b6fa4f460a938]

git-author:
Igor Galić <i.galic@brainsware.org> 1322661812 +0100
Message:

rename isinteger() to isuinteger(), change to use strtol() instead of strtod()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/utils/noit_security.c

    rdfec968 r7b28cc8  
    5454} 
    5555 
    56 static inline int isinteger(const char *user) { 
     56static inline int isuinteger(const char *user) { 
    5757  char *cp; 
    5858  if (user == NULL || *user == '\0' || isblank(*user)) return 0; 
    59   strtod (user, &cp)
     59  if (strtol (user, &cp, 10) < 0) return 0
    6060  return (cp == '\0'); 
    6161} 
     
    112112 
    113113  if(user) { 
    114     if(isinteger(user)) uid = atoi(user); 
     114    if(isuinteger(user)) uid = atoi(user); 
    115115    else { 
    116116      struct passwd *pw, _pw; 
     
    124124 
    125125  if(group) { 
    126     if(isinteger(group)) gid = atoi(group); 
     126    if(isuinteger(group)) gid = atoi(group); 
    127127    else { 
    128128      struct group *gr, _gr;