summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_dfs_nt.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
commitec879eacc263043409b584797d1e8c39258ba125 (patch)
tree7a7775040b27f7fea0f7bd1c8f0ede91c9ce770d /source3/rpc_server/srv_dfs_nt.c
parentba51d1d888f98e196627486490e8569faeb641c2 (diff)
downloadsamba-ec879eacc263043409b584797d1e8c39258ba125.tar.gz
samba-ec879eacc263043409b584797d1e8c39258ba125.tar.bz2
samba-ec879eacc263043409b584797d1e8c39258ba125.zip
This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd argument incorrect, so I thought it best just to remove the argument. The incorrect usage was caused by callers using strlen() to determine the length of the string. The 3rd argument to init_unistr2() was supposed to be the character length, not the byte length of the string, so for non-english this could come out wrong. I also removed the bogus 'always allocate at least 256 bytes' hack. There may be some code that relies on this, but if there is then the code is broken and needs fixing. (This used to be commit b9eff31b1433c81fbff733e194914a40f25e3bda)
Diffstat (limited to 'source3/rpc_server/srv_dfs_nt.c')
-rw-r--r--source3/rpc_server/srv_dfs_nt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c
index da92e5c06b..38a26d1988 100644
--- a/source3/rpc_server/srv_dfs_nt.c
+++ b/source3/rpc_server/srv_dfs_nt.c
@@ -198,7 +198,7 @@ static BOOL init_reply_dfs_info_1(struct junction_map* j, DFS_INFO_1* dfs1, int
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
DEBUG(5,("init_reply_dfs_info_1: %d) initing entrypath: %s\n",i,str));
- init_unistr2(&dfs1[i].entrypath,str,strlen(str)+1);
+ init_unistr2(&dfs1[i].entrypath,str);
}
return True;
}
@@ -212,7 +212,7 @@ static BOOL init_reply_dfs_info_2(struct junction_map* j, DFS_INFO_2* dfs2, int
dfs2[i].ptr_entrypath = 1;
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
- init_unistr2(&dfs2[i].entrypath, str, strlen(str)+1);
+ init_unistr2(&dfs2[i].entrypath, str);
dfs2[i].ptr_comment = 0;
dfs2[i].state = 1; /* set up state of dfs junction as OK */
dfs2[i].num_storages = j[i].referral_count;
@@ -234,9 +234,9 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, DFS_I
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
- init_unistr2(&dfs3[i].entrypath, str, strlen(str)+1);
+ init_unistr2(&dfs3[i].entrypath, str);
dfs3[i].ptr_comment = 1;
- init_unistr2(&dfs3[i].comment, "", 1);
+ init_unistr2(&dfs3[i].comment, "");
dfs3[i].state = 1;
dfs3[i].num_storages = dfs3[i].num_storage_infos = j[i].referral_count;
dfs3[i].ptr_storages = 1;
@@ -267,8 +267,8 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, DFS_I
*p = '\0';
DEBUG(5,("storage %d: %s.%s\n",ii,path,p+1));
stor->state = 2; /* set all storages as ONLINE */
- init_unistr2(&stor->servername, path, strlen(path)+1);
- init_unistr2(&stor->sharename, p+1, strlen(p+1)+1);
+ init_unistr2(&stor->servername, path);
+ init_unistr2(&stor->sharename, p+1);
stor->ptr_servername = stor->ptr_sharename = 1;
}
}