rpms/authd/devel authd-1.4.3-jiffies64.patch, 1.3, 1.4 authd.spec, 1.56, 1.57

Roman Rakus rrakus at fedoraproject.org
Thu Apr 9 11:57:02 UTC 2009


Author: rrakus

Update of /cvs/extras/rpms/authd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18807

Modified Files:
	authd-1.4.3-jiffies64.patch authd.spec 
Log Message:
get back to older version of jiffies64 patch

authd-1.4.3-jiffies64.patch:

Index: authd-1.4.3-jiffies64.patch
===================================================================
RCS file: /cvs/extras/rpms/authd/devel/authd-1.4.3-jiffies64.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- authd-1.4.3-jiffies64.patch	29 Apr 2008 11:44:53 -0000	1.3
+++ authd-1.4.3-jiffies64.patch	9 Apr 2009 11:56:31 -0000	1.4
@@ -1,115 +1,35 @@
 diff -up authd-1.4.3/authd.c.jiffies64 authd-1.4.3/authd.c
---- authd-1.4.3/authd.c.jiffies64	2008-04-29 12:25:05.000000000 +0200
-+++ authd-1.4.3/authd.c	2008-04-29 13:33:18.000000000 +0200
-@@ -169,8 +169,13 @@ static bool is_rfc1413_token(const char 
-     return is_in_range((size_t) 1, strlen(s), (size_t) 64);
- }
- 
--static bool is_bad_strto(const char *s, const char *endptr) {
--    if (errno == ERANGE || errno == EINVAL) return true;
-+static bool is_bad_strtoul(unsigned long ul, const char *s, const char *endptr) {
-+    if ((ul == ULONG_MAX && errno == ERANGE) || errno == EINVAL) return true;
-+    return endptr == s || (*endptr != '\0' && !isspace(*endptr));
-+}
-+
-+static bool is_bad_strtoull(unsigned long long ull, const char *s, const char *endptr) {
-+    if ((ull == ULLONG_MAX && errno == ERANGE) || errno == EINVAL) return true;
-     return endptr == s || (*endptr != '\0' && !isspace(*endptr));
- }
- 
-@@ -253,7 +258,7 @@ static void create_opt(int argc, char *a
-             case 'l':
-                 if (optarg != NULL) {
-                     lu = strtoul(optarg, &endptr, 0);
--                    if (lu > UINT_MAX || is_bad_strto(optarg, endptr))
-+                    if (lu > UINT_MAX || is_bad_strtoul(lu, optarg, endptr))
-                         handle_error(C_FMT, *argv, c, optarg);
-                     else opt.log_mask = (int) lu;
-                     setlogmask(opt.log_mask);
-@@ -263,7 +268,7 @@ static void create_opt(int argc, char *a
-             case 'm':
-                 if (optarg != NULL) {
-                     opt.multiquery = strtoull(optarg, &endptr, 10);
--                    if (is_bad_strto(optarg, endptr))
-+                    if (is_bad_strtoull(opt.multiquery, optarg, endptr))
-                         handle_error(C_FMT, *argv, c, optarg);
-                 }
-                 else opt.multiquery = ULLONG_MAX;
-@@ -275,7 +280,7 @@ static void create_opt(int argc, char *a
-             case 'o': opt.other = true; break;
-             case 't':
-                 lu = optarg == NULL ? DFL_T_O : strtoul(optarg, &endptr, 10);
--                if (lu > UINT_MAX || is_bad_strto(optarg, endptr))
-+                if (lu > UINT_MAX || is_bad_strtoul(lu, optarg, endptr))
-                     handle_error(C_FMT, *argv, c, optarg);
-                 else if (lu < 30) {
-                     log_notice(_("Timeout's too low; Raising to 30.\n"));
-@@ -294,7 +299,7 @@ static void create_opt(int argc, char *a
-             case FN_LONGOPT:
-                 if (optarg != NULL) {
-                     lu = strtoul(optarg, &endptr, 10);
--                    if (lu > UINT_MAX || is_bad_strto(optarg, endptr))
-+                    if (lu > UINT_MAX || is_bad_strtoul(lu, optarg, endptr))
-                         handle_error(S_FMT, *argv, LONG_OPTS[i].name, optarg);
-                     else opt.fn = (unsigned) lu;
-                 }
-@@ -347,7 +352,7 @@ static void create_opt(int argc, char *a
+--- authd-1.4.3/authd.c.jiffies64	2004-11-16 00:25:24.000000000 +0100
++++ authd-1.4.3/authd.c	2008-03-25 11:22:35.000000000 +0100
+@@ -347,6 +347,22 @@ static void create_opt(int argc, char *a
  
  static const char *const DELIM = ",: \t\r\n\v\f";
  
--static unsigned long get_tok_uint(char *s, unsigned base) {
-+static unsigned long get_tok_ulong(char *s, unsigned base) {
-     unsigned long ul = ULONG_MAX;
- 
-     assert(base <= 36);
-@@ -355,13 +360,21 @@ static unsigned long get_tok_uint(char *
-         char *endptr;
- 
-         ul = strtoul(s, &endptr, (int) base);
--        if (ul > UINT_MAX || is_bad_strto(s, endptr))
-+        if (ul > UINT_MAX || is_bad_strtoul(ul, s, endptr))
-             errno = EINVAL;
-     }
-     else errno = EINVAL;
-     return ul;
- }
- 
-+static unsigned int get_tok_uint(char *s, unsigned base) {
-+    unsigned long ul = get_tok_ulong(s, base);
-+    if (ul > UINT_MAX)
-+        errno = EINVAL;
-+    return ul;
++static unsigned long long get_tok_ullong(char *s, unsigned base) {
++    unsigned long long ull = ULLONG_MAX;
++
++    assert(base <= 36);
++    if ((s = strtok(s, DELIM)) != NULL) {
++        char *endptr;
++
++        ull = strtoull(s, &endptr, (int) base);
++        if ((errno == ERANGE && ull == ULLONG_MAX) || is_bad_strto(s, endptr))
++            errno = EINVAL;
++    }
++    else errno = EINVAL;
++    return ull;
 +}
 +
 +
- 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);
-@@ -510,7 +523,7 @@ static char *get_created_tok_addr(const 
+ static unsigned long get_tok_uint(char *s, unsigned base) {
+     unsigned long ul = ULONG_MAX;
  
-                 addr_hex[z] = '\0'; z -= HEX_DIG;
-                 ul = strtoul(addr_hex + z, &endptr, 16);
--                if (is_bad_strto(addr_hex + z, endptr)) {
-+                if (is_bad_strtoul(ul, addr_hex + z, endptr)) {
-                     errno = EINVAL; return NULL;
-                 }
- 	        if ((!IS_IPV4 || 6 == z) && is_16_bits)
-@@ -654,9 +667,17 @@ static bool get_info(reply_t *out, reque
+@@ -643,7 +659,7 @@ static bool get_info(reply_t *out, reque
          (void) get_tok_uint(NULL, 16);            // tx_queue
          (void) get_tok_uint(NULL, 16);            // rx_queue
          (void) get_tok_uint(NULL, 16);            // tr (boolean)
 -        (void) get_tok_uint(NULL, 16);            // tm->when (unit: jiffies)
-+	/* as of 2.4.18 this is sa long in the kernel thus it is 32b on 32b 
-+	   platforms and 64b on 64b platforms. 32b platforms also have a 
-+	   jiffies_64 but that is not what is exported so we don't have to use
-+	   a long long on 32b platforms.
-+	   Ref: net/ipv4/tcp_ipv4.c:get_tcp_sock()	   
-+	*/
-+        (void) get_tok_ulong(NULL, 16);            // tm->when (unit: jiffies)
++        (void) get_tok_ullong(NULL, 16);            // tm->when (unit: jiffies)
          strtok(NULL, DELIM);                      // retrnsmt
          uid = get_tok_uint(NULL, 10);             // uid (base 10 uint)
-+
-+	// beware using timeout. It is a long and may be 64b.
          strtok(NULL, DELIM);                      // timeout
-         inode = get_tok_uint(NULL, 10);           // inode (base 10 uint)
-         if (errno == EINVAL) {


Index: authd.spec
===================================================================
RCS file: /cvs/extras/rpms/authd/devel/authd.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- authd.spec	31 Mar 2009 16:34:04 -0000	1.56
+++ authd.spec	9 Apr 2009 11:56:31 -0000	1.57
@@ -1,7 +1,7 @@
 Summary: A RFC 1413 ident protocol daemon
 Name: authd
 Version: 1.4.3
-Release: 25%{?dist}
+Release: 26%{?dist}
 License: GPLv2+
 Group: System Environment/Daemons
 URL: https://fedorahosted.org/authd/
@@ -75,6 +75,9 @@
 %{_sbindir}/in.authd
 
 %changelog
+* Thu Apr 09 2009 Roman Rakus <rrakus at redhat.com> - 1.4.3-26
+- get back to older version of jiffies64 patch
+
 * Tue Mar 31 2009 Roman Rakus <rrakus at redhat.com> - 1.4.3-25
 - Fixed source tag
 




More information about the fedora-extras-commits mailing list