dsdb:schema/schema_syntax.c - correctly check error code of "ldb_string_utc_to_time"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 4 Apr 2011 19:34:12 +0000 (21:34 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 7 Apr 2011 13:53:20 +0000 (15:53 +0200)
This one doesn't set ERRNO. An error happens if the result is "0".

Reviewed-by: abartlet
source4/dsdb/schema/schema_syntax.c

index afb53377fe3ae18bb12366db3c8dd8baa6ca7ba4..ea582db68bf6ea073be27905f6f7f8b492275fd6 100644 (file)
@@ -637,9 +637,8 @@ static WERROR dsdb_syntax_NTTIME_UTC_validate_ldb(const struct dsdb_syntax_ctx *
                }
                memcpy(buf, in->values[i].data, in->values[i].length);
 
-               errno = 0;
                t = ldb_string_utc_to_time(buf);
-               if (errno != 0) {
+               if (t == 0) {
                        return WERR_DS_INVALID_ATTRIBUTE_SYNTAX;
                }