From 862e610e4af0eb8b660c5526401cbe6f751444be Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 18 Jan 2005 14:46:24 +0000 Subject: r4820: add beginnings of 'net rpc rights' for managing privilege assignments (This used to be commit 164f94e52929330bd638f19bcf3bfce50303269e) --- source3/utils/net_rpc_rights.c | 116 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 source3/utils/net_rpc_rights.c (limited to 'source3/utils/net_rpc_rights.c') diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c new file mode 100644 index 0000000000..f1e61ae9ba --- /dev/null +++ b/source3/utils/net_rpc_rights.c @@ -0,0 +1,116 @@ +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility + Copyright (C) Gerald (Jerry) Carter 2004 + + 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 + (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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include "includes.h" +#include "utils/net.h" + +/******************************************************************** +********************************************************************/ + +static NTSTATUS rpc_rights_list_internal( const DOM_SID *domain_sid, const char *domain_name, + struct cli_state *cli, TALLOC_CTX *mem_ctx, + int argc, const char **argv ) +{ + return NT_STATUS_OK; +} + +/******************************************************************** +********************************************************************/ + +static NTSTATUS rpc_rights_grant_internal( const DOM_SID *domain_sid, const char *domain_name, + struct cli_state *cli, TALLOC_CTX *mem_ctx, + int argc, const char **argv ) +{ + return NT_STATUS_OK; +} + +/******************************************************************** +********************************************************************/ + +static NTSTATUS rpc_rights_revoke_internal( const DOM_SID *domain_sid, const char *domain_name, + struct cli_state *cli, TALLOC_CTX *mem_ctx, + int argc, const char **argv ) +{ + return NT_STATUS_OK; +} + +/******************************************************************** +********************************************************************/ + +static int rpc_rights_list( int argc, const char **argv ) +{ + return run_rpc_command( NULL, PI_LSARPC, 0, + rpc_rights_list_internal, argc, argv ); +} + +/******************************************************************** +********************************************************************/ + +static int rpc_rights_grant( int argc, const char **argv ) +{ + return run_rpc_command( NULL, PI_LSARPC, 0, + rpc_rights_grant_internal, argc, argv ); +} + +/******************************************************************** +********************************************************************/ + +static int rpc_rights_revoke( int argc, const char **argv ) +{ + return run_rpc_command( NULL, PI_LSARPC, 0, + rpc_rights_revoke_internal, argc, argv ); +} + +/******************************************************************** +********************************************************************/ + +static int net_help_rights( int argc, const char **argv ) +{ + d_printf("net rpc rights list View available privileges\n"); + d_printf("net rpc rights grant View available privileges\n"); + d_printf("net rpc rights revoke View available privileges\n"); + + d_printf("Both 'grant' and 'revoke' require a SID and a commaa separated\n"); + d_printf("list of privilege names. For example\n"); + d_printf(" net rpc grant S-1-5-32-550 SePrintOperatorsPrivilege\n"); + d_printf("would grant the printer admin right to the 'BUILTIN\\Print Operators' group\n"); + + + return -1; +} + +/******************************************************************** +********************************************************************/ + +int net_rpc_rights(int argc, const char **argv) +{ + struct functable func[] = { + {"list", rpc_rights_list}, + {"grant", rpc_rights_grant}, + {"revoke", rpc_rights_revoke}, + {NULL, NULL} + }; + + if ( argc ) + return net_run_function( argc, argv, func, net_help_rights ); + + return net_help_rights( argc, argv ); +} + + -- cgit