INT32...
authorStefan Metzmacher <metze@samba.org>
Tue, 15 Feb 2011 16:27:56 +0000 (17:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 May 2018 08:33:06 +0000 (10:33 +0200)
source4/dsdb/schema/schema_syntax.c

index e82b350d2004de5eb0030480b60ffd542ccefc6f..4b0a14c01d03feefe6f1169db5e57f1fa451b0b9 100644 (file)
@@ -369,7 +369,6 @@ static WERROR dsdb_syntax_INT32_validate_ldb(const struct dsdb_syntax_ctx *ctx,
 
        for (i=0; i < in->num_values; i++) {
                long v;
-               long n;
                char buf[sizeof("-2147483648")];
                char *end = NULL;
 
@@ -388,8 +387,6 @@ static WERROR dsdb_syntax_INT32_validate_ldb(const struct dsdb_syntax_ctx *ctx,
                        return WERR_DS_INVALID_ATTRIBUTE_SYNTAX;
                }
 
-               n = v & UINT32_MAX;
-
                if (n != v) {
                        DEBUG(0,("invalid[%s] n[%ld] v[%ld]\n",
                                buf, n, v));
@@ -397,13 +394,10 @@ static WERROR dsdb_syntax_INT32_validate_ldb(const struct dsdb_syntax_ctx *ctx,
                }
 
                if ((v & INT32_MIN) && buf[0] != '-') {
-                       /*
-                        * if the 0x80000000 bit is set, it is a negative
-                        * value. We need to make sure the it was given
-                        * as a negativ string value.
-                        *
-                        * We need to accept '-2147483647', but reject
-                        * '2147483649', both represent 0x80000001.
+               /*
+                               * We need to accept values between '4294967295'
+                        * and '-2147483648', but store and return values
+                        * between '2147483647' and '-2147483648'.
                         */
                        DEBUG(0,("invalid[%s] n[%ld] v[%ld]\n",
                                buf, n, v));