mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
This commit is contained in:
parent
d69e4c6a48
commit
99d07e1352
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user