--- authd.c.orig 2013-07-25 09:31:23.000000000 +0100 +++ authd.c 2013-07-17 11:59:53.000000000 +0100 @@ -381,6 +381,23 @@ return ul; } +static long get_tok_int(char *s, unsigned base) { + + long l = LONG_MAX; + + assert(base <= 36); + if ((s = strtok(s, DELIM)) != NULL) { + char *endptr; + + l = strtol(s, &endptr, (int) base); + if (l > INT_MAX || is_bad_strto(s, endptr)) + errno = EINVAL; + } + else errno = EINVAL; + return l; +} + + static void destroy_opt(void) { free(opt.codeset); free(opt.Encrypt); free(opt.ident); free(opt.lang); free(opt.Noident); free(opt.os); free(opt.passwd); free(opt.mapped); @@ -603,7 +620,9 @@ static const char *const TEXT_READ_MODE = "r"; // passphrase, /proc plaintext static bool get_info(reply_t *out, request_t in, const char *tcpname) { - unsigned long lport, rport, uid, status; FILE *stream; + //unsigned long lport, rport, uid, status; FILE *stream; + unsigned long lport, rport, status; FILE *stream; + long uid; const unsigned long ESTABLISHED = 0x01; unsigned lineno = 0; char *laddr = NULL, *raddr = NULL; @@ -675,7 +694,8 @@ (void) get_tok_uint(NULL, 16); // tr (boolean) (void) get_tok_ullong(NULL, 16); // tm->when (unit: jiffies) strtok(NULL, DELIM); // retrnsmt - uid = get_tok_uint(NULL, 10); // uid (base 10 uint) + //uid = get_tok_uint(NULL, 10); // uid (base 10 uint) + uid = get_tok_int(NULL, 10); // uid (base 10 int) strtok(NULL, DELIM); // timeout inode = get_tok_uint(NULL, 10); // inode (base 10 uint) if (errno == EINVAL) {