diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
commit | e5a951325a6cac8567af3a66de6d2df577508ae4 (patch) | |
tree | 34da9fe59f3c2d7f8edb072144443a9704197831 /examples/libmsrpc/test/sam/enable.c | |
parent | 57482469b32645250e92a7ffd003aeeb4a42235e (diff) | |
download | samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.gz samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.bz2 samba-e5a951325a6cac8567af3a66de6d2df577508ae4.zip |
[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
Diffstat (limited to 'examples/libmsrpc/test/sam/enable.c')
-rw-r--r-- | examples/libmsrpc/test/sam/enable.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/examples/libmsrpc/test/sam/enable.c b/examples/libmsrpc/test/sam/enable.c deleted file mode 100644 index bb91fb241c..0000000000 --- a/examples/libmsrpc/test/sam/enable.c +++ /dev/null @@ -1,64 +0,0 @@ -/*enable a user*/ - -#include "libmsrpc.h" -#include "test_util.h" - -int main(int argc, char **argv) { - CacServerHandle *hnd = NULL; - TALLOC_CTX *mem_ctx = NULL; - - struct SamOpenUser ou; - - fstring tmp; - - mem_ctx = talloc_init("cac_samgroup"); - - hnd = cac_NewServerHandle(True); - - cac_SetAuthDataFn(hnd, cactest_GetAuthDataFn); - - cac_parse_cmd_line(argc, argv, hnd); - - if(!cac_Connect(hnd, NULL)) { - fprintf(stderr, "Could not connect to server %s. Error: %s\n", hnd->server, nt_errstr(hnd->status)); - exit(-1); - } - - struct SamOpenDomain sod; - ZERO_STRUCT(sod); - - sod.in.access = MAXIMUM_ALLOWED_ACCESS; - - if(!cac_SamOpenDomain(hnd, mem_ctx, &sod)) { - fprintf(stderr, "Could not open domain. Error: %s\n", nt_errstr(hnd->status)); - goto done; - } - - ZERO_STRUCT(ou); - printf("Enter username: "); - cactest_readline(stdin, tmp); - - ou.in.name = talloc_strdup(mem_ctx, tmp); - ou.in.access = MAXIMUM_ALLOWED_ACCESS; - ou.in.dom_hnd = sod.out.dom_hnd; - - if(!cac_SamOpenUser(hnd, mem_ctx, &ou)) { - fprintf(stderr, "Could not open user. Error: %s\n", nt_errstr(hnd->status)); - goto done; - } - - /*enable the user*/ - if(!cac_SamEnableUser(hnd, mem_ctx, ou.out.user_hnd)) { - fprintf(stderr, "Could not enable user: %s\n", nt_errstr(hnd->status)); - } - -done: - cac_SamClose(hnd, mem_ctx, sod.out.dom_hnd); - - cac_FreeHandle(hnd); - - talloc_destroy(mem_ctx); - - return 0; -} - |