Fix warning messages caused by addition of null check in fstrcpy macro.
[ira/wip.git] / source3 / libnet / libnet_dssync_passdb.c
index 585428ad7574563ba1f3b19d2c60502b48d9ae27..7380efabb8adc2e3b7c8535b7ea2c2e9652caf10 100644 (file)
 */
 
 #include "includes.h"
+#include "system/passwd.h"
 #include "libnet/libnet_dssync.h"
 #include "libnet/libnet_samsync.h"
 #include "../libcli/security/security.h"
 #include "../libds/common/flags.h"
 #include "../librpc/gen_ndr/ndr_drsuapi.h"
 #include "dbwrap.h"
+#include "../libds/common/flag_mapping.h"
+#include "passdb.h"
 
 /****************************************************************
 ****************************************************************/
@@ -445,8 +448,6 @@ static int dssync_passdb_traverse_gmembers(struct db_record *rec,
 
        state->idx++;
 
-       DEBUG(0,("%s[%u]...\n", state->name, state->idx));
-
        group_sid = state->obj->cur->object.identifier->sid;
 
        status = dom_sid_split_rid(talloc_tos(), &group_sid, NULL, &rid);
@@ -568,8 +569,6 @@ static int dssync_passdb_traverse_groups(struct db_record *rec,
                return -1;
        }
 
-       DEBUG(0,("%s[%u]...\n", state->name, state->idx));
-
        obj = dssync_parse_obj(rec->value);
        if (obj == NULL) {
                return -1;
@@ -1267,7 +1266,8 @@ static NTSTATUS sam_account_from_object(struct samu *account,
                pdb_sethexhours(oldstr, pdb_get_hours(account));
                pdb_sethexhours(newstr, logonHours.data);
                if (!strequal(oldstr, newstr)) {
-                       pdb_set_hours(account, logonHours.data, PDB_CHANGED);
+                       pdb_set_hours(account, logonHours.data,
+                                     logonHours.length, PDB_CHANGED);
                }
        }
 
@@ -1531,11 +1531,11 @@ static NTSTATUS handle_alias_object(struct dssync_passdb *pctx,
                map.sid_name_use = SID_NAME_ALIAS;
        }
 
-       fstrcpy(map.nt_name, name);
+       strlcpy(map.nt_name, name, sizeof(map.nt_name));
        if (description) {
-               fstrcpy(map.comment, comment);
+               strlcpy(map.comment, comment, sizeof(map.comment));
        } else {
-               fstrcpy(map.comment, "");
+               strlcpy(map.comment, "", sizeof(map.comment));
        }
 
        if (insert)
@@ -1636,11 +1636,11 @@ static NTSTATUS handle_group_object(struct dssync_passdb *pctx,
        map.gid = grp->gr_gid;
        map.sid = group_sid;
        map.sid_name_use = SID_NAME_DOM_GRP;
-       fstrcpy(map.nt_name, name);
+       strlcpy(map.nt_name, name, sizeof(map.nt_name));
        if (description) {
-               fstrcpy(map.comment, comment);
+               strlcpy(map.comment, comment, sizeof(map.comment));
        } else {
-               fstrcpy(map.comment, "");
+               strlcpy(map.comment, "", sizeof(map.comment));
        }
 
        if (insert)