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 2 of the License, or
+ 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,
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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "utils/net/net.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/samr.h"
+#include "auth/auth.h"
+#include "param/param.h"
static int net_samdump_keytab_usage(struct net_context *ctx, int argc, const char **argv)
{
return net_samdump_keytab_usage(ctx, argc, argv);
break;
case 1:
- r.keytab_name = argv[0];
+ r.in.keytab_name = argv[0];
break;
}
}
libnetctx->cred = ctx->credentials;
- r.level = LIBNET_SAMDUMP_GENERIC;
- r.error_string = NULL;
+ r.out.error_string = NULL;
+ r.in.machine_account = NULL;
+ r.in.binding_string = NULL;
status = libnet_SamDump_keytab(libnetctx, ctx->mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("libnet_SamDump returned %s: %s\n",
nt_errstr(status),
- r.error_string));
+ r.out.error_string));
return -1;
}
}
libnetctx->cred = ctx->credentials;
- r.level = LIBNET_SAMDUMP_GENERIC;
- r.error_string = NULL;
+ r.out.error_string = NULL;
+ r.in.machine_account = NULL;
+ r.in.binding_string = NULL;
status = libnet_SamDump(libnetctx, ctx->mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("libnet_SamDump returned %s: %s\n",
nt_errstr(status),
- r.error_string));
+ r.out.error_string));
return -1;
}
}
libnetctx->cred = ctx->credentials;
- r.level = LIBNET_SAMSYNC_LDB_GENERIC;
- r.error_string = NULL;
+ r.out.error_string = NULL;
+ r.in.machine_account = NULL;
+ r.in.binding_string = NULL;
- status = libnet_samsync_ldb(libnetctx, ctx->mem_ctx, &r);
+ /* Needed to override the ACLs on ldb */
+ r.in.session_info = system_session(libnetctx, ctx->lp_ctx);
+
+ status = libnet_samsync_ldb(libnetctx, libnetctx, &r);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("libnet_samsync_ldb returned %s: %s\n",
nt_errstr(status),
- r.error_string));
+ r.out.error_string));
return -1;
}
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");
+ d_printf("Synchronise into the local ldb the SAM of a domain.\n");
return 0;
}