ldb:fix control parsing for dirsync
authorMatthieu Patou <mat@matws.net>
Fri, 4 Mar 2011 21:03:12 +0000 (00:03 +0300)
committerMatthieu Patou <mat@samba.org>
Sun, 20 Mar 2011 10:27:25 +0000 (11:27 +0100)
source4/lib/ldb/common/ldb_controls.c

index 5a86bde2116369afb56863c7df59dcec84a207d6..5048b6deac397f57225c85ee441d28aab2505fb4 100644 (file)
@@ -465,11 +465,12 @@ struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLO
                struct ldb_dirsync_control *control;
                const char *p;
                char cookie[1024];
-               int crit, flags, max_attrs, ret;
+               int crit, max_attrs, ret;
+               uint32_t flags;
                
                cookie[0] = '\0';
                p = &(control_strings[sizeof(LDB_CONTROL_DIRSYNC_NAME)]);
-               ret = sscanf(p, "%d:%d:%d:%1023[^$]", &crit, &flags, &max_attrs, cookie);
+               ret = sscanf(p, "%d:%u:%d:%1023[^$]", &crit, &flags, &max_attrs, cookie);
 
                if ((ret < 3) || (crit < 0) || (crit > 1) || (flags < 0) || (max_attrs < 0)) {
                        error_string = talloc_asprintf(mem_ctx, "invalid dirsync control syntax\n");