|
|
f5a0df |
diff -up authd-1.4.3/authd.c.jiffies64 authd-1.4.3/authd.c
|
|
|
f5a0df |
--- authd-1.4.3/authd.c.jiffies64 2004-11-16 00:25:24.000000000 +0100
|
|
|
f5a0df |
+++ authd-1.4.3/authd.c 2008-03-25 11:22:35.000000000 +0100
|
|
|
f5a0df |
@@ -347,6 +347,22 @@ static void create_opt(int argc, char *a
|
|
|
f5a0df |
|
|
|
f5a0df |
static const char *const DELIM = ",: \t\r\n\v\f";
|
|
|
f5a0df |
|
|
|
f5a0df |
+static unsigned long long get_tok_ullong(char *s, unsigned base) {
|
|
|
f5a0df |
+ unsigned long long ull = ULLONG_MAX;
|
|
|
f5a0df |
+
|
|
|
f5a0df |
+ assert(base <= 36);
|
|
|
f5a0df |
+ if ((s = strtok(s, DELIM)) != NULL) {
|
|
|
f5a0df |
+ char *endptr;
|
|
|
f5a0df |
+
|
|
|
f5a0df |
+ ull = strtoull(s, &endptr, (int) base);
|
|
|
f5a0df |
+ if ((errno == ERANGE && ull == ULLONG_MAX) || is_bad_strto(s, endptr))
|
|
|
f5a0df |
+ errno = EINVAL;
|
|
|
f5a0df |
+ }
|
|
|
f5a0df |
+ else errno = EINVAL;
|
|
|
f5a0df |
+ return ull;
|
|
|
f5a0df |
+}
|
|
|
f5a0df |
+
|
|
|
f5a0df |
+
|
|
|
f5a0df |
static unsigned long get_tok_uint(char *s, unsigned base) {
|
|
|
f5a0df |
unsigned long ul = ULONG_MAX;
|
|
|
f5a0df |
|
|
|
f5a0df |
@@ -643,7 +659,7 @@ static bool get_info(reply_t *out, reque
|
|
|
f5a0df |
(void) get_tok_uint(NULL, 16); // tx_queue
|
|
|
f5a0df |
(void) get_tok_uint(NULL, 16); // rx_queue
|
|
|
f5a0df |
(void) get_tok_uint(NULL, 16); // tr (boolean)
|
|
|
f5a0df |
- (void) get_tok_uint(NULL, 16); // tm->when (unit: jiffies)
|
|
|
f5a0df |
+ (void) get_tok_ullong(NULL, 16); // tm->when (unit: jiffies)
|
|
|
f5a0df |
strtok(NULL, DELIM); // retrnsmt
|
|
|
f5a0df |
uid = get_tok_uint(NULL, 10); // uid (base 10 uint)
|
|
|
f5a0df |
strtok(NULL, DELIM); // timeout
|