亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? net_rpc.c

?? samba-3.0.22.tar.gz 編譯smb服務器的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*    Samba Unix/Linux SMB client library    Distributed SMB/CIFS Server Management Utility    Copyright (C) 2001 Andrew Bartlett (abartlet@samba.org)   Copyright (C) 2002 Jim McDonough (jmcd@us.ibm.com)   Copyright (C) 2004 Guenther Deschner (gd@samba.org)   Copyright (C) 2005 Jeremy Allison (jra@samba.org)   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 int net_mode_share;/** * @file net_rpc.c * * @brief RPC based subcommands for the 'net' utility. * * This file should contain much of the functionality that used to * be found in rpcclient, execpt that the commands should change  * less often, and the fucntionality should be sane (the user is not  * expected to know a rid/sid before they conduct an operation etc.) * * @todo Perhaps eventually these should be split out into a number * of files, as this could get quite big. **//** * Many of the RPC functions need the domain sid.  This function gets *  it at the start of every run  * * @param cli A cli_state already connected to the remote machine * * @return The Domain SID of the remote machine. **/static DOM_SID *net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx, char **domain_name){	struct rpc_pipe_client *lsa_pipe;	DOM_SID *domain_sid;	POLICY_HND pol;	NTSTATUS result = NT_STATUS_OK;	uint32 info_class = 5;		lsa_pipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result);	if (!lsa_pipe) {		fprintf(stderr, "could not initialise lsa pipe\n");		goto error;	}		result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False, 				     SEC_RIGHTS_MAXIMUM_ALLOWED,				     &pol);	if (!NT_STATUS_IS_OK(result)) {		goto error;	}	result = rpccli_lsa_query_info_policy(lsa_pipe, mem_ctx, &pol, info_class, 					   domain_name, &domain_sid);	if (!NT_STATUS_IS_OK(result)) { error:		fprintf(stderr, "could not obtain sid for domain %s\n", cli->domain);		if (!NT_STATUS_IS_OK(result)) {			fprintf(stderr, "error: %s\n", nt_errstr(result));		}		exit(1);	}	if (lsa_pipe) {		rpccli_lsa_close(lsa_pipe, mem_ctx, &pol);		cli_rpc_pipe_close(lsa_pipe);	}	return domain_sid;}/** * Run a single RPC command, from start to finish. * * @param pipe_name the pipe to connect to (usually a PIPE_ constant) * @param conn_flag a NET_FLAG_ combination.  Passed to  *                   net_make_ipc_connection. * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * @return A shell status integer (0 for success) */int run_rpc_command(struct cli_state *cli_arg,			const int pipe_idx,			int conn_flags,			rpc_command_fn fn,			int argc,			const char **argv) {	struct cli_state *cli = NULL;	struct rpc_pipe_client *pipe_hnd = NULL;	TALLOC_CTX *mem_ctx;	NTSTATUS nt_status;	DOM_SID *domain_sid;	char *domain_name;	/* make use of cli_state handed over as an argument, if possible */	if (!cli_arg) {		cli = net_make_ipc_connection(conn_flags);	} else {		cli = cli_arg;	}	if (!cli) {		return -1;	}	/* Create mem_ctx */		if (!(mem_ctx = talloc_init("run_rpc_command"))) {		DEBUG(0, ("talloc_init() failed\n"));		cli_shutdown(cli);		return -1;	}		domain_sid = net_get_remote_domain_sid(cli, mem_ctx, &domain_name);	if (!(conn_flags & NET_FLAGS_NO_PIPE)) {		if (lp_client_schannel() && (pipe_idx == PI_NETLOGON)) {			/* Always try and create an schannel netlogon pipe. */			pipe_hnd = cli_rpc_pipe_open_schannel(cli, pipe_idx,							PIPE_AUTH_LEVEL_PRIVACY,							domain_name,							&nt_status);			if (!pipe_hnd) {				DEBUG(0, ("Could not initialise schannel netlogon pipe. Error was %s\n",					nt_errstr(nt_status) ));				cli_shutdown(cli);				return -1;			}		} else {			pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &nt_status);			if (!pipe_hnd) {				DEBUG(0, ("Could not initialise pipe %s. Error was %s\n",					cli_get_pipe_name(pipe_idx),					nt_errstr(nt_status) ));				cli_shutdown(cli);				return -1;			}		}	}		nt_status = fn(domain_sid, domain_name, cli, pipe_hnd, mem_ctx, argc, argv);		if (!NT_STATUS_IS_OK(nt_status)) {		DEBUG(1, ("rpc command function failed! (%s)\n", nt_errstr(nt_status)));	} else {		DEBUG(5, ("rpc command function succedded\n"));	}			if (!(conn_flags & NET_FLAGS_NO_PIPE)) {		if (pipe_hnd) {			cli_rpc_pipe_close(pipe_hnd);		}	}	/* close the connection only if it was opened here */	if (!cli_arg) {		cli_shutdown(cli);	}		talloc_destroy(mem_ctx);	return (!NT_STATUS_IS_OK(nt_status));}/**  * Force a change of the trust acccount password. * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passes through.  * * @param domain_sid The domain sid aquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on compleation of the function. * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/static NTSTATUS rpc_changetrustpw_internals(const DOM_SID *domain_sid,					const char *domain_name, 					struct cli_state *cli,					struct rpc_pipe_client *pipe_hnd,					TALLOC_CTX *mem_ctx, 					int argc,					const char **argv){		return trust_pw_find_change_and_store_it(pipe_hnd, mem_ctx, opt_target_workgroup);}/**  * Force a change of the trust acccount password. * * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * @return A shell status integer (0 for success) **/int net_rpc_changetrustpw(int argc, const char **argv) {	return run_rpc_command(NULL, PI_NETLOGON, NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC, 			       rpc_changetrustpw_internals,			       argc, argv);}/**  * Join a domain, the old way. * * This uses 'machinename' as the inital password, and changes it.  * * The password should be created with 'server manager' or equiv first. * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passes through.  * * @param domain_sid The domain sid aquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on compleation of the function. * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/static NTSTATUS rpc_oldjoin_internals(const DOM_SID *domain_sid,					const char *domain_name, 					struct cli_state *cli, 					struct rpc_pipe_client *pipe_hnd,					TALLOC_CTX *mem_ctx, 					int argc,					const char **argv){		fstring trust_passwd;	unsigned char orig_trust_passwd_hash[16];	NTSTATUS result;	uint32 sec_channel_type;	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, &result);	if (!pipe_hnd) {		DEBUG(0,("rpc_oldjoin_internals: netlogon pipe open to machine %s failed. "			"error was %s\n",			cli->desthost,			nt_errstr(result) ));		return result;	}	/* 	   check what type of join - if the user want's to join as	   a BDC, the server must agree that we are a BDC.	*/	if (argc >= 0) {		sec_channel_type = get_sec_channel_type(argv[0]);	} else {		sec_channel_type = get_sec_channel_type(NULL);	}		fstrcpy(trust_passwd, global_myname());	strlower_m(trust_passwd);	/*	 * Machine names can be 15 characters, but the max length on	 * a password is 14.  --jerry	 */	trust_passwd[14] = '\0';	E_md4hash(trust_passwd, orig_trust_passwd_hash);	result = trust_pw_change_and_store_it(pipe_hnd, mem_ctx, opt_target_workgroup,					      orig_trust_passwd_hash,					      sec_channel_type);	if (NT_STATUS_IS_OK(result))		printf("Joined domain %s.\n",opt_target_workgroup);	if (!secrets_store_domain_sid(opt_target_workgroup, domain_sid)) {		DEBUG(0, ("error storing domain sid for %s\n", opt_target_workgroup));		result = NT_STATUS_UNSUCCESSFUL;	}	return result;}/**  * Join a domain, the old way. * * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * @return A shell status integer (0 for success) **/static int net_rpc_perform_oldjoin(int argc, const char **argv){	return run_rpc_command(NULL, PI_NETLOGON, 			       NET_FLAGS_NO_PIPE | NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC, 			       rpc_oldjoin_internals,			       argc, argv);}/**  * Join a domain, the old way.  This function exists to allow * the message to be displayed when oldjoin was explicitly  * requested, but not when it was implied by "net rpc join" * * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * @return A shell status integer (0 for success) **/static int net_rpc_oldjoin(int argc, const char **argv) {	int rc = net_rpc_perform_oldjoin(argc, argv);	if (rc) {		d_fprintf(stderr, "Failed to join domain\n");	}	return rc;}/**  * Basic usage function for 'net rpc join' * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped **/static int rpc_join_usage(int argc, const char **argv) {		d_printf("net rpc join -U <username>[%%password] <type>[options]\n"\		 "\t to join a domain with admin username & password\n"\		 "\t\t password will be prompted if needed and none is specified\n"\		 "\t <type> can be (default MEMBER)\n"\		 "\t\t BDC - Join as a BDC\n"\		 "\t\t PDC - Join as a PDC\n"\		 "\t\t MEMBER - Join as a MEMBER server\n");	net_common_flags_usage(argc, argv);	return -1;}/**  * 'net rpc join' entrypoint. * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped * * Main 'net_rpc_join()' (where the admain username/password is used) is  * in net_rpc_join.c * Try to just change the password, but if that doesn't work, use/prompt * for a username/password. **/int net_rpc_join(int argc, const char **argv) {	if ((net_rpc_perform_oldjoin(argc, argv) == 0))		return 0;		return net_rpc_join_newstyle(argc, argv);}/**  * display info about a rpc domain * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passed through.  * * @param domain_sid The domain sid acquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on completion of the function. * @param argc  Standard main() style argc * @param argv  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/static NTSTATUS rpc_info_internals(const DOM_SID *domain_sid,			const char *domain_name, 			struct cli_state *cli,			struct rpc_pipe_client *pipe_hnd,			TALLOC_CTX *mem_ctx,			int argc,			const char **argv){	POLICY_HND connect_pol, domain_pol;	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;	SAM_UNK_CTR ctr;	fstring sid_str;	sid_to_string(sid_str, domain_sid);	/* Get sam policy handle */		result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS, 				  &connect_pol);	if (!NT_STATUS_IS_OK(result)) {		goto done;	}		/* Get domain policy handle */	result = rpccli_samr_open_domain(pipe_hnd, mem_ctx, &connect_pol,				      MAXIMUM_ALLOWED_ACCESS,				      domain_sid, &domain_pol);	if (!NT_STATUS_IS_OK(result)) {		goto done;	}	ZERO_STRUCT(ctr);	result = rpccli_samr_query_dom_info(pipe_hnd, mem_ctx, &domain_pol,					 2, &ctr);	if (NT_STATUS_IS_OK(result)) {		TALLOC_CTX *ctx = talloc_init("rpc_info_internals");		d_printf("Domain Name: %s\n", unistr2_tdup(ctx, &ctr.info.inf2.uni_domain));		d_printf("Domain SID: %s\n", sid_str);		d_printf("Sequence number: %u\n", ctr.info.inf2.seq_num.low);		d_printf("Num users: %u\n", ctr.info.inf2.num_domain_usrs);		d_printf("Num domain groups: %u\n", ctr.info.inf2.num_domain_grps);		d_printf("Num local groups: %u\n", ctr.info.inf2.num_local_grps);		talloc_destroy(ctx);	} done:	return result;}/**  * 'net rpc info' entrypoint. * @param argc  Standard main() style argc * @param argc  Standard main() style argv.  Initial components are already *              stripped **/int net_rpc_info(int argc, const char **argv) {	return run_rpc_command(NULL, PI_SAMR, NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC, 			       rpc_info_internals,			       argc, argv);}/**  * Fetch domain SID into the local secrets.tdb * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passes through.  * * @param domain_sid The domain sid acquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on completion of the function. * @param argc  Standard main() style argc * @param argv  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/static NTSTATUS rpc_getsid_internals(const DOM_SID *domain_sid,			const char *domain_name, 			struct cli_state *cli,			struct rpc_pipe_client *pipe_hnd,			TALLOC_CTX *mem_ctx,			int argc,			const char **argv){	fstring sid_str;	sid_to_string(sid_str, domain_sid);	d_printf("Storing SID %s for Domain %s in secrets.tdb\n",		 sid_str, domain_name);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国欧美国产| 亚洲大型综合色站| 国产a视频精品免费观看| 久久品道一品道久久精品| 亚洲国产成人午夜在线一区| 综合欧美亚洲日本| 国产日韩欧美电影| 国产精品自拍av| 极品瑜伽女神91| 国产精品资源在线看| 亚洲日本青草视频在线怡红院 | 91在线观看地址| 国产在线不卡一区| 91久久国产最好的精华液| 中文字幕中文字幕一区| 成人激情午夜影院| 国产精品二三区| 日本韩国精品在线| 亚洲成人精品在线观看| 日韩一级二级三级| 狠狠色2019综合网| 久久久久久久久久久99999| 精品一区二区三区在线播放视频| 欧美成人艳星乳罩| 国产精品亚洲第一区在线暖暖韩国| 久久一区二区三区国产精品| 国产在线播放一区二区三区| 国产精品素人视频| 在线免费一区三区| 人禽交欧美网站| 精品毛片乱码1区2区3区| 国产超碰在线一区| 亚洲免费在线观看视频| 911精品产国品一二三产区| 日本亚洲电影天堂| 国产欧美一区二区精品秋霞影院| 成人av综合在线| 亚洲最新在线观看| 欧美一区二区日韩| va亚洲va日韩不卡在线观看| 亚洲欧美日韩系列| 日韩欧美aaaaaa| 国产美女精品一区二区三区| 国产精品福利av| 欧美理论片在线| 日本中文一区二区三区| 精品成人私密视频| 色嗨嗨av一区二区三区| 久久国产福利国产秒拍| 亚洲欧洲成人av每日更新| 欧美乱妇一区二区三区不卡视频| 国产精品一区一区| 亚洲二区视频在线| 欧美激情资源网| 91精品在线麻豆| 色综合久久久久久久久| 免费成人结看片| 亚洲欧洲另类国产综合| 欧美videossexotv100| 色狠狠综合天天综合综合| 狠狠色伊人亚洲综合成人| 亚洲女同一区二区| 精品乱人伦一区二区三区| 一本久道久久综合中文字幕| 六月丁香综合在线视频| 亚洲欧美自拍偷拍| 日韩三级伦理片妻子的秘密按摩| 99国产精品视频免费观看| 九九久久精品视频| 天天做天天摸天天爽国产一区| 国产亚洲欧美中文| 日韩精品最新网址| 精品视频一区二区不卡| 97久久精品人人爽人人爽蜜臀| 久久精品久久综合| 五月综合激情网| 樱花影视一区二区| 国产精品国产成人国产三级| 日韩欧美国产三级| 欧美三级在线看| 99精品视频一区二区| 国产精品一区二区久激情瑜伽| 图片区日韩欧美亚洲| 一级女性全黄久久生活片免费| 亚洲国产高清不卡| 久久久久久亚洲综合影院红桃| 欧美日韩国产高清一区| 欧美亚日韩国产aⅴ精品中极品| 国产成人精品免费在线| 国产精品一卡二卡在线观看| 狠狠色丁香久久婷婷综合_中 | 欧美激情一区二区三区不卡| 日韩一区二区在线看| 欧美日韩国产成人在线免费| av一区二区三区黑人| 波多野结衣中文字幕一区| 国产成人午夜视频| 粉嫩av一区二区三区| 国产传媒一区在线| 国产成人在线观看| 成人一区二区三区| 成人激情免费网站| 99久久伊人网影院| 91久久奴性调教| 欧亚洲嫩模精品一区三区| 欧美日韩国产一区二区三区地区| 99麻豆久久久国产精品免费优播| 国产成人欧美日韩在线电影| 国产在线精品一区二区夜色| 开心九九激情九九欧美日韩精美视频电影 | 一区二区三区四区在线播放 | 中文字幕佐山爱一区二区免费| 中文字幕不卡在线| 综合网在线视频| 亚洲一二三四在线| 久久精品国产精品亚洲综合| 国产成人精品综合在线观看| 97se亚洲国产综合在线| 欧美少妇一区二区| 欧美一级电影网站| 国产女人18水真多18精品一级做| 日韩理论片网站| 天天影视涩香欲综合网| 韩国视频一区二区| 99久久99久久免费精品蜜臀| 精品污污网站免费看| 精品999久久久| 亚洲女与黑人做爰| 久久精品国产77777蜜臀| 高清在线不卡av| 欧美伊人久久久久久午夜久久久久| 在线不卡a资源高清| 国产日韩欧美激情| 亚洲国产色一区| 国产一区二区导航在线播放| 91首页免费视频| 日韩一卡二卡三卡四卡| 国产精品不卡在线观看| 天天做天天摸天天爽国产一区| 国产成人精品影院| 欧美午夜免费电影| 日韩欧美成人激情| 一区二区三区精品视频在线| 国内精品久久久久影院一蜜桃| av欧美精品.com| 精品区一区二区| 性久久久久久久| 国产伦精品一区二区三区视频青涩 | 欧美一二三四在线| 日韩美女啊v在线免费观看| 日本欧美大码aⅴ在线播放| 成人性生交大合| 91精品国产高清一区二区三区蜜臀 | 精品少妇一区二区三区视频免付费| 17c精品麻豆一区二区免费| 免费不卡在线视频| 色播五月激情综合网| 精品人在线二区三区| 性做久久久久久免费观看| av中文字幕亚洲| 日本一区二区三区视频视频| 日韩**一区毛片| 在线影院国内精品| 亚洲视频一区二区在线观看| 国内精品写真在线观看| 欧美二区三区91| 亚洲精品乱码久久久久久黑人| 成人做爰69片免费看网站| 91精品国产乱| 视频一区二区中文字幕| 欧美在线短视频| 一区二区三区在线观看动漫| av激情亚洲男人天堂| 国产偷国产偷精品高清尤物 | 热久久一区二区| 欧美日韩黄视频| 亚洲国产欧美在线| 在线欧美日韩国产| 亚洲国产精品一区二区久久恐怖片| 99riav一区二区三区| 国产精品国产三级国产aⅴ中文| 国产乱码精品一区二区三| 精品久久久久久综合日本欧美| 免费看精品久久片| 日韩一区二区三区四区| 免费看欧美女人艹b| 欧美tickling挠脚心丨vk| 免播放器亚洲一区| 欧美一区二区三区成人| 美女高潮久久久| 精品国产一区二区在线观看| 麻豆91在线看| 2014亚洲片线观看视频免费| 国产在线日韩欧美| 欧美国产在线观看| av影院午夜一区| 中文字幕一区二区三区蜜月| 国产成人aaa| 亚洲韩国精品一区| 色婷婷一区二区|