1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Modify DfsEnum to handle 'msdfs proxy' shares. No NETDFS editing support for

the proxy target.
(This used to be commit 560bb8a115)
This commit is contained in:
Shirish Kalele 2002-12-28 00:18:23 +00:00
parent 7385ba79d4
commit df7b562de2

View File

@ -818,6 +818,7 @@ static BOOL form_junctions(int snum, struct junction_map* jn, int* jn_count)
char* service_name = lp_servicename(snum); char* service_name = lp_servicename(snum);
connection_struct conns; connection_struct conns;
connection_struct *conn = &conns; connection_struct *conn = &conns;
struct referral *ref = NULL;
pstrcpy(connect_path,lp_pathname(snum)); pstrcpy(connect_path,lp_pathname(snum));
@ -831,31 +832,34 @@ static BOOL form_junctions(int snum, struct junction_map* jn, int* jn_count)
if (!create_conn_struct(conn, snum, connect_path)) if (!create_conn_struct(conn, snum, connect_path))
return False; return False;
{ /* form a junction for the msdfs root - convention
/* form a junction for the msdfs root - convention DO NOT REMOVE THIS: NT clients will not work with us
DO NOT REMOVE THIS: NT clients will not work with us if this is not present
if this is not present */
*/ pstrcpy(jn[cnt].service_name, service_name);
struct referral *ref = NULL; jn[cnt].volume_name[0] = '\0';
pstring alt_path; jn[cnt].referral_count = 1;
pstrcpy(jn[cnt].service_name, service_name);
jn[cnt].volume_name[0] = '\0';
jn[cnt].referral_count = 1;
slprintf(alt_path,sizeof(alt_path)-1,"\\\\%s\\%s",
local_machine, service_name);
ref = jn[cnt].referral_list = (struct referral*) malloc(sizeof(struct referral));
if (jn[cnt].referral_list == NULL) {
DEBUG(0, ("Malloc failed!\n"));
return False;
}
safe_strcpy(ref->alternate_path, alt_path, sizeof(pstring)); ref = jn[cnt].referral_list
ref->proximity = 0; = (struct referral*) malloc(sizeof(struct referral));
ref->ttl = REFERRAL_TTL; if (jn[cnt].referral_list == NULL) {
cnt++; DEBUG(0, ("Malloc failed!\n"));
return False;
} }
ref->proximity = 0;
ref->ttl = REFERRAL_TTL;
if (*lp_msdfs_proxy(snum) != '\0') {
pstrcpy(ref->alternate_path, lp_msdfs_proxy(snum));
*jn_count = 1;
return True;
}
slprintf(ref->alternate_path, sizeof(pstring)-1,
"\\\\%s\\%s", local_machine, service_name);
cnt++;
/* Now enumerate all dfs links */
dirp = conn->vfs_ops.opendir(conn, connect_path); dirp = conn->vfs_ops.opendir(conn, connect_path);
if(!dirp) if(!dirp)
return False; return False;