diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-12 16:07:00 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-12 16:07:00 +0000 |
commit | 5b863af4c0179f0bee17e77690d99a54cc762531 (patch) | |
tree | 516559fc7d6551e02bc6edf4089f0024c13cb127 /source3/rpc_client/cli_reg.c | |
parent | 1ab463a79575316612097445ea40b9dd7bcb84bd (diff) | |
download | samba-5b863af4c0179f0bee17e77690d99a54cc762531.tar.gz samba-5b863af4c0179f0bee17e77690d99a54cc762531.tar.bz2 samba-5b863af4c0179f0bee17e77690d99a54cc762531.zip |
cleaning up conflicts between group code not yet committed and
changes from yesterday by me, jeremy and andrew.
jeremy, your ACB_PWNOTREQ mod would have caused a crash if the user
didn't exist (first check should be for smb_pass != NULL)
(This used to be commit cbac0f165d351ba9497c222e55e453d781376e58)
Diffstat (limited to 'source3/rpc_client/cli_reg.c')
-rw-r--r-- | source3/rpc_client/cli_reg.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c index 69982a8d44..5eccdc7826 100644 --- a/source3/rpc_client/cli_reg.c +++ b/source3/rpc_client/cli_reg.c @@ -3,9 +3,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1998, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1998, + * Copyright (C) Paul Ashton 1997-1998. * * 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 @@ -438,6 +438,54 @@ BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd, } /**************************************************************************** +do a REG Set Key Security +****************************************************************************/ +BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd, + uint32 sec_buf_size, SEC_DESC *sec_buf) +{ + prs_struct rbuf; + prs_struct buf; + REG_Q_SET_KEY_SEC q_o; + BOOL valid_query = False; + + if (hnd == NULL) return False; + + prs_init(&buf , 1024, 4, SAFETY_MARGIN, False); + prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True ); + + /* create and send a MSRPC command with api REG_SET_KEY_SEC */ + + DEBUG(4,("REG Set Key security.\n")); + + make_reg_q_set_key_sec(&q_o, hnd, sec_buf_size, sec_buf); + + /* turn parameters into data stream */ + reg_io_q_set_key_sec("", &q_o, &buf, 0); + + /* send the data on \PIPE\ */ + if (rpc_api_pipe_req(cli, REG_SET_KEY_SEC, &buf, &rbuf)) + { + REG_R_SET_KEY_SEC r_o; + BOOL p; + + ZERO_STRUCT(r_o); + + reg_io_r_set_key_sec("", &r_o, &rbuf, 0); + p = rbuf.offset != 0; + + if (p && r_o.status != 0) + { + valid_query = True; + } + } + + prs_mem_free(&rbuf); + prs_mem_free(&buf ); + + return valid_query; +} + +/**************************************************************************** do a REG Query Key Security ****************************************************************************/ BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd, |