This should cure the problem with gums not compiling.
[Samba.git] / source / sam / gums_api.c
blobf90cbbc951b48cc00cee385ad371d844384641dd
1 /*
2 Unix SMB/CIFS implementation.
3 GUMS structures
4 Copyright (C) Simo Sorce 2002
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "includes.h"
23 /* Functions to get/set info from a GUMS object */
25 NTSTATUS gums_create_object(GUMS_OBJECT **obj, uint32 type)
27 TALLOC_CTX *mem_ctx;
28 GUMS_OBJECT *go;
29 NTSTATUS ret;
31 mem_ctx = talloc_init("gums_create_object");
32 if (!mem_ctx) {
33 DEBUG(0, ("gums_create_object: Out of memory!\n"));
34 *obj = NULL;
35 return NT_STATUS_NO_MEMORY;
38 go = talloc_zero(mem_ctx, sizeof(GUMS_OBJECT));
39 if (!go) {
40 DEBUG(0, ("gums_create_object: Out of memory!\n"));
41 talloc_destroy(mem_ctx);
42 *obj = NULL;
43 return NT_STATUS_NO_MEMORY;
46 go->mem_ctx = mem_ctx;
47 go->type = type;
48 go->version = GUMS_OBJECT_VERSION;
50 switch(type) {
51 case GUMS_OBJ_DOMAIN:
52 go->domain = (GUMS_DOMAIN *)talloc_zero(mem_ctx, sizeof(GUMS_DOMAIN));
53 if (!(go->domain)) {
54 ret = NT_STATUS_NO_MEMORY;
55 DEBUG(0, ("gums_create_object: Out of memory!\n"));
56 goto error;
59 break;
62 case GUMS_OBJ_WORKSTATION_TRUST:
63 case GUMS_OBJ_SERVER_TRUST:
64 case GUMS_OBJ_DOMAIN_TRUST:
66 case GUMS_OBJ_NORMAL_USER:
67 go->user = (GUMS_USER *)talloc_zero(mem_ctx, sizeof(GUMS_USER));
68 if (!(go->user)) {
69 ret = NT_STATUS_NO_MEMORY;
70 DEBUG(0, ("gums_create_object: Out of memory!\n"));
71 goto error;
73 gums_set_user_acct_ctrl(go, ACB_NORMAL);
74 gums_set_user_hours(go, 0, NULL);
76 break;
78 case GUMS_OBJ_GROUP:
79 case GUMS_OBJ_ALIAS:
80 go->group = (GUMS_GROUP *)talloc_zero(mem_ctx, sizeof(GUMS_GROUP));
81 if (!(go->group)) {
82 ret = NT_STATUS_NO_MEMORY;
83 DEBUG(0, ("gums_create_object: Out of memory!\n"));
84 goto error;
87 break;
89 default:
90 /* TODO: throw error */
91 ret = NT_STATUS_OBJECT_TYPE_MISMATCH;
92 goto error;
95 *obj = go;
96 return NT_STATUS_OK;
98 error:
99 talloc_destroy(go->mem_ctx);
100 *obj = NULL;
101 return ret;
104 NTSTATUS gums_create_privilege(GUMS_PRIVILEGE **priv)
106 TALLOC_CTX *mem_ctx;
107 GUMS_PRIVILEGE *pri;
109 mem_ctx = talloc_init("gums_create_privilege");
110 if (!mem_ctx) {
111 DEBUG(0, ("gums_create_privilege: Out of memory!\n"));
112 *priv = NULL;
113 return NT_STATUS_NO_MEMORY;
116 pri = talloc_zero(mem_ctx, sizeof(GUMS_PRIVILEGE));
117 if (!pri) {
118 DEBUG(0, ("gums_create_privilege: Out of memory!\n"));
119 talloc_destroy(mem_ctx);
120 *priv = NULL;
121 return NT_STATUS_NO_MEMORY;
124 pri->mem_ctx = mem_ctx;
125 pri->version = GUMS_PRIVILEGE_VERSION;
127 *priv = pri;
128 return NT_STATUS_OK;
131 NTSTATUS gums_destroy_object(GUMS_OBJECT **obj)
133 if (!obj || !(*obj))
134 return NT_STATUS_INVALID_PARAMETER;
136 if ((*obj)->mem_ctx)
137 talloc_destroy((*obj)->mem_ctx);
138 *obj = NULL;
140 return NT_STATUS_OK;
143 NTSTATUS gums_destroy_privilege(GUMS_PRIVILEGE **priv)
145 if (!priv || !(*priv))
146 return NT_STATUS_INVALID_PARAMETER;
148 if ((*priv)->mem_ctx)
149 talloc_destroy((*priv)->mem_ctx);
150 *priv = NULL;
152 return NT_STATUS_OK;
155 void gums_reset_object(GUMS_OBJECT *go)
157 go->seq_num = 0;
158 go->sid = NULL;
159 go->name = NULL;
160 go->description = NULL;
162 switch(go->type) {
163 case GUMS_OBJ_DOMAIN:
164 memset(go->domain, 0, sizeof(GUMS_DOMAIN));
165 break;
168 case GUMS_OBJ_WORKSTATION_TRUST:
169 case GUMS_OBJ_SERVER_TRUST:
170 case GUMS_OBJ_DOMAIN_TRUST:
172 case GUMS_OBJ_NORMAL_USER:
173 memset(go->user, 0, sizeof(GUMS_USER));
174 gums_set_user_acct_ctrl(go, ACB_NORMAL);
175 break;
177 case GUMS_OBJ_GROUP:
178 case GUMS_OBJ_ALIAS:
179 memset(go->group, 0, sizeof(GUMS_GROUP));
180 break;
182 default:
183 return;
187 uint32 gums_get_object_type(const GUMS_OBJECT *obj)
189 if (!obj)
190 return 0;
192 return obj->type;
195 uint32 gums_get_object_seq_num(const GUMS_OBJECT *obj)
197 if (!obj)
198 return 0;
200 return obj->seq_num;
203 uint32 gums_get_object_version(const GUMS_OBJECT *obj)
205 if (!obj)
206 return 0;
208 return obj->version;
211 const SEC_DESC *gums_get_sec_desc(const GUMS_OBJECT *obj)
213 if (!obj)
214 return NULL;
216 return obj->sec_desc;
219 const DOM_SID *gums_get_object_sid(const GUMS_OBJECT *obj)
221 if (!obj)
222 return NULL;
224 return obj->sid;
227 const char *gums_get_object_name(const GUMS_OBJECT *obj)
229 if (!obj)
230 return NULL;
232 return obj->name;
235 const char *gums_get_object_description(const GUMS_OBJECT *obj)
237 if (!obj)
238 return NULL;
240 return obj->description;
243 NTSTATUS gums_set_object_seq_num(GUMS_OBJECT *obj, uint32 seq_num)
245 if (!obj)
246 return NT_STATUS_INVALID_PARAMETER;
248 obj->seq_num = seq_num;
249 return NT_STATUS_OK;
252 NTSTATUS gums_set_object_version(GUMS_OBJECT *obj, uint32 version)
254 if (!obj)
255 return NT_STATUS_INVALID_PARAMETER;
257 obj->version = version;
258 return NT_STATUS_OK;
261 NTSTATUS gums_set_sec_desc(GUMS_OBJECT *obj, const SEC_DESC *sec_desc)
263 if (!obj || !sec_desc)
264 return NT_STATUS_INVALID_PARAMETER;
266 obj->sec_desc = dup_sec_desc(obj->mem_ctx, sec_desc);
267 if (!(obj->sec_desc)) return NT_STATUS_UNSUCCESSFUL;
268 return NT_STATUS_OK;
271 NTSTATUS gums_set_object_sid(GUMS_OBJECT *obj, const DOM_SID *sid)
273 if (!obj || !sid)
274 return NT_STATUS_INVALID_PARAMETER;
276 obj->sid = sid_dup_talloc(obj->mem_ctx, sid);
277 if (!(obj->sid)) return NT_STATUS_UNSUCCESSFUL;
278 return NT_STATUS_OK;
281 NTSTATUS gums_set_object_name(GUMS_OBJECT *obj, const char *name)
283 if (!obj || !name)
284 return NT_STATUS_INVALID_PARAMETER;
286 obj->name = (char *)talloc_strdup(obj->mem_ctx, name);
287 if (!(obj->name)) return NT_STATUS_UNSUCCESSFUL;
288 return NT_STATUS_OK;
291 NTSTATUS gums_set_object_description(GUMS_OBJECT *obj, const char *description)
293 if (!obj || !description)
294 return NT_STATUS_INVALID_PARAMETER;
296 obj->description = (char *)talloc_strdup(obj->mem_ctx, description);
297 if (!(obj->description)) return NT_STATUS_UNSUCCESSFUL;
298 return NT_STATUS_OK;
302 NTSTATUS gums_get_object_privileges(PRIVILEGE_SET **priv_set, const GUMS_OBJECT *obj)
304 if (!priv_set)
305 return NT_STATUS_INVALID_PARAMETER;
307 *priv_set = obj->priv_set;
308 return NT_STATUS_OK;
312 uint32 gums_get_domain_next_rid(const GUMS_OBJECT *obj)
314 if (obj->type != GUMS_OBJ_DOMAIN)
315 return -1;
317 return obj->domain->next_rid;
320 NTSTATUS gums_set_domain_next_rid(GUMS_OBJECT *obj, uint32 rid)
322 if (!obj)
323 return NT_STATUS_INVALID_PARAMETER;
325 if (obj->type != GUMS_OBJ_DOMAIN)
326 return NT_STATUS_OBJECT_TYPE_MISMATCH;
328 obj->domain->next_rid = rid;
329 return NT_STATUS_OK;
332 /* User specific functions */
334 const DOM_SID *gums_get_user_pri_group(const GUMS_OBJECT *obj)
336 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
337 return NULL;
339 return obj->user->group_sid;
342 const DATA_BLOB gums_get_user_nt_pwd(const GUMS_OBJECT *obj)
344 fstring p;
346 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
347 return data_blob(NULL, 0);
349 smbpasswd_sethexpwd(p, (unsigned char *)(obj->user->nt_pw.data), 0);
350 DEBUG(100, ("Reading NT Password=[%s]\n", p));
352 return obj->user->nt_pw;
355 const DATA_BLOB gums_get_user_lm_pwd(const GUMS_OBJECT *obj)
357 fstring p;
359 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
360 return data_blob(NULL, 0);
362 smbpasswd_sethexpwd(p, (unsigned char *)(obj->user->lm_pw.data), 0);
363 DEBUG(100, ("Reading LM Password=[%s]\n", p));
365 return obj->user->lm_pw;
368 const char *gums_get_user_fullname(const GUMS_OBJECT *obj)
370 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
371 return NULL;
373 return obj->user->full_name;
376 const char *gums_get_user_homedir(const GUMS_OBJECT *obj)
378 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
379 return NULL;
381 return obj->user->home_dir;
384 const char *gums_get_user_dir_drive(const GUMS_OBJECT *obj)
386 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
387 return NULL;
389 return obj->user->dir_drive;
392 const char *gums_get_user_profile_path(const GUMS_OBJECT *obj)
394 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
395 return NULL;
397 return obj->user->profile_path;
400 const char *gums_get_user_logon_script(const GUMS_OBJECT *obj)
402 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
403 return NULL;
405 return obj->user->logon_script;
408 const char *gums_get_user_workstations(const GUMS_OBJECT *obj)
410 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
411 return NULL;
413 return obj->user->workstations;
416 const char *gums_get_user_unknown_str(const GUMS_OBJECT *obj)
418 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
419 return NULL;
421 return obj->user->unknown_str;
424 const char *gums_get_user_munged_dial(const GUMS_OBJECT *obj)
426 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
427 return NULL;
429 return obj->user->munged_dial;
432 NTTIME gums_get_user_logon_time(const GUMS_OBJECT *obj)
434 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
435 NTTIME null_time;
436 init_nt_time(&null_time);
437 return null_time;
440 return obj->user->logon_time;
443 NTTIME gums_get_user_logoff_time(const GUMS_OBJECT *obj)
445 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
446 NTTIME null_time;
447 init_nt_time(&null_time);
448 return null_time;
451 return obj->user->logoff_time;
454 NTTIME gums_get_user_kickoff_time(const GUMS_OBJECT *obj)
456 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
457 NTTIME null_time;
458 init_nt_time(&null_time);
459 return null_time;
462 return obj->user->kickoff_time;
465 NTTIME gums_get_user_pass_last_set_time(const GUMS_OBJECT *obj)
467 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
468 NTTIME null_time;
469 init_nt_time(&null_time);
470 return null_time;
473 return obj->user->pass_last_set_time;
476 NTTIME gums_get_user_pass_can_change_time(const GUMS_OBJECT *obj)
478 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
479 NTTIME null_time;
480 init_nt_time(&null_time);
481 return null_time;
484 return obj->user->pass_can_change_time;
487 NTTIME gums_get_user_pass_must_change_time(const GUMS_OBJECT *obj)
489 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER) {
490 NTTIME null_time;
491 init_nt_time(&null_time);
492 return null_time;
495 return obj->user->pass_must_change_time;
498 uint16 gums_get_user_acct_ctrl(const GUMS_OBJECT *obj)
500 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
501 return 0;
503 return obj->user->acct_ctrl;
506 uint16 gums_get_user_logon_divs(const GUMS_OBJECT *obj)
508 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
509 return 0;
511 return obj->user->logon_divs;
514 uint32 gums_get_user_hours_len(const GUMS_OBJECT *obj)
516 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
517 return 0;
519 return obj->user->hours_len;
522 const uint8 *gums_get_user_hours(const GUMS_OBJECT *obj)
524 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
525 return NULL;
527 return obj->user->hours;
530 uint32 gums_get_user_unknown_3(const GUMS_OBJECT *obj)
532 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
533 return 0;
535 return obj->user->unknown_3;
538 uint16 gums_get_user_bad_password_count(const GUMS_OBJECT *obj)
540 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
541 return 0;
543 return obj->user->bad_password_count;
546 uint16 gums_get_user_logon_count(const GUMS_OBJECT *obj)
548 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
549 return 0;
551 return obj->user->logon_count;
554 uint32 gums_get_user_unknown_6(const GUMS_OBJECT *obj)
556 if (!obj || obj->type != GUMS_OBJ_NORMAL_USER)
557 return 0;
559 return obj->user->unknown_6;
562 NTSTATUS gums_set_user_pri_group(GUMS_OBJECT *obj, const DOM_SID *sid)
564 if (!obj || !sid)
565 return NT_STATUS_INVALID_PARAMETER;
567 if (obj->type != GUMS_OBJ_NORMAL_USER)
568 return NT_STATUS_OBJECT_TYPE_MISMATCH;
570 obj->user->group_sid = sid_dup_talloc(obj->mem_ctx, sid);
571 if (!(obj->user->group_sid)) return NT_STATUS_NO_MEMORY;
572 return NT_STATUS_OK;
575 NTSTATUS gums_set_user_nt_pwd(GUMS_OBJECT *obj, const DATA_BLOB nt_pwd)
577 fstring p;
578 unsigned char r[16];
580 if (!obj)
581 return NT_STATUS_INVALID_PARAMETER;
583 if (obj->type != GUMS_OBJ_NORMAL_USER)
584 return NT_STATUS_OBJECT_TYPE_MISMATCH;
586 obj->user->nt_pw = data_blob_talloc(obj->mem_ctx, nt_pwd.data, nt_pwd.length);
588 memcpy(r, nt_pwd.data, 16);
589 smbpasswd_sethexpwd(p, r, 0);
590 DEBUG(100, ("Setting NT Password=[%s]\n", p));
592 return NT_STATUS_OK;
595 NTSTATUS gums_set_user_lm_pwd(GUMS_OBJECT *obj, const DATA_BLOB lm_pwd)
597 fstring p;
598 unsigned char r[16];
600 if (!obj)
601 return NT_STATUS_INVALID_PARAMETER;
603 if (obj->type != GUMS_OBJ_NORMAL_USER)
604 return NT_STATUS_OBJECT_TYPE_MISMATCH;
606 obj->user->lm_pw = data_blob_talloc(obj->mem_ctx, lm_pwd.data, lm_pwd.length);
608 memcpy(r, lm_pwd.data, 16);
609 smbpasswd_sethexpwd(p, r, 0);
610 DEBUG(100, ("Setting LM Password=[%s]\n", p));
612 return NT_STATUS_OK;
615 NTSTATUS gums_set_user_fullname(GUMS_OBJECT *obj, const char *fullname)
617 if (!obj || !fullname)
618 return NT_STATUS_INVALID_PARAMETER;
620 if (obj->type != GUMS_OBJ_NORMAL_USER)
621 return NT_STATUS_OBJECT_TYPE_MISMATCH;
623 obj->user->full_name = (char *)talloc_strdup(obj->mem_ctx, fullname);
624 if (!(obj->user->full_name)) return NT_STATUS_NO_MEMORY;
625 return NT_STATUS_OK;
628 NTSTATUS gums_set_user_homedir(GUMS_OBJECT *obj, const char *homedir)
630 if (!obj || !homedir)
631 return NT_STATUS_INVALID_PARAMETER;
633 if (obj->type != GUMS_OBJ_NORMAL_USER)
634 return NT_STATUS_OBJECT_TYPE_MISMATCH;
636 obj->user->home_dir = (char *)talloc_strdup(obj->mem_ctx, homedir);
637 if (!(obj->user->home_dir)) return NT_STATUS_NO_MEMORY;
638 return NT_STATUS_OK;
641 NTSTATUS gums_set_user_dir_drive(GUMS_OBJECT *obj, const char *dir_drive)
643 if (!obj || !dir_drive)
644 return NT_STATUS_INVALID_PARAMETER;
646 if (obj->type != GUMS_OBJ_NORMAL_USER)
647 return NT_STATUS_OBJECT_TYPE_MISMATCH;
649 obj->user->dir_drive = (char *)talloc_strdup(obj->mem_ctx, dir_drive);
650 if (!(obj->user->dir_drive)) return NT_STATUS_NO_MEMORY;
651 return NT_STATUS_OK;
654 NTSTATUS gums_set_user_logon_script(GUMS_OBJECT *obj, const char *logon_script)
656 if (!obj || !logon_script)
657 return NT_STATUS_INVALID_PARAMETER;
659 if (obj->type != GUMS_OBJ_NORMAL_USER)
660 return NT_STATUS_OBJECT_TYPE_MISMATCH;
662 obj->user->logon_script = (char *)talloc_strdup(obj->mem_ctx, logon_script);
663 if (!(obj->user->logon_script)) return NT_STATUS_NO_MEMORY;
664 return NT_STATUS_OK;
667 NTSTATUS gums_set_user_profile_path(GUMS_OBJECT *obj, const char *profile_path)
669 if (!obj || !profile_path)
670 return NT_STATUS_INVALID_PARAMETER;
672 if (obj->type != GUMS_OBJ_NORMAL_USER)
673 return NT_STATUS_OBJECT_TYPE_MISMATCH;
675 obj->user->profile_path = (char *)talloc_strdup(obj->mem_ctx, profile_path);
676 if (!(obj->user->profile_path)) return NT_STATUS_NO_MEMORY;
677 return NT_STATUS_OK;
680 NTSTATUS gums_set_user_workstations(GUMS_OBJECT *obj, const char *workstations)
682 if (!obj || !workstations)
683 return NT_STATUS_INVALID_PARAMETER;
685 if (obj->type != GUMS_OBJ_NORMAL_USER)
686 return NT_STATUS_OBJECT_TYPE_MISMATCH;
688 obj->user->workstations = (char *)talloc_strdup(obj->mem_ctx, workstations);
689 if (!(obj->user->workstations)) return NT_STATUS_NO_MEMORY;
690 return NT_STATUS_OK;
693 NTSTATUS gums_set_user_unknown_str(GUMS_OBJECT *obj, const char *unknown_str)
695 if (!obj || !unknown_str)
696 return NT_STATUS_INVALID_PARAMETER;
698 if (obj->type != GUMS_OBJ_NORMAL_USER)
699 return NT_STATUS_OBJECT_TYPE_MISMATCH;
701 obj->user->unknown_str = (char *)talloc_strdup(obj->mem_ctx, unknown_str);
702 if (!(obj->user->unknown_str)) return NT_STATUS_NO_MEMORY;
703 return NT_STATUS_OK;
706 NTSTATUS gums_set_user_munged_dial(GUMS_OBJECT *obj, const char *munged_dial)
708 if (!obj || !munged_dial)
709 return NT_STATUS_INVALID_PARAMETER;
711 if (obj->type != GUMS_OBJ_NORMAL_USER)
712 return NT_STATUS_OBJECT_TYPE_MISMATCH;
714 obj->user->munged_dial = (char *)talloc_strdup(obj->mem_ctx, munged_dial);
715 if (!(obj->user->munged_dial)) return NT_STATUS_NO_MEMORY;
716 return NT_STATUS_OK;
719 NTSTATUS gums_set_user_logon_time(GUMS_OBJECT *obj, NTTIME logon_time)
721 if (!obj)
722 return NT_STATUS_INVALID_PARAMETER;
724 if (obj->type != GUMS_OBJ_NORMAL_USER)
725 return NT_STATUS_OBJECT_TYPE_MISMATCH;
727 obj->user->logon_time = logon_time;
728 return NT_STATUS_OK;
731 NTSTATUS gums_set_user_logoff_time(GUMS_OBJECT *obj, NTTIME logoff_time)
733 if (!obj)
734 return NT_STATUS_INVALID_PARAMETER;
736 if (obj->type != GUMS_OBJ_NORMAL_USER)
737 return NT_STATUS_OBJECT_TYPE_MISMATCH;
739 obj->user->logoff_time = logoff_time;
740 return NT_STATUS_OK;
743 NTSTATUS gums_set_user_kickoff_time(GUMS_OBJECT *obj, NTTIME kickoff_time)
745 if (!obj)
746 return NT_STATUS_INVALID_PARAMETER;
748 if (obj->type != GUMS_OBJ_NORMAL_USER)
749 return NT_STATUS_OBJECT_TYPE_MISMATCH;
751 obj->user->kickoff_time = kickoff_time;
752 return NT_STATUS_OK;
755 NTSTATUS gums_set_user_pass_last_set_time(GUMS_OBJECT *obj, NTTIME pass_last_set_time)
757 if (!obj)
758 return NT_STATUS_INVALID_PARAMETER;
760 if (obj->type != GUMS_OBJ_NORMAL_USER)
761 return NT_STATUS_OBJECT_TYPE_MISMATCH;
763 obj->user->pass_last_set_time = pass_last_set_time;
764 return NT_STATUS_OK;
767 NTSTATUS gums_set_user_pass_can_change_time(GUMS_OBJECT *obj, NTTIME pass_can_change_time)
769 if (!obj)
770 return NT_STATUS_INVALID_PARAMETER;
772 if (obj->type != GUMS_OBJ_NORMAL_USER)
773 return NT_STATUS_OBJECT_TYPE_MISMATCH;
775 obj->user->pass_can_change_time = pass_can_change_time;
776 return NT_STATUS_OK;
779 NTSTATUS gums_set_user_pass_must_change_time(GUMS_OBJECT *obj, NTTIME pass_must_change_time)
781 if (!obj)
782 return NT_STATUS_INVALID_PARAMETER;
784 if (obj->type != GUMS_OBJ_NORMAL_USER)
785 return NT_STATUS_OBJECT_TYPE_MISMATCH;
787 obj->user->pass_must_change_time = pass_must_change_time;
788 return NT_STATUS_OK;
791 NTSTATUS gums_set_user_acct_ctrl(GUMS_OBJECT *obj, uint16 acct_ctrl)
793 if (!obj)
794 return NT_STATUS_INVALID_PARAMETER;
796 if (obj->type != GUMS_OBJ_NORMAL_USER)
797 return NT_STATUS_OBJECT_TYPE_MISMATCH;
799 obj->user->acct_ctrl = acct_ctrl;
800 return NT_STATUS_OK;
803 NTSTATUS gums_set_user_logon_divs(GUMS_OBJECT *obj, uint16 logon_divs)
805 if (!obj)
806 return NT_STATUS_INVALID_PARAMETER;
808 if (obj->type != GUMS_OBJ_NORMAL_USER)
809 return NT_STATUS_OBJECT_TYPE_MISMATCH;
811 obj->user->logon_divs = logon_divs;
812 return NT_STATUS_OK;
815 NTSTATUS gums_set_user_hours(GUMS_OBJECT *obj, uint32 hours_len, const uint8 *hours)
817 if (!obj || !hours)
818 return NT_STATUS_INVALID_PARAMETER;
820 if (obj->type != GUMS_OBJ_NORMAL_USER)
821 return NT_STATUS_OBJECT_TYPE_MISMATCH;
823 obj->user->hours_len = hours_len;
824 if (hours_len == 0)
825 DEBUG(10, ("gums_set_user_hours: Warning, hours_len is zero!\n"));
827 obj->user->hours = (uint8 *)talloc(obj->mem_ctx, MAX_HOURS_LEN);
828 if (!(obj->user->hours))
829 return NT_STATUS_NO_MEMORY;
830 if (hours_len)
831 memcpy(obj->user->hours, hours, hours_len);
833 return NT_STATUS_OK;
836 NTSTATUS gums_set_user_unknown_3(GUMS_OBJECT *obj, uint32 unknown_3)
838 if (!obj)
839 return NT_STATUS_INVALID_PARAMETER;
841 if (obj->type != GUMS_OBJ_NORMAL_USER)
842 return NT_STATUS_OBJECT_TYPE_MISMATCH;
844 obj->user->unknown_3 = unknown_3;
845 return NT_STATUS_OK;
848 NTSTATUS gums_set_user_bad_password_count(GUMS_OBJECT *obj, uint16 bad_password_count)
850 if (!obj)
851 return NT_STATUS_INVALID_PARAMETER;
853 if (obj->type != GUMS_OBJ_NORMAL_USER)
854 return NT_STATUS_OBJECT_TYPE_MISMATCH;
856 obj->user->bad_password_count = bad_password_count;
857 return NT_STATUS_OK;
860 NTSTATUS gums_set_user_logon_count(GUMS_OBJECT *obj, uint16 logon_count)
862 if (!obj)
863 return NT_STATUS_INVALID_PARAMETER;
865 if (obj->type != GUMS_OBJ_NORMAL_USER)
866 return NT_STATUS_OBJECT_TYPE_MISMATCH;
868 obj->user->logon_count = logon_count;
869 return NT_STATUS_OK;
872 NTSTATUS gums_set_user_unknown_6(GUMS_OBJECT *obj, uint32 unknown_6)
874 if (!obj)
875 return NT_STATUS_INVALID_PARAMETER;
877 if (obj->type != GUMS_OBJ_NORMAL_USER)
878 return NT_STATUS_OBJECT_TYPE_MISMATCH;
880 obj->user->unknown_6 = unknown_6;
881 return NT_STATUS_OK;
884 /* Group specific functions */
886 const DOM_SID *gums_get_group_members(int *count, const GUMS_OBJECT *obj)
888 if (!count || !obj || !(obj->type == GUMS_OBJ_GROUP || obj->type == GUMS_OBJ_ALIAS)) {
889 *count = -1;
890 return NULL;
893 *count = obj->group->count;
894 return obj->group->members;
897 NTSTATUS gums_set_group_members(GUMS_OBJECT *obj, uint32 count, DOM_SID *members)
899 uint32 n;
901 if (!obj || ((count > 0) && !members))
902 return NT_STATUS_INVALID_PARAMETER;
904 if (obj->type != GUMS_OBJ_GROUP &&
905 obj->type != GUMS_OBJ_ALIAS)
906 return NT_STATUS_OBJECT_TYPE_MISMATCH;
908 obj->group->count = count;
910 if (count) {
911 obj->group->members = (DOM_SID *)talloc(obj->mem_ctx, count * sizeof(DOM_SID));
912 if (!(obj->group->members)) {
913 return NT_STATUS_NO_MEMORY;
917 n = 0;
918 do {
919 sid_copy(&(obj->group->members[n]), &(members[n]));
920 n++;
921 } while (n < count);
922 } else {
923 obj->group->members = 0;
926 return NT_STATUS_OK;
929 /* Privilege specific functions */
931 const LUID_ATTR *gums_get_priv_luid_attr(const GUMS_PRIVILEGE *priv)
933 if (!priv) {
934 return NULL;
937 return priv->privilege;
940 const DOM_SID *gums_get_priv_members(int *count, const GUMS_PRIVILEGE *priv)
942 if (!count || !priv) {
943 *count = -1;
944 return NULL;
947 *count = priv->count;
948 return priv->members;
951 NTSTATUS gums_set_priv_luid_attr(GUMS_PRIVILEGE *priv, LUID_ATTR *luid_attr)
953 if (!luid_attr || !priv)
954 return NT_STATUS_INVALID_PARAMETER;
956 priv->privilege = (LUID_ATTR *)talloc_memdup(priv->mem_ctx, luid_attr, sizeof(LUID_ATTR));
957 if (!(priv->privilege)) return NT_STATUS_NO_MEMORY;
958 return NT_STATUS_OK;
961 NTSTATUS gums_set_priv_members(GUMS_PRIVILEGE *priv, uint32 count, DOM_SID *members)
963 uint32 n;
965 if (!priv || !members || !members)
966 return NT_STATUS_INVALID_PARAMETER;
968 priv->count = count;
969 priv->members = (DOM_SID *)talloc(priv->mem_ctx, count * sizeof(DOM_SID));
970 if (!(priv->members))
971 return NT_STATUS_NO_MEMORY;
973 n = 0;
974 do {
975 sid_copy(&(priv->members[n]), &(members[n]));
976 n++;
977 } while (n < count);
979 return NT_STATUS_OK;
982 /* data_store set functions */
984 NTSTATUS gums_create_commit_set(GUMS_COMMIT_SET **com_set, DOM_SID *sid, uint32 type)
986 TALLOC_CTX *mem_ctx;
988 mem_ctx = talloc_init("commit_set");
989 if (mem_ctx == NULL)
990 return NT_STATUS_NO_MEMORY;
992 *com_set = (GUMS_COMMIT_SET *)talloc_zero(mem_ctx, sizeof(GUMS_COMMIT_SET));
993 if (*com_set == NULL) {
994 talloc_destroy(mem_ctx);
995 return NT_STATUS_NO_MEMORY;
998 (*com_set)->mem_ctx = mem_ctx;
999 (*com_set)->type = type;
1000 sid_copy(&((*com_set)->sid), sid);
1002 return NT_STATUS_OK;
1005 NTSTATUS gums_cs_grow_data_set(GUMS_COMMIT_SET *com_set, int size)
1007 GUMS_DATA_SET *data_set;
1009 com_set->count = com_set->count + size;
1010 if (com_set->count == size) { /* data set is empty*/
1011 data_set = (GUMS_DATA_SET *)talloc_zero(com_set->mem_ctx, sizeof(GUMS_DATA_SET));
1012 } else {
1013 data_set = (GUMS_DATA_SET *)talloc_realloc(com_set->mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count);
1015 if (data_set == NULL)
1016 return NT_STATUS_NO_MEMORY;
1018 com_set->data = data_set;
1020 return NT_STATUS_OK;
1023 NTSTATUS gums_cs_set_sec_desc(GUMS_COMMIT_SET *com_set, SEC_DESC *sec_desc)
1025 NTSTATUS ret;
1026 GUMS_DATA_SET *data_set;
1027 SEC_DESC *new_sec_desc;
1029 if (!com_set || !sec_desc)
1030 return NT_STATUS_INVALID_PARAMETER;
1032 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1033 return ret;
1035 data_set = &((com_set->data)[com_set->count - 1]);
1037 data_set->type = GUMS_SET_SEC_DESC;
1038 new_sec_desc = dup_sec_desc(com_set->mem_ctx, sec_desc);
1039 if (new_sec_desc == NULL)
1040 return NT_STATUS_NO_MEMORY;
1042 (SEC_DESC *)(data_set->data) = new_sec_desc;
1044 return NT_STATUS_OK;
1048 NTSTATUS gums_cs_add_privilege(GUMS_PRIV_COMMIT_SET *com_set, LUID_ATTR priv)
1050 NTSTATUS ret;
1051 GUMS_DATA_SET *data_set;
1052 LUID_ATTR *new_priv;
1054 if (!com_set)
1055 return NT_STATUS_INVALID_PARAMETER;
1057 if (!NT_STATUS_OK(ret = gums_pcs_grow_data_set(com_set, 1)))
1058 return ret;
1060 data_set = ((com_set->data)[com_set->count - 1]);
1062 data_set->type = GUMS_ADD_PRIVILEGE;
1063 if (!NT_STATUS_IS_OK(ret = dupalloc_luid_attr(com_set->mem_ctx, &new_priv, priv)))
1064 return ret;
1066 (SEC_DESC *)(data_set->data) = new_priv;
1068 return NT_STATUS_OK;
1071 NTSTATUS gums_cs_del_privilege(GUMS_PRIV_COMMIT_SET *com_set, LUID_ATTR priv)
1073 NTSTATUS ret;
1074 GUMS_DATA_SET *data_set;
1075 LUID_ATTR *new_priv;
1077 if (!com_set)
1078 return NT_STATUS_INVALID_PARAMETER;
1080 if (!NT_STATUS_OK(ret = gums_pcs_grow_data_set(com_set, 1)))
1081 return ret;
1083 data_set = ((com_set->data)[com_set->count - 1]);
1085 data_set->type = GUMS_DEL_PRIVILEGE;
1086 if (!NT_STATUS_IS_OK(ret = dupalloc_luid_attr(com_set->mem_ctx, &new_priv, priv)))
1087 return ret;
1089 (SEC_DESC *)(data_set->data) = new_priv;
1091 return NT_STATUS_OK;
1094 NTSTATUS gums_cs_set_privilege_set(GUMS_PRIV_COMMIT_SET *com_set, PRIVILEGE_SET *priv_set)
1096 NTSTATUS ret;
1097 GUMS_DATA_SET *data_set;
1098 PRIVILEGE_SET *new_priv_set;
1100 if (!com_set || !priv_set)
1101 return NT_STATUS_INVALID_PARAMETER;
1103 if (!NT_STATUS_OK(ret = gums_pcs_grow_data_set(com_set, 1)))
1104 return ret;
1106 data_set = ((com_set->data)[com_set->count - 1]);
1108 data_set->type = GUMS_SET_PRIVILEGE;
1109 if (!NT_STATUS_IS_OK(ret = init_priv_set_with_ctx(com_set->mem_ctx, &new_priv_set)))
1110 return ret;
1112 if (!NT_STATUS_IS_OK(ret = dup_priv_set(new_priv_set, priv_set)))
1113 return ret;
1115 (SEC_DESC *)(data_set->data) = new_priv_set;
1117 return NT_STATUS_OK;
1121 NTSTATUS gums_cs_set_string(GUMS_COMMIT_SET *com_set, uint32 type, char *str)
1123 NTSTATUS ret;
1124 GUMS_DATA_SET *data_set;
1125 char *new_str;
1127 if (!com_set || !str || type < GUMS_SET_NAME || type > GUMS_SET_MUNGED_DIAL)
1128 return NT_STATUS_INVALID_PARAMETER;
1130 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1131 return ret;
1133 data_set = &((com_set->data)[com_set->count - 1]);
1135 data_set->type = type;
1136 new_str = talloc_strdup(com_set->mem_ctx, str);
1137 if (new_str == NULL)
1138 return NT_STATUS_NO_MEMORY;
1140 (char *)(data_set->data) = new_str;
1142 return NT_STATUS_OK;
1145 NTSTATUS gums_cs_set_name(GUMS_COMMIT_SET *com_set, char *name)
1147 return gums_cs_set_string(com_set, GUMS_SET_NAME, name);
1150 NTSTATUS gums_cs_set_description(GUMS_COMMIT_SET *com_set, char *desc)
1152 return gums_cs_set_string(com_set, GUMS_SET_DESCRIPTION, desc);
1155 NTSTATUS gums_cs_set_full_name(GUMS_COMMIT_SET *com_set, char *full_name)
1157 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1158 return NT_STATUS_INVALID_PARAMETER;
1160 return gums_cs_set_string(com_set, GUMS_SET_NAME, full_name);
1163 NTSTATUS gums_cs_set_home_directory(GUMS_COMMIT_SET *com_set, char *home_dir)
1165 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1166 return NT_STATUS_INVALID_PARAMETER;
1168 return gums_cs_set_string(com_set, GUMS_SET_NAME, home_dir);
1171 NTSTATUS gums_cs_set_drive(GUMS_COMMIT_SET *com_set, char *drive)
1173 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1174 return NT_STATUS_INVALID_PARAMETER;
1176 return gums_cs_set_string(com_set, GUMS_SET_NAME, drive);
1179 NTSTATUS gums_cs_set_logon_script(GUMS_COMMIT_SET *com_set, char *logon_script)
1181 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1182 return NT_STATUS_INVALID_PARAMETER;
1184 return gums_cs_set_string(com_set, GUMS_SET_NAME, logon_script);
1187 NTSTATUS gums_cs_set_profile_path(GUMS_COMMIT_SET *com_set, char *prof_path)
1189 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1190 return NT_STATUS_INVALID_PARAMETER;
1192 return gums_cs_set_string(com_set, GUMS_SET_NAME, prof_path);
1195 NTSTATUS gums_cs_set_workstations(GUMS_COMMIT_SET *com_set, char *wks)
1197 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1198 return NT_STATUS_INVALID_PARAMETER;
1200 return gums_cs_set_string(com_set, GUMS_SET_NAME, wks);
1203 NTSTATUS gums_cs_set_unknown_string(GUMS_COMMIT_SET *com_set, char *unkn_str)
1205 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1206 return NT_STATUS_INVALID_PARAMETER;
1208 return gums_cs_set_string(com_set, GUMS_SET_NAME, unkn_str);
1211 NTSTATUS gums_cs_set_munged_dial(GUMS_COMMIT_SET *com_set, char *munged_dial)
1213 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1214 return NT_STATUS_INVALID_PARAMETER;
1216 return gums_cs_set_string(com_set, GUMS_SET_NAME, munged_dial);
1219 NTSTATUS gums_cs_set_nttime(GUMS_COMMIT_SET *com_set, uint32 type, NTTIME *nttime)
1221 NTSTATUS ret;
1222 GUMS_DATA_SET *data_set;
1223 NTTIME *new_time;
1225 if (!com_set || !nttime || type < GUMS_SET_LOGON_TIME || type > GUMS_SET_PASS_MUST_CHANGE_TIME)
1226 return NT_STATUS_INVALID_PARAMETER;
1228 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1229 return ret;
1231 data_set = &((com_set->data)[com_set->count - 1]);
1233 data_set->type = type;
1234 new_time = talloc(com_set->mem_ctx, sizeof(NTTIME));
1235 if (new_time == NULL)
1236 return NT_STATUS_NO_MEMORY;
1238 new_time->low = nttime->low;
1239 new_time->high = nttime->high;
1240 (char *)(data_set->data) = new_time;
1242 return NT_STATUS_OK;
1245 NTSTATUS gums_cs_set_logon_time(GUMS_COMMIT_SET *com_set, NTTIME *logon_time)
1247 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1248 return NT_STATUS_INVALID_PARAMETER;
1250 return gums_cs_set_nttime(com_set, GUMS_SET_LOGON_TIME, logon_time);
1253 NTSTATUS gums_cs_set_logoff_time(GUMS_COMMIT_SET *com_set, NTTIME *logoff_time)
1255 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1256 return NT_STATUS_INVALID_PARAMETER;
1258 return gums_cs_set_nttime(com_set, GUMS_SET_LOGOFF_TIME, logoff_time);
1261 NTSTATUS gums_cs_set_kickoff_time(GUMS_COMMIT_SET *com_set, NTTIME *kickoff_time)
1263 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1264 return NT_STATUS_INVALID_PARAMETER;
1266 return gums_cs_set_nttime(com_set, GUMS_SET_KICKOFF_TIME, kickoff_time);
1269 NTSTATUS gums_cs_set_pass_last_set_time(GUMS_COMMIT_SET *com_set, NTTIME *pls_time)
1271 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1272 return NT_STATUS_INVALID_PARAMETER;
1274 return gums_cs_set_nttime(com_set, GUMS_SET_LOGON_TIME, pls_time);
1277 NTSTATUS gums_cs_set_pass_can_change_time(GUMS_COMMIT_SET *com_set, NTTIME *pcc_time)
1279 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1280 return NT_STATUS_INVALID_PARAMETER;
1282 return gums_cs_set_nttime(com_set, GUMS_SET_LOGON_TIME, pcc_time);
1285 NTSTATUS gums_cs_set_pass_must_change_time(GUMS_COMMIT_SET *com_set, NTTIME *pmc_time)
1287 if (com_set->type != GUMS_OBJ_NORMAL_USER)
1288 return NT_STATUS_INVALID_PARAMETER;
1290 return gums_cs_set_nttime(com_set, GUMS_SET_LOGON_TIME, pmc_time);
1293 NTSTATUS gums_cs_add_sids_to_group(GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count)
1295 NTSTATUS ret;
1296 GUMS_DATA_SET *data_set;
1297 DOM_SID **new_sids;
1298 int i;
1300 if (!com_set || !sids)
1301 return NT_STATUS_INVALID_PARAMETER;
1303 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1304 return ret;
1306 data_set = &((com_set->data)[com_set->count - 1]);
1308 data_set->type = GUMS_ADD_SID_LIST;
1309 new_sids = (DOM_SID **)talloc(com_set->mem_ctx, (sizeof(void *) * count));
1310 if (new_sids == NULL)
1311 return NT_STATUS_NO_MEMORY;
1312 for (i = 0; i < count; i++) {
1313 new_sids[i] = sid_dup_talloc(com_set->mem_ctx, sids[i]);
1314 if (new_sids[i] == NULL)
1315 return NT_STATUS_NO_MEMORY;
1318 (SEC_DESC *)(data_set->data) = new_sids;
1320 return NT_STATUS_OK;
1323 NTSTATUS gums_cs_add_users_to_group(GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count)
1325 if (!com_set || !sids)
1326 return NT_STATUS_INVALID_PARAMETER;
1327 if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS)
1328 return NT_STATUS_INVALID_PARAMETER;
1330 return gums_cs_add_sids_to_group(com_set, sids, count);
1333 NTSTATUS gums_cs_add_groups_to_group(GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count)
1335 if (!com_set || !sids)
1336 return NT_STATUS_INVALID_PARAMETER;
1337 if (com_set->type != GUMS_OBJ_ALIAS)
1338 return NT_STATUS_INVALID_PARAMETER;
1340 return gums_cs_add_sids_to_group(com_set, sids, count);
1343 NTSTATUS gums_cs_del_sids_from_group(GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count)
1345 NTSTATUS ret;
1346 GUMS_DATA_SET *data_set;
1347 DOM_SID **new_sids;
1348 int i;
1350 if (!com_set || !sids)
1351 return NT_STATUS_INVALID_PARAMETER;
1352 if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS)
1353 return NT_STATUS_INVALID_PARAMETER;
1355 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1356 return ret;
1358 data_set = &((com_set->data)[com_set->count - 1]);
1360 data_set->type = GUMS_DEL_SID_LIST;
1361 new_sids = (DOM_SID **)talloc(com_set->mem_ctx, (sizeof(void *) * count));
1362 if (new_sids == NULL)
1363 return NT_STATUS_NO_MEMORY;
1364 for (i = 0; i < count; i++) {
1365 new_sids[i] = sid_dup_talloc(com_set->mem_ctx, sids[i]);
1366 if (new_sids[i] == NULL)
1367 return NT_STATUS_NO_MEMORY;
1370 (SEC_DESC *)(data_set->data) = new_sids;
1372 return NT_STATUS_OK;
1375 NTSTATUS gums_ds_set_sids_in_group(GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count)
1377 NTSTATUS ret;
1378 GUMS_DATA_SET *data_set;
1379 DOM_SID **new_sids;
1380 int i;
1382 if (!com_set || !sids)
1383 return NT_STATUS_INVALID_PARAMETER;
1384 if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS)
1385 return NT_STATUS_INVALID_PARAMETER;
1387 if (!NT_STATUS_IS_OK(ret = gums_cs_grow_data_set(com_set, 1)))
1388 return ret;
1390 data_set = &((com_set->data)[com_set->count - 1]);
1392 data_set->type = GUMS_SET_SID_LIST;
1393 new_sids = (DOM_SID **)talloc(com_set->mem_ctx, (sizeof(void *) * count));
1394 if (new_sids == NULL)
1395 return NT_STATUS_NO_MEMORY;
1396 for (i = 0; i < count; i++) {
1397 new_sids[i] = sid_dup_talloc(com_set->mem_ctx, sids[i]);
1398 if (new_sids[i] == NULL)
1399 return NT_STATUS_NO_MEMORY;
1402 (SEC_DESC *)(data_set->data) = new_sids;
1404 return NT_STATUS_OK;
1407 NTSTATUS gums_commit_data(GUMS_COMMIT_SET *set)
1409 NTSTATUS ret;
1410 GUMS_FUNCTIONS *fns;
1412 if (!NT_STATUS_IS_OK(ret = get_gums_fns(&fns))) {
1413 DEBUG(0, ("gums_commit_data: unable to get gums functions! backend uninitialized?\n"));
1414 return ret;
1416 return fns->set_object_values(&(set->sid), set->count, set->data);
1419 NTSTATUS gums_destroy_commit_set(GUMS_COMMIT_SET **com_set)
1421 talloc_destroy((*com_set)->mem_ctx);
1422 *com_set = NULL;
1424 return NT_STATUS_OK;