diff options
author | Günther Deschner <gd@samba.org> | 2008-06-16 12:09:08 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-06-17 10:49:13 +0200 |
commit | ccdcbc2efe86cde991a1cafdb2b098db41b163fd (patch) | |
tree | b207683051602c24dadae7db97cacc642925314e /source3/libnet/libnet_samsync.h | |
parent | d314f7eab5d6fd5c14849abc553c43642b26cf54 (diff) | |
download | samba-ccdcbc2efe86cde991a1cafdb2b098db41b163fd.tar.gz |
net_vampire: move some samsync functions to libnet.
Guenther
(This used to be commit b3b6af0a3e25fab0a14c9c802dbabd3d03448ebe)
Diffstat (limited to 'source3/libnet/libnet_samsync.h')
-rw-r--r-- | source3/libnet/libnet_samsync.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/source3/libnet/libnet_samsync.h b/source3/libnet/libnet_samsync.h new file mode 100644 index 0000000000..5898a15ebd --- /dev/null +++ b/source3/libnet/libnet_samsync.h @@ -0,0 +1,68 @@ +/* + * Unix SMB/CIFS implementation. + * libnet Support + * Copyright (C) Guenther Deschner 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + + +enum net_samsync_mode { + NET_SAMSYNC_MODE_FETCH_PASSDB = 0, + NET_SAMSYNC_MODE_FETCH_LDIF = 1, + NET_SAMSYNC_MODE_DUMP = 2 +}; + +/* Structure for mapping accounts to groups */ +/* Array element is the group rid */ +typedef struct _groupmap { + uint32_t rid; + uint32_t gidNumber; + const char *sambaSID; + const char *group_dn; +} GROUPMAP; + +typedef struct _accountmap { + uint32_t rid; + const char *cn; +} ACCOUNTMAP; + +struct samsync_ldif_context { + GROUPMAP *groupmap; + ACCOUNTMAP *accountmap; + bool initialized; + const char *add_template; + const char *mod_template; + char *add_name; + char *mod_name; + FILE *add_file; + FILE *mod_file; + FILE *ldif_file; + const char *suffix; + int num_alloced; +}; + +struct samsync_context { + enum net_samsync_mode mode; + const struct dom_sid *domain_sid; + const char *domain_sid_str; + const char *ldif_filename; + struct samsync_ldif_context *ldif; +}; + +typedef NTSTATUS (*samsync_fn_t)(TALLOC_CTX *, + enum netr_SamDatabaseID, + struct netr_DELTA_ENUM_ARRAY *, + NTSTATUS, + struct samsync_context *); |