2 Unix SMB/CIFS implementation.
3 dump the remote SAM using rpc samsync operations
5 Copyright (C) Andrew Tridgell 2002
6 Copyright (C) Tim Potter 2001,2002
7 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2005
8 Modified by Volker Lendecke 2002
9 Copyright (C) Jeremy Allison 2005.
10 Copyright (C) Guenther Deschner 2008.
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include "libnet/libnet.h"
29 /* Convert a struct samu_DELTA to a struct samu. */
30 #define STRING_CHANGED (old_string && !new_string) ||\
31 (!old_string && new_string) ||\
32 (old_string && new_string && (strcmp(old_string, new_string) != 0))
34 #define STRING_CHANGED_NC(s1,s2) ((s1) && !(s2)) ||\
36 ((s1) && (s2) && (strcmp((s1), (s2)) != 0))
38 static NTSTATUS
sam_account_from_delta(struct samu
*account
,
39 struct netr_DELTA_USER
*r
)
41 const char *old_string
, *new_string
;
42 time_t unix_time
, stored_time
;
43 uchar lm_passwd
[16], nt_passwd
[16];
44 static uchar zero_buf
[16];
46 /* Username, fullname, home dir, dir drive, logon script, acct
47 desc, workstations, profile. */
49 if (r
->account_name
.string
) {
50 old_string
= pdb_get_nt_username(account
);
51 new_string
= r
->account_name
.string
;
54 pdb_set_nt_username(account
, new_string
, PDB_CHANGED
);
57 /* Unix username is the same - for sanity */
58 old_string
= pdb_get_username( account
);
60 pdb_set_username(account
, new_string
, PDB_CHANGED
);
64 if (r
->full_name
.string
) {
65 old_string
= pdb_get_fullname(account
);
66 new_string
= r
->full_name
.string
;
69 pdb_set_fullname(account
, new_string
, PDB_CHANGED
);
72 if (r
->home_directory
.string
) {
73 old_string
= pdb_get_homedir(account
);
74 new_string
= r
->home_directory
.string
;
77 pdb_set_homedir(account
, new_string
, PDB_CHANGED
);
80 if (r
->home_drive
.string
) {
81 old_string
= pdb_get_dir_drive(account
);
82 new_string
= r
->home_drive
.string
;
85 pdb_set_dir_drive(account
, new_string
, PDB_CHANGED
);
88 if (r
->logon_script
.string
) {
89 old_string
= pdb_get_logon_script(account
);
90 new_string
= r
->logon_script
.string
;
93 pdb_set_logon_script(account
, new_string
, PDB_CHANGED
);
96 if (r
->description
.string
) {
97 old_string
= pdb_get_acct_desc(account
);
98 new_string
= r
->description
.string
;
101 pdb_set_acct_desc(account
, new_string
, PDB_CHANGED
);
104 if (r
->workstations
.string
) {
105 old_string
= pdb_get_workstations(account
);
106 new_string
= r
->workstations
.string
;
109 pdb_set_workstations(account
, new_string
, PDB_CHANGED
);
112 if (r
->profile_path
.string
) {
113 old_string
= pdb_get_profile_path(account
);
114 new_string
= r
->profile_path
.string
;
117 pdb_set_profile_path(account
, new_string
, PDB_CHANGED
);
120 if (r
->parameters
.string
) {
123 old_string
= pdb_get_munged_dial(account
);
124 mung
.length
= r
->parameters
.length
;
125 mung
.data
= (uint8
*) r
->parameters
.string
;
126 newstr
= (mung
.length
== 0) ? NULL
:
127 base64_encode_data_blob(talloc_tos(), mung
);
129 if (STRING_CHANGED_NC(old_string
, newstr
))
130 pdb_set_munged_dial(account
, newstr
, PDB_CHANGED
);
134 /* User and group sid */
135 if (pdb_get_user_rid(account
) != r
->rid
)
136 pdb_set_user_sid_from_rid(account
, r
->rid
, PDB_CHANGED
);
137 if (pdb_get_group_rid(account
) != r
->primary_gid
)
138 pdb_set_group_sid_from_rid(account
, r
->primary_gid
, PDB_CHANGED
);
140 /* Logon and password information */
141 if (!nt_time_is_zero(&r
->last_logon
)) {
142 unix_time
= nt_time_to_unix(r
->last_logon
);
143 stored_time
= pdb_get_logon_time(account
);
144 if (stored_time
!= unix_time
)
145 pdb_set_logon_time(account
, unix_time
, PDB_CHANGED
);
148 if (!nt_time_is_zero(&r
->last_logoff
)) {
149 unix_time
= nt_time_to_unix(r
->last_logoff
);
150 stored_time
= pdb_get_logoff_time(account
);
151 if (stored_time
!= unix_time
)
152 pdb_set_logoff_time(account
, unix_time
,PDB_CHANGED
);
156 if (pdb_get_logon_divs(account
) != r
->logon_hours
.units_per_week
)
157 pdb_set_logon_divs(account
, r
->logon_hours
.units_per_week
, PDB_CHANGED
);
160 /* no idea what to do with this one - gd */
161 /* Max Logon Hours */
162 if (delta
->unknown1
!= pdb_get_unknown_6(account
)) {
163 pdb_set_unknown_6(account
, delta
->unknown1
, PDB_CHANGED
);
166 /* Logon Hours Len */
167 if (r
->logon_hours
.units_per_week
/8 != pdb_get_hours_len(account
)) {
168 pdb_set_hours_len(account
, r
->logon_hours
.units_per_week
/8, PDB_CHANGED
);
172 if (r
->logon_hours
.bits
) {
173 char oldstr
[44], newstr
[44];
174 pdb_sethexhours(oldstr
, pdb_get_hours(account
));
175 pdb_sethexhours(newstr
, r
->logon_hours
.bits
);
176 if (!strequal(oldstr
, newstr
))
177 pdb_set_hours(account
, r
->logon_hours
.bits
, PDB_CHANGED
);
180 if (pdb_get_bad_password_count(account
) != r
->bad_password_count
)
181 pdb_set_bad_password_count(account
, r
->bad_password_count
, PDB_CHANGED
);
183 if (pdb_get_logon_count(account
) != r
->logon_count
)
184 pdb_set_logon_count(account
, r
->logon_count
, PDB_CHANGED
);
186 if (!nt_time_is_zero(&r
->last_password_change
)) {
187 unix_time
= nt_time_to_unix(r
->last_password_change
);
188 stored_time
= pdb_get_pass_last_set_time(account
);
189 if (stored_time
!= unix_time
)
190 pdb_set_pass_last_set_time(account
, unix_time
, PDB_CHANGED
);
192 /* no last set time, make it now */
193 pdb_set_pass_last_set_time(account
, time(NULL
), PDB_CHANGED
);
196 if (!nt_time_is_zero(&r
->acct_expiry
)) {
197 unix_time
= nt_time_to_unix(r
->acct_expiry
);
198 stored_time
= pdb_get_kickoff_time(account
);
199 if (stored_time
!= unix_time
)
200 pdb_set_kickoff_time(account
, unix_time
, PDB_CHANGED
);
203 /* Decode hashes from password hash
204 Note that win2000 may send us all zeros for the hashes if it doesn't
205 think this channel is secure enough - don't set the passwords at all
208 if (memcmp(r
->ntpassword
.hash
, zero_buf
, 16) != 0) {
209 sam_pwd_hash(r
->rid
, r
->ntpassword
.hash
, lm_passwd
, 0);
210 pdb_set_lanman_passwd(account
, lm_passwd
, PDB_CHANGED
);
213 if (memcmp(r
->lmpassword
.hash
, zero_buf
, 16) != 0) {
214 sam_pwd_hash(r
->rid
, r
->lmpassword
.hash
, nt_passwd
, 0);
215 pdb_set_nt_passwd(account
, nt_passwd
, PDB_CHANGED
);
218 /* TODO: account expiry time */
220 pdb_set_acct_ctrl(account
, r
->acct_flags
, PDB_CHANGED
);
222 pdb_set_domain(account
, lp_workgroup(), PDB_CHANGED
);
227 static NTSTATUS
fetch_account_info(uint32_t rid
,
228 struct netr_DELTA_USER
*r
)
231 NTSTATUS nt_ret
= NT_STATUS_UNSUCCESSFUL
;
233 char *add_script
= NULL
;
234 struct samu
*sam_account
=NULL
;
239 struct passwd
*passwd
;
242 fstrcpy(account
, r
->account_name
.string
);
243 d_printf("Creating account: %s\n", account
);
245 if ( !(sam_account
= samu_new( NULL
)) ) {
246 return NT_STATUS_NO_MEMORY
;
249 if (!(passwd
= Get_Pwnam_alloc(sam_account
, account
))) {
250 /* Create appropriate user */
251 if (r
->acct_flags
& ACB_NORMAL
) {
252 add_script
= talloc_strdup(sam_account
,
253 lp_adduser_script());
254 } else if ( (r
->acct_flags
& ACB_WSTRUST
) ||
255 (r
->acct_flags
& ACB_SVRTRUST
) ||
256 (r
->acct_flags
& ACB_DOMTRUST
) ) {
257 add_script
= talloc_strdup(sam_account
,
258 lp_addmachine_script());
260 DEBUG(1, ("Unknown user type: %s\n",
261 pdb_encode_acct_ctrl(r
->acct_flags
, NEW_PW_FORMAT_SPACE_PADDED_LEN
)));
262 nt_ret
= NT_STATUS_UNSUCCESSFUL
;
266 nt_ret
= NT_STATUS_NO_MEMORY
;
271 add_script
= talloc_all_string_sub(sam_account
,
276 nt_ret
= NT_STATUS_NO_MEMORY
;
279 add_ret
= smbrun(add_script
,NULL
);
280 DEBUG(add_ret
? 0 : 1,("fetch_account: Running the command `%s' "
281 "gave %d\n", add_script
, add_ret
));
283 smb_nscd_flush_user_cache();
287 /* try and find the possible unix account again */
288 if ( !(passwd
= Get_Pwnam_alloc(sam_account
, account
)) ) {
289 d_fprintf(stderr
, "Could not create posix account info for '%s'\n", account
);
290 nt_ret
= NT_STATUS_NO_SUCH_USER
;
295 sid_copy(&user_sid
, get_global_sam_sid());
296 sid_append_rid(&user_sid
, r
->rid
);
298 DEBUG(3, ("Attempting to find SID %s for user %s in the passdb\n",
299 sid_to_fstring(sid_string
, &user_sid
), account
));
300 if (!pdb_getsampwsid(sam_account
, &user_sid
)) {
301 sam_account_from_delta(sam_account
, r
);
302 DEBUG(3, ("Attempting to add user SID %s for user %s in the passdb\n",
303 sid_to_fstring(sid_string
, &user_sid
),
304 pdb_get_username(sam_account
)));
305 if (!NT_STATUS_IS_OK(pdb_add_sam_account(sam_account
))) {
306 DEBUG(1, ("SAM Account for %s failed to be added to the passdb!\n",
308 return NT_STATUS_ACCESS_DENIED
;
311 sam_account_from_delta(sam_account
, r
);
312 DEBUG(3, ("Attempting to update user SID %s for user %s in the passdb\n",
313 sid_to_fstring(sid_string
, &user_sid
),
314 pdb_get_username(sam_account
)));
315 if (!NT_STATUS_IS_OK(pdb_update_sam_account(sam_account
))) {
316 DEBUG(1, ("SAM Account for %s failed to be updated in the passdb!\n",
318 TALLOC_FREE(sam_account
);
319 return NT_STATUS_ACCESS_DENIED
;
323 if (pdb_get_group_sid(sam_account
) == NULL
) {
324 return NT_STATUS_UNSUCCESSFUL
;
327 group_sid
= *pdb_get_group_sid(sam_account
);
329 if (!pdb_getgrsid(&map
, group_sid
)) {
330 DEBUG(0, ("Primary group of %s has no mapping!\n",
331 pdb_get_username(sam_account
)));
333 if (map
.gid
!= passwd
->pw_gid
) {
334 if (!(grp
= getgrgid(map
.gid
))) {
335 DEBUG(0, ("Could not find unix group %lu for user %s (group SID=%s)\n",
336 (unsigned long)map
.gid
, pdb_get_username(sam_account
), sid_string_tos(&group_sid
)));
338 smb_set_primary_group(grp
->gr_name
, pdb_get_username(sam_account
));
344 DEBUG(1, ("No unix user for this account (%s), cannot adjust mappings\n",
345 pdb_get_username(sam_account
)));
349 TALLOC_FREE(sam_account
);
353 static NTSTATUS
fetch_group_info(uint32_t rid
,
354 struct netr_DELTA_GROUP
*r
)
358 struct group
*grp
= NULL
;
364 fstrcpy(name
, r
->group_name
.string
);
365 fstrcpy(comment
, r
->description
.string
);
367 /* add the group to the mapping table */
368 sid_copy(&group_sid
, get_global_sam_sid());
369 sid_append_rid(&group_sid
, rid
);
370 sid_to_fstring(sid_string
, &group_sid
);
372 if (pdb_getgrsid(&map
, group_sid
)) {
374 grp
= getgrgid(map
.gid
);
381 /* No group found from mapping, find it from its name. */
382 if ((grp
= getgrnam(name
)) == NULL
) {
384 /* No appropriate group found, create one */
386 d_printf("Creating unix group: '%s'\n", name
);
388 if (smb_create_group(name
, &gid
) != 0)
389 return NT_STATUS_ACCESS_DENIED
;
391 if ((grp
= getgrnam(name
)) == NULL
)
392 return NT_STATUS_ACCESS_DENIED
;
396 map
.gid
= grp
->gr_gid
;
398 map
.sid_name_use
= SID_NAME_DOM_GRP
;
399 fstrcpy(map
.nt_name
, name
);
400 if (r
->description
.string
) {
401 fstrcpy(map
.comment
, comment
);
403 fstrcpy(map
.comment
, "");
407 pdb_add_group_mapping_entry(&map
);
409 pdb_update_group_mapping_entry(&map
);
414 static NTSTATUS
fetch_group_mem_info(uint32_t rid
,
415 struct netr_DELTA_GROUP_MEMBER
*r
)
418 TALLOC_CTX
*t
= NULL
;
419 char **nt_members
= NULL
;
425 if (r
->num_rids
== 0) {
429 sid_copy(&group_sid
, get_global_sam_sid());
430 sid_append_rid(&group_sid
, rid
);
432 if (!get_domain_group_from_sid(group_sid
, &map
)) {
433 DEBUG(0, ("Could not find global group %d\n", rid
));
434 return NT_STATUS_NO_SUCH_GROUP
;
437 if (!(grp
= getgrgid(map
.gid
))) {
438 DEBUG(0, ("Could not find unix group %lu\n", (unsigned long)map
.gid
));
439 return NT_STATUS_NO_SUCH_GROUP
;
442 d_printf("Group members of %s: ", grp
->gr_name
);
444 if (!(t
= talloc_init("fetch_group_mem_info"))) {
445 DEBUG(0, ("could not talloc_init\n"));
446 return NT_STATUS_NO_MEMORY
;
450 if ((nt_members
= TALLOC_ZERO_ARRAY(t
, char *, r
->num_rids
)) == NULL
) {
451 DEBUG(0, ("talloc failed\n"));
453 return NT_STATUS_NO_MEMORY
;
459 for (i
=0; i
< r
->num_rids
; i
++) {
460 struct samu
*member
= NULL
;
463 if ( !(member
= samu_new(t
)) ) {
465 return NT_STATUS_NO_MEMORY
;
468 sid_copy(&member_sid
, get_global_sam_sid());
469 sid_append_rid(&member_sid
, r
->rids
[i
]);
471 if (!pdb_getsampwsid(member
, &member_sid
)) {
472 DEBUG(1, ("Found bogus group member: %d (member_sid=%s group=%s)\n",
473 r
->rids
[i
], sid_string_tos(&member_sid
), grp
->gr_name
));
478 if (pdb_get_group_rid(member
) == rid
) {
479 d_printf("%s(primary),", pdb_get_username(member
));
484 d_printf("%s,", pdb_get_username(member
));
485 nt_members
[i
] = talloc_strdup(t
, pdb_get_username(member
));
491 unix_members
= grp
->gr_mem
;
493 while (*unix_members
) {
494 bool is_nt_member
= false;
495 for (i
=0; i
< r
->num_rids
; i
++) {
496 if (nt_members
[i
] == NULL
) {
497 /* This was a primary group */
501 if (strcmp(*unix_members
, nt_members
[i
]) == 0) {
507 /* We look at a unix group member that is not
508 an nt group member. So, remove it. NT is
510 smb_delete_user_group(grp
->gr_name
, *unix_members
);
515 for (i
=0; i
< r
->num_rids
; i
++) {
516 bool is_unix_member
= false;
518 if (nt_members
[i
] == NULL
) {
519 /* This was the primary group */
523 unix_members
= grp
->gr_mem
;
525 while (*unix_members
) {
526 if (strcmp(*unix_members
, nt_members
[i
]) == 0) {
527 is_unix_member
= true;
533 if (!is_unix_member
) {
534 /* We look at a nt group member that is not a
535 unix group member currently. So, add the nt
537 smb_add_user_group(grp
->gr_name
, nt_members
[i
]);
545 static NTSTATUS
fetch_alias_info(uint32_t rid
,
546 struct netr_DELTA_ALIAS
*r
,
547 const DOM_SID
*dom_sid
)
551 struct group
*grp
= NULL
;
557 fstrcpy(name
, r
->alias_name
.string
);
558 fstrcpy(comment
, r
->description
.string
);
560 /* Find out whether the group is already mapped */
561 sid_copy(&alias_sid
, dom_sid
);
562 sid_append_rid(&alias_sid
, rid
);
563 sid_to_fstring(sid_string
, &alias_sid
);
565 if (pdb_getgrsid(&map
, alias_sid
)) {
566 grp
= getgrgid(map
.gid
);
573 /* No group found from mapping, find it from its name. */
574 if ((grp
= getgrnam(name
)) == NULL
) {
575 /* No appropriate group found, create one */
576 d_printf("Creating unix group: '%s'\n", name
);
577 if (smb_create_group(name
, &gid
) != 0)
578 return NT_STATUS_ACCESS_DENIED
;
579 if ((grp
= getgrgid(gid
)) == NULL
)
580 return NT_STATUS_ACCESS_DENIED
;
584 map
.gid
= grp
->gr_gid
;
587 if (sid_equal(dom_sid
, &global_sid_Builtin
))
588 map
.sid_name_use
= SID_NAME_WKN_GRP
;
590 map
.sid_name_use
= SID_NAME_ALIAS
;
592 fstrcpy(map
.nt_name
, name
);
593 fstrcpy(map
.comment
, comment
);
596 pdb_add_group_mapping_entry(&map
);
598 pdb_update_group_mapping_entry(&map
);
603 static NTSTATUS
fetch_alias_mem(uint32_t rid
,
604 struct netr_DELTA_ALIAS_MEMBER
*r
,
605 const DOM_SID
*dom_sid
)
610 static NTSTATUS
fetch_domain_info(uint32_t rid
,
611 struct netr_DELTA_DOMAIN
*r
)
613 time_t u_max_age
, u_min_age
, u_logout
;
614 NTSTATUS nt_status
= NT_STATUS_UNSUCCESSFUL
;
616 struct netr_AcctLockStr
*lockstr
= NULL
;
618 TALLOC_CTX
*mem_ctx
= talloc_tos();
620 status
= pull_netr_AcctLockStr(mem_ctx
, &r
->account_lockout
,
622 if (!NT_STATUS_IS_OK(status
)) {
623 d_printf("failed to pull account lockout string: %s\n",
627 u_max_age
= uint64s_nt_time_to_unix_abs((uint64
*)&r
->max_password_age
);
628 u_min_age
= uint64s_nt_time_to_unix_abs((uint64
*)&r
->min_password_age
);
629 u_logout
= uint64s_nt_time_to_unix_abs((uint64
*)&r
->force_logoff_time
);
631 domname
= r
->domain_name
.string
;
633 return NT_STATUS_NO_MEMORY
;
636 /* we don't handle BUILTIN account policies */
637 if (!strequal(domname
, get_global_sam_name())) {
638 printf("skipping SAM_DOMAIN_INFO delta for '%s' (is not my domain)\n", domname
);
643 if (!pdb_set_account_policy(AP_PASSWORD_HISTORY
,
644 r
->password_history_length
))
647 if (!pdb_set_account_policy(AP_MIN_PASSWORD_LEN
,
648 r
->min_password_length
))
651 if (!pdb_set_account_policy(AP_MAX_PASSWORD_AGE
, (uint32
)u_max_age
))
654 if (!pdb_set_account_policy(AP_MIN_PASSWORD_AGE
, (uint32
)u_min_age
))
657 if (!pdb_set_account_policy(AP_TIME_TO_LOGOUT
, (uint32
)u_logout
))
661 time_t u_lockoutreset
, u_lockouttime
;
663 u_lockoutreset
= uint64s_nt_time_to_unix_abs(&lockstr
->reset_count
);
664 u_lockouttime
= uint64s_nt_time_to_unix_abs((uint64_t *)&lockstr
->lockout_duration
);
666 if (!pdb_set_account_policy(AP_BAD_ATTEMPT_LOCKOUT
,
667 lockstr
->bad_attempt_lockout
))
670 if (!pdb_set_account_policy(AP_RESET_COUNT_TIME
, (uint32_t)u_lockoutreset
/60))
673 if (u_lockouttime
!= -1)
676 if (!pdb_set_account_policy(AP_LOCK_ACCOUNT_DURATION
, (uint32_t)u_lockouttime
))
680 if (!pdb_set_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS
,
681 r
->logon_to_chgpass
))
687 static NTSTATUS
fetch_sam_entry(TALLOC_CTX
*mem_ctx
,
688 enum netr_SamDatabaseID database_id
,
689 struct netr_DELTA_ENUM
*r
,
690 struct samsync_context
*ctx
)
692 switch(r
->delta_type
) {
693 case NETR_DELTA_USER
:
694 fetch_account_info(r
->delta_id_union
.rid
,
695 r
->delta_union
.user
);
697 case NETR_DELTA_GROUP
:
698 fetch_group_info(r
->delta_id_union
.rid
,
699 r
->delta_union
.group
);
701 case NETR_DELTA_GROUP_MEMBER
:
702 fetch_group_mem_info(r
->delta_id_union
.rid
,
703 r
->delta_union
.group_member
);
705 case NETR_DELTA_ALIAS
:
706 fetch_alias_info(r
->delta_id_union
.rid
,
707 r
->delta_union
.alias
,
710 case NETR_DELTA_ALIAS_MEMBER
:
711 fetch_alias_mem(r
->delta_id_union
.rid
,
712 r
->delta_union
.alias_member
,
715 case NETR_DELTA_DOMAIN
:
716 fetch_domain_info(r
->delta_id_union
.rid
,
717 r
->delta_union
.domain
);
719 /* The following types are recognised but not handled */
720 case NETR_DELTA_RENAME_GROUP
:
721 d_printf("NETR_DELTA_RENAME_GROUP not handled\n");
723 case NETR_DELTA_RENAME_USER
:
724 d_printf("NETR_DELTA_RENAME_USER not handled\n");
726 case NETR_DELTA_RENAME_ALIAS
:
727 d_printf("NETR_DELTA_RENAME_ALIAS not handled\n");
729 case NETR_DELTA_POLICY
:
730 d_printf("NETR_DELTA_POLICY not handled\n");
732 case NETR_DELTA_TRUSTED_DOMAIN
:
733 d_printf("NETR_DELTA_TRUSTED_DOMAIN not handled\n");
735 case NETR_DELTA_ACCOUNT
:
736 d_printf("NETR_DELTA_ACCOUNT not handled\n");
738 case NETR_DELTA_SECRET
:
739 d_printf("NETR_DELTA_SECRET not handled\n");
741 case NETR_DELTA_DELETE_GROUP
:
742 d_printf("NETR_DELTA_DELETE_GROUP not handled\n");
744 case NETR_DELTA_DELETE_USER
:
745 d_printf("NETR_DELTA_DELETE_USER not handled\n");
747 case NETR_DELTA_MODIFY_COUNT
:
748 d_printf("NETR_DELTA_MODIFY_COUNT not handled\n");
750 case NETR_DELTA_DELETE_ALIAS
:
751 d_printf("NETR_DELTA_DELETE_ALIAS not handled\n");
753 case NETR_DELTA_DELETE_TRUST
:
754 d_printf("NETR_DELTA_DELETE_TRUST not handled\n");
756 case NETR_DELTA_DELETE_ACCOUNT
:
757 d_printf("NETR_DELTA_DELETE_ACCOUNT not handled\n");
759 case NETR_DELTA_DELETE_SECRET
:
760 d_printf("NETR_DELTA_DELETE_SECRET not handled\n");
762 case NETR_DELTA_DELETE_GROUP2
:
763 d_printf("NETR_DELTA_DELETE_GROUP2 not handled\n");
765 case NETR_DELTA_DELETE_USER2
:
766 d_printf("NETR_DELTA_DELETE_USER2 not handled\n");
769 d_printf("Unknown delta record type %d\n", r
->delta_type
);
776 NTSTATUS
fetch_sam_entries(TALLOC_CTX
*mem_ctx
,
777 enum netr_SamDatabaseID database_id
,
778 struct netr_DELTA_ENUM_ARRAY
*r
,
780 struct samsync_context
*ctx
)
784 for (i
= 0; i
< r
->num_deltas
; i
++) {
785 fetch_sam_entry(mem_ctx
, database_id
, &r
->delta_enum
[i
], ctx
);