From 99d07e13520b04d99999938d259d56fa65c8a8ea Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Fri, 28 Apr 2000 18:36:47 +0000 Subject: [PATCH] Added info level 1005 to netsharegetinfo (is the share a DFS root) Added dfs_server announcement in set_default_server_announce_type() --- source/include/rpc_srvsvc.h | 8 +++++++- source/include/smb.h | 1 + source/param/loadparm.c | 1 + source/rpc_parse/parse_srv.c | 27 ++++++++++++++++++++++++++- source/rpc_server/srv_srvsvc.c | 17 +++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) diff --git a/source/include/rpc_srvsvc.h b/source/include/rpc_srvsvc.h index 78949a7a7d9..96961cbd2fc 100644 --- a/source/include/rpc_srvsvc.h +++ b/source/include/rpc_srvsvc.h @@ -305,6 +305,12 @@ typedef struct share_info_2_info } SRV_SHARE_INFO_2; +/* SRV_SHARE_INFO_1005 */ +typedef struct share_info_1005_info +{ + uint32 dfs_root_flag; +} SRV_SHARE_INFO_1005; + /* SRV_SHARE_INFO_CTR */ typedef struct srv_share_info_ctr_info { @@ -373,7 +379,7 @@ typedef struct r_net_share_get_info_info union { SRV_SHARE_INFO_1 info1; SRV_SHARE_INFO_2 info2; - + SRV_SHARE_INFO_1005 info1005; } share; uint32 status; diff --git a/source/include/smb.h b/source/include/smb.h index 78d17aaa3d4..ee14466cf7f 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1412,6 +1412,7 @@ char *strdup(char *s); #define SV_TYPE_SERVER_OSF 0x00100000 #define SV_TYPE_SERVER_VMS 0x00200000 #define SV_TYPE_WIN95_PLUS 0x00400000 +#define SV_TYPE_DFS_SERVER 0x00800000 #define SV_TYPE_ALTERNATE_XPORT 0x20000000 #define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 #define SV_TYPE_DOMAIN_ENUM 0x80000000 diff --git a/source/param/loadparm.c b/source/param/loadparm.c index cc5a51c6c66..ff19f34a0e9 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -2946,6 +2946,7 @@ static void set_default_server_announce_type(void) else if(lp_announce_as() == ANNOUNCE_AS_WFW) default_server_announce |= SV_TYPE_WFW; default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); + default_server_announce |= (lp_host_msdfs() ? SV_TYPE_DFS_SERVER : 0); } diff --git a/source/rpc_parse/parse_srv.c b/source/rpc_parse/parse_srv.c index 8997b05e0b7..6eeae80cfc2 100644 --- a/source/rpc_parse/parse_srv.c +++ b/source/rpc_parse/parse_srv.c @@ -201,6 +201,27 @@ static BOOL srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int d return True; } +/******************************************************************* + Reads or writes a structure. +********************************************************************/ +static BOOL srv_io_share_info1005(char* desc, SRV_SHARE_INFO_1005* sh1005, + prs_struct* ps, int depth) +{ + if(sh1005 == NULL) + return False; + + prs_debug(ps, depth, desc, "srv_io_share_info1005"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_uint32("dfs_root_flag", ps, depth, &sh1005->dfs_root_flag)) + return False; + + return True; +} + /******************************************************************* Reads or writes a structure. ********************************************************************/ @@ -527,8 +548,12 @@ BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_ return False; break; + case 1005: + if(!srv_io_share_info1005("", &r_n->share.info1005, + ps, depth)) + return False; default: - DEBUG(5,("%s no share info at switch_value %d\n", + DEBUG(5,("%s no share info at switch_value %d\n", tab_depth(depth), r_n->switch_value)); break; } diff --git a/source/rpc_server/srv_srvsvc.c b/source/rpc_server/srv_srvsvc.c index 51ba7e8a8f7..bb2083e28af 100644 --- a/source/rpc_server/srv_srvsvc.c +++ b/source/rpc_server/srv_srvsvc.c @@ -90,6 +90,20 @@ static void init_srv_share_info_2(SRV_SHARE_INFO_2 *sh2, int snum) init_srv_share_info2_str(&sh2->info_2_str, net_name, remark, path, passwd); } +/*************************************************************************** + Fill in a share info level 1005 structure. + ***************************************************************************/ +static void init_srv_share_info_1005(SRV_SHARE_INFO_1005* sh1005, int snum) +{ + sh1005->dfs_root_flag = 0; + +#ifdef MS_DFS + if(lp_host_msdfs() && *lp_dfsmap(snum) && lp_dfsmap_loaded(snum)) + sh1005->dfs_root_flag = 3; +#endif + +} + /******************************************************************* Fill in a share info structure. ********************************************************************/ @@ -235,6 +249,9 @@ static void init_srv_r_net_share_get_info(SRV_R_NET_SHARE_GET_INFO *r_n, case 2: init_srv_share_info_2(&r_n->share.info2, snum); break; + case 1005: + init_srv_share_info_1005(&r_n->share.info1005, snum); + break; default: DEBUG(5,("init_srv_net_share_get_info: unsupported switch value %d\n", info_level)); status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS;