diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-07-25 06:33:51 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2005-07-25 06:33:51 +0000 |
commit | e73a01631c38b0604586913d4dc6d73bbd1433e6 (patch) | |
tree | 7ae2094ec314d6cae7568b67131a75b875ce5d7a /source/utils | |
parent | b8f81d57df248d9d2bea4f83bf8311bc20b07039 (diff) | |
download | samba-e73a01631c38b0604586913d4dc6d73bbd1433e6.tar.gz samba-e73a01631c38b0604586913d4dc6d73bbd1433e6.tar.xz samba-e73a01631c38b0604586913d4dc6d73bbd1433e6.zip |
r8752: With all the infrustructure done, details like a SamSync migration
into LDB are actually quite easy.
This brings us the users, and sets basic domain information.
You are expected to have provisioned with the settings for the target
domain, and have joined the domain as a BDC. Then simply 'net
samsync'.
Now we just need to flesh out the delta types.
Andrew Bartlett
Diffstat (limited to 'source/utils')
-rw-r--r-- | source/utils/net/net.c | 1 | ||||
-rw-r--r-- | source/utils/net/net_vampire.c | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/source/utils/net/net.c b/source/utils/net/net.c index 51b860234d9..787f71705bb 100644 --- a/source/utils/net/net.c +++ b/source/utils/net/net.c @@ -106,6 +106,7 @@ static const struct net_functable net_functable[] = { {"time", "get remote server's time\n", net_time, net_time_usage}, {"join", "join a domain\n", net_join, net_join_usage}, {"samdump", "dump the sam of a domain\n", net_samdump, net_samdump_usage}, + {"samsync", "syncrosnise into the local ldb the sam of a domain\n", net_samsync_ldb, net_samsync_ldb_usage}, {"user", "manage user accounts\n", net_user, net_user_usage}, {NULL, NULL, NULL, NULL} }; diff --git a/source/utils/net/net_vampire.c b/source/utils/net/net_vampire.c index 72f791db669..e898352cfce 100644 --- a/source/utils/net/net_vampire.c +++ b/source/utils/net/net_vampire.c @@ -64,3 +64,43 @@ int net_samdump_help(struct net_context *ctx, int argc, const char **argv) d_printf("Dumps the sam of the domain we are joined to.\n"); return 0; } + +int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) +{ + NTSTATUS status; + struct libnet_context *libnetctx; + struct libnet_samsync_ldb r; + + libnetctx = libnet_context_init(NULL); + if (!libnetctx) { + return -1; + } + libnetctx->cred = ctx->credentials; + + r.level = LIBNET_SAMSYNC_LDB_GENERIC; + r.error_string = NULL; + + status = libnet_samsync_ldb(libnetctx, ctx->mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("libnet_samsync_ldb returned %s: %s\n", + nt_errstr(status), + r.error_string)); + return -1; + } + + talloc_free(libnetctx); + + return 0; +} + +int net_samsync_ldb_usage(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("net samsync_ldb\n"); + return 0; +} + +int net_samsync_ldb_help(struct net_context *ctx, int argc, const char **argv) +{ + d_printf("Syncrosnise into the local ldb the SAM of a domain.\n"); + return 0; +} |