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

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

?? net_rpc_registry.c

?? samba-3.0.22.tar.gz 編譯smb服務器的源碼
?? C
字號:
/*    Samba Unix/Linux SMB client library    Distributed SMB/CIFS Server Management Utility    Copyright (C) Gerald (Jerry) Carter          2005   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"#include "regfio.h"#include "reg_objects.h"/****************************************************************************************************************************************/char* dump_regval_type( uint32 type ){	static fstring string;		switch (type) {	case REG_SZ:		fstrcpy( string, "REG_SZ" );		break;	case REG_MULTI_SZ:		fstrcpy( string, "REG_MULTI_SZ" );		break;	case REG_EXPAND_SZ:		fstrcpy( string, "REG_EXPAND_SZ" );		break;	case REG_DWORD:		fstrcpy( string, "REG_DWORD" );		break;	case REG_BINARY:		fstrcpy( string, "REG_BINARY" );		break;	default:		fstr_sprintf( string, "UNKNOWN [%d]", type );	}		return string;}/****************************************************************************************************************************************/void dump_regval_buffer( uint32 type, REGVAL_BUFFER *buffer ){	pstring string;	uint32 value;		switch (type) {	case REG_SZ:		rpcstr_pull( string, buffer->buffer, sizeof(string), -1, STR_TERMINATE );		d_printf("%s\n", string);		break;	case REG_MULTI_SZ:		d_printf("\n");		break;	case REG_DWORD:		value = IVAL( buffer->buffer, 0 );		d_printf( "0x%x\n", value );		break;	case REG_BINARY:		d_printf("\n");		break;			default:		d_printf( "\tUnknown type [%d]\n", type );	}}/****************************************************************************************************************************************/static NTSTATUS rpc_registry_enumerate_internal(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 ){	WERROR result = WERR_GENERAL_FAILURE;	uint32 hive;	pstring subpath;	POLICY_HND pol_hive, pol_key; 	uint32 idx;		if (argc != 1 ) {		d_printf("Usage:    net rpc enumerate <path> [recurse]\n");		d_printf("Example:: net rpc enumerate 'HKLM\\Software\\Samba'\n");		return NT_STATUS_OK;	}		if ( !reg_split_hive( argv[0], &hive, subpath ) ) {		d_fprintf(stderr, "invalid registry path\n");		return NT_STATUS_OK;	}		/* open the top level hive and then the registry key */		result = rpccli_reg_connect(pipe_hnd, mem_ctx, hive, MAXIMUM_ALLOWED_ACCESS, &pol_hive );	if ( !W_ERROR_IS_OK(result) ) {		d_fprintf(stderr, "Unable to connect to remote registry\n");		return werror_to_ntstatus(result);	}		if ( strlen( subpath ) != 0 ) {		result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key );		if ( !W_ERROR_IS_OK(result) ) {			d_fprintf(stderr, "Unable to open [%s]\n", argv[0]);			return werror_to_ntstatus(result);		}	}		/* get the subkeys */		result = WERR_OK;	idx = 0;	while ( W_ERROR_IS_OK(result) ) {		time_t modtime;		fstring keyname, classname;				result = rpccli_reg_enum_key(pipe_hnd, mem_ctx, &pol_key, idx, 			keyname, classname, &modtime );					if ( W_ERROR_EQUAL(result, WERR_NO_MORE_ITEMS) ) {			result = WERR_OK;			break;		}					d_printf("Keyname   = %s\n", keyname );		d_printf("Classname = %s\n", classname );		d_printf("Modtime   = %s\n", http_timestring(modtime) );		d_printf("\n" );		idx++;	}	if ( !W_ERROR_IS_OK(result) )		goto out;		/* get the values */		result = WERR_OK;	idx = 0;	while ( W_ERROR_IS_OK(result) ) {		uint32 type;		fstring name;		REGVAL_BUFFER value;				fstrcpy( name, "" );		ZERO_STRUCT( value );				result = rpccli_reg_enum_val(pipe_hnd, mem_ctx, &pol_key, idx, 			name, &type, &value );					if ( W_ERROR_EQUAL(result, WERR_NO_MORE_ITEMS) ) {			result = WERR_OK;			break;		}					d_printf("Valuename  = %s\n", name );		d_printf("Type       = %s\n", dump_regval_type(type) );		d_printf("Data       = " );		dump_regval_buffer( type, &value );		d_printf("\n" );		idx++;	}		out:	/* cleanup */		if ( strlen( subpath ) != 0 )		rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key );	rpccli_reg_close(pipe_hnd, mem_ctx, &pol_hive );	return werror_to_ntstatus(result);}/****************************************************************************************************************************************/static int rpc_registry_enumerate( int argc, const char **argv ){	return run_rpc_command( NULL, PI_WINREG, 0, 		rpc_registry_enumerate_internal, argc, argv );}/****************************************************************************************************************************************/static NTSTATUS rpc_registry_save_internal(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 ){	WERROR result = WERR_GENERAL_FAILURE;	uint32 hive;	pstring subpath;	POLICY_HND pol_hive, pol_key; 		if (argc != 2 ) {		d_printf("Usage:    net rpc backup <path> <file> \n");		return NT_STATUS_OK;	}		if ( !reg_split_hive( argv[0], &hive, subpath ) ) {		d_fprintf(stderr, "invalid registry path\n");		return NT_STATUS_OK;	}		/* open the top level hive and then the registry key */		result = rpccli_reg_connect(pipe_hnd, mem_ctx, hive, MAXIMUM_ALLOWED_ACCESS, &pol_hive );	if ( !W_ERROR_IS_OK(result) ) {		d_fprintf(stderr, "Unable to connect to remote registry\n");		return werror_to_ntstatus(result);	}		result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key );	if ( !W_ERROR_IS_OK(result) ) {		d_fprintf(stderr, "Unable to open [%s]\n", argv[0]);		return werror_to_ntstatus(result);	}		result = rpccli_reg_save_key(pipe_hnd, mem_ctx, &pol_key, argv[1] );	if ( !W_ERROR_IS_OK(result) ) {		d_fprintf(stderr, "Unable to save [%s] to %s:%s\n", argv[0], cli->desthost, argv[1]);	}			/* cleanup */		rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key );	rpccli_reg_close(pipe_hnd, mem_ctx, &pol_hive );	return werror_to_ntstatus(result);}/****************************************************************************************************************************************/static int rpc_registry_save( int argc, const char **argv ){	return run_rpc_command( NULL, PI_WINREG, 0, 		rpc_registry_save_internal, argc, argv );}/****************************************************************************************************************************************/static void dump_values( REGF_NK_REC *nk ){	int i, j;	pstring data_str;	uint32 data_size, data;	if ( !nk->values )		return;	for ( i=0; i<nk->num_values; i++ ) {		d_printf( "\"%s\" = ", nk->values[i].valuename ? nk->values[i].valuename : "(default)" );		d_printf( "(%s) ", dump_regval_type( nk->values[i].type ) );		data_size = nk->values[i].data_size & ~VK_DATA_IN_OFFSET;		switch ( nk->values[i].type ) {			case REG_SZ:				rpcstr_pull( data_str, nk->values[i].data, sizeof(data_str), -1, STR_TERMINATE );				d_printf( "%s", data_str );				break;			case REG_MULTI_SZ:			case REG_EXPAND_SZ:				for ( j=0; j<data_size; j++ ) {					d_printf( "%c", nk->values[i].data[j] );				}				break;			case REG_DWORD:				data = IVAL( nk->values[i].data, 0 );				d_printf("0x%x", data );				break;			case REG_BINARY:				for ( j=0; j<data_size; j++ ) {					d_printf( "%x", nk->values[i].data[j] );				}				break;			default:				d_printf("unknown");				break;		}		d_printf( "\n" );	}}/****************************************************************************************************************************************/static BOOL dump_registry_tree( REGF_FILE *file, REGF_NK_REC *nk, const char *parent ){	REGF_NK_REC *key;	pstring regpath;	/* depth first dump of the registry tree */	while ( (key = regfio_fetch_subkey( file, nk )) ) {		pstr_sprintf( regpath, "%s\\%s", parent, key->keyname );		d_printf("[%s]\n", regpath );		dump_values( key );		d_printf("\n");		dump_registry_tree( file, key, regpath );	}	return True;}/****************************************************************************************************************************************/static BOOL write_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,                                  REGF_NK_REC *parent, REGF_FILE *outfile,			         const char *parentpath ){	REGF_NK_REC *key, *subkey;	REGVAL_CTR *values;	REGSUBKEY_CTR *subkeys;	int i;	pstring path;	if ( !( subkeys = TALLOC_ZERO_P( infile->mem_ctx, REGSUBKEY_CTR )) ) {		DEBUG(0,("write_registry_tree: talloc() failed!\n"));		return False;	}	if ( !(values = TALLOC_ZERO_P( subkeys, REGVAL_CTR )) ) {		DEBUG(0,("write_registry_tree: talloc() failed!\n"));		return False;	}	/* copy values into the REGVAL_CTR */		for ( i=0; i<nk->num_values; i++ ) {		regval_ctr_addvalue( values, nk->values[i].valuename, nk->values[i].type,			(const char *)nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );	}	/* copy subkeys into the REGSUBKEY_CTR */		while ( (subkey = regfio_fetch_subkey( infile, nk )) ) {		regsubkey_ctr_addkey( subkeys, subkey->keyname );	}		key = regfio_write_key( outfile, nk->keyname, values, subkeys, nk->sec_desc->sec_desc, parent );	/* write each one of the subkeys out */	pstr_sprintf( path, "%s%s%s", parentpath, parent ? "\\" : "", nk->keyname );	nk->subkey_index = 0;	while ( (subkey = regfio_fetch_subkey( infile, nk )) ) {		write_registry_tree( infile, subkey, key, outfile, path );	}	TALLOC_FREE( subkeys );	d_printf("[%s]\n", path );		return True;}/****************************************************************************************************************************************/static int rpc_registry_dump( int argc, const char **argv ){	REGF_FILE   *registry;	REGF_NK_REC *nk;		if (argc != 1 ) {		d_printf("Usage:    net rpc dump <file> \n");		return 0;	}		d_printf("Opening %s....", argv[0]);	if ( !(registry = regfio_open( argv[0], O_RDONLY, 0)) ) {		d_fprintf(stderr, "Failed to open %s for reading\n", argv[0]);		return 1;	}	d_printf("ok\n");		/* get the root of the registry file */		nk = regfio_rootkey( registry );	d_printf("[%s]\n", nk->keyname);	dump_values( nk );	d_printf("\n");	dump_registry_tree( registry, nk, nk->keyname );#if 0	talloc_report_full( registry->mem_ctx, stderr );#endif		d_printf("Closing registry...");	regfio_close( registry );	d_printf("ok\n");	return 0;}/****************************************************************************************************************************************/static int rpc_registry_copy( int argc, const char **argv ){	REGF_FILE   *infile, *outfile;	REGF_NK_REC *nk;	int result = 1;		if (argc != 2 ) {		d_printf("Usage:    net rpc copy <srcfile> <newfile>\n");		return 0;	}		d_printf("Opening %s....", argv[0]);	if ( !(infile = regfio_open( argv[0], O_RDONLY, 0 )) ) {		d_fprintf(stderr, "Failed to open %s for reading\n", argv[0]);		return 1;	}	d_printf("ok\n");	d_printf("Opening %s....", argv[1]);	if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) {		d_fprintf(stderr, "Failed to open %s for writing\n", argv[1]);		goto out_close_infile;	}	d_printf("ok\n");		/* get the root of the registry file */		nk = regfio_rootkey( infile );	d_printf("RootKey: [%s]\n", nk->keyname);	write_registry_tree( infile, nk, NULL, outfile, "" );	result = 0;	d_printf("Closing %s...", argv[1]);	regfio_close( outfile );	d_printf("ok\n");out_close_infile:	d_printf("Closing %s...", argv[0]);	regfio_close( infile );	d_printf("ok\n");	return( result);}/****************************************************************************************************************************************/static int net_help_registry( int argc, const char **argv ){	d_printf("net rpc registry enumerate <path> [recurse]  Enumerate the subkeya and values for a given registry path\n");	d_printf("net rpc registry save <path> <file>          Backup a registry tree to a file on the server\n");	d_printf("net rpc registry dump <file>                 Dump the contents of a registry file to stdout\n");		return -1;}/****************************************************************************************************************************************/int net_rpc_registry(int argc, const char **argv) {	struct functable func[] = {		{"enumerate", rpc_registry_enumerate},		{"save",      rpc_registry_save},		{"dump",      rpc_registry_dump},		{"copy",      rpc_registry_copy},		{NULL, NULL}	};		if ( argc )		return net_run_function( argc, argv, func, net_help_registry );			return net_help_registry( argc, argv );}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久aaaa樱花 | 国产精品每日更新在线播放网址| 99热99精品| 国产麻豆成人精品| 久久av老司机精品网站导航| 亚洲成av人片| 亚洲成av人影院| 亚洲一级电影视频| 亚洲品质自拍视频| 日韩毛片精品高清免费| 国产精品人成在线观看免费| 久久综合久久综合久久| 欧美久久久久久久久中文字幕| 一本到不卡免费一区二区| 不卡的av网站| 99久久免费国产| 成人白浆超碰人人人人| 懂色中文一区二区在线播放| 国产精品1024久久| 精品一区二区三区欧美| 久久99国产精品麻豆| 日本vs亚洲vs韩国一区三区二区| 午夜免费久久看| 一区二区国产视频| 亚洲午夜一二三区视频| 亚洲午夜av在线| 日韩高清在线电影| 免费观看成人av| 天天色天天爱天天射综合| 五月天一区二区三区| 天堂久久久久va久久久久| 青青草97国产精品免费观看无弹窗版| 免费av网站大全久久| 亚洲黄色av一区| 亚洲国产cao| 美国毛片一区二区| 国产成人8x视频一区二区| 久久精品国产99| 国产精品一区二区你懂的| 成人午夜视频网站| 色天使色偷偷av一区二区 | 一本色道久久加勒比精品| 91在线porny国产在线看| 欧美无砖专区一中文字| 欧美精品v国产精品v日韩精品 | 精品电影一区二区三区| 欧美一卡二卡三卡| 久久综合av免费| 亚洲天堂av一区| 亚洲国产成人av网| 韩国三级在线一区| 91婷婷韩国欧美一区二区| 欧美乱妇23p| 国产女人18毛片水真多成人如厕| 亚洲欧美日韩国产综合在线| 午夜精品久久久| 国产福利一区二区三区视频| 波多野洁衣一区| 欧美视频完全免费看| 欧美tickling网站挠脚心| 亚洲欧美一区二区在线观看| 日本不卡一二三区黄网| 成人免费看视频| 欧美色成人综合| 久久先锋影音av鲁色资源网| 亚洲嫩草精品久久| 精品系列免费在线观看| www.66久久| 欧美三区免费完整视频在线观看| 久久先锋影音av鲁色资源网| 亚洲欧美日韩国产综合| 久久丁香综合五月国产三级网站| 成人sese在线| 日韩欧美的一区二区| 亚洲摸摸操操av| 激情偷乱视频一区二区三区| 色婷婷精品久久二区二区蜜臀av| 精品免费99久久| 伊人性伊人情综合网| 国产乱对白刺激视频不卡| 欧美日韩一区二区三区四区| 精品人伦一区二区色婷婷| 亚洲精选视频免费看| 成人高清伦理免费影院在线观看| 日韩欧美一级片| 三级影片在线观看欧美日韩一区二区| 成a人片亚洲日本久久| 久久蜜桃一区二区| 美国av一区二区| 91麻豆精品久久久久蜜臀| 亚洲高清三级视频| 欧美网站一区二区| 亚洲一区二区影院| 欧美在线你懂的| 伊人一区二区三区| 色播五月激情综合网| 亚洲欧美日韩在线| 色哟哟亚洲精品| 亚洲三级久久久| 91在线看国产| 亚洲激情图片小说视频| 色婷婷激情一区二区三区| 亚洲欧美色图小说| 91一区在线观看| 一卡二卡欧美日韩| 欧美午夜理伦三级在线观看| 亚洲成人在线网站| 3d动漫精品啪啪1区2区免费| 日韩精品成人一区二区三区| 欧美一区二区在线观看| 日韩av电影一区| 日韩视频永久免费| 韩国女主播成人在线| 国产喷白浆一区二区三区| 国产成人在线免费观看| 欧美国产亚洲另类动漫| 成人理论电影网| 亚洲四区在线观看| 在线亚洲免费视频| 日本sm残虐另类| 精品久久久久久综合日本欧美| 激情综合五月天| 国产欧美精品在线观看| 成人高清视频在线| 亚洲理论在线观看| 欧美一三区三区四区免费在线看| 久久99精品国产.久久久久久| 2020国产精品| 色婷婷综合激情| 日韩va欧美va亚洲va久久| 2020国产精品| 91社区在线播放| 日本伊人色综合网| 久久综合色鬼综合色| 99精品国产一区二区三区不卡| 亚洲综合精品久久| 欧美一级高清片在线观看| 国产剧情一区在线| 亚洲男帅同性gay1069| 欧美妇女性影城| 成人做爰69片免费看网站| 一区二区三区色| 日韩精品一区二区在线| 成人免费毛片a| 日韩中文字幕不卡| 国产偷国产偷精品高清尤物| 色欧美乱欧美15图片| 另类欧美日韩国产在线| 中文字幕在线一区| 555www色欧美视频| jizz一区二区| 麻豆91免费看| 亚洲欧洲中文日韩久久av乱码| 日韩精品最新网址| 色又黄又爽网站www久久| 老司机精品视频导航| 亚洲男人天堂一区| 久久亚洲欧美国产精品乐播| 色婷婷综合久久久中文一区二区| 激情偷乱视频一区二区三区| 亚洲一区二区三区在线| 久久精品夜夜夜夜久久| 7777精品伊人久久久大香线蕉的| 成人精品gif动图一区| 奇米色777欧美一区二区| 亚洲欧美区自拍先锋| 久久欧美一区二区| 欧美日韩高清一区二区不卡| 大陆成人av片| 精品一区二区三区久久久| 亚洲精品美腿丝袜| 国产人久久人人人人爽| 日韩一区二区三区免费看| 91免费版pro下载短视频| 国产精品一二三四区| 日本在线不卡视频| 有坂深雪av一区二区精品| 中文字幕精品—区二区四季| 精品美女一区二区三区| 欧美日韩在线播放| 97精品国产97久久久久久久久久久久| 国产乱人伦精品一区二区在线观看 | 欧美成人aa大片| 欧美日本乱大交xxxxx| 91麻豆蜜桃一区二区三区| 处破女av一区二区| 国产精品一二三在| 国内精品国产成人国产三级粉色| 亚洲一二三区在线观看| 国产亚洲精品久| 精品对白一区国产伦| 精品久久久久99| 日韩午夜电影av| 欧美一区二区三区白人| 欧美亚一区二区| 精品视频在线免费看| 在线视频欧美精品| 91丨porny丨户外露出| av在线不卡电影| 国产揄拍国内精品对白|