summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/msdfs/msdfs.c19
-rw-r--r--source3/smbd/trans2.c7
2 files changed, 10 insertions, 16 deletions
diff --git a/source3/msdfs/msdfs.c b/source3/msdfs/msdfs.c
index cd83756056..081ce809cf 100644
--- a/source3/msdfs/msdfs.c
+++ b/source3/msdfs/msdfs.c
@@ -45,7 +45,7 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp)
/* now tokenize */
/* parse out hostname */
- p = strchr(temp,'\\');
+ p = strchr_m(temp,'\\');
if(p == NULL)
return False;
*p = '\0';
@@ -54,7 +54,7 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp)
/* parse out servicename */
temp = p+1;
- p = strchr(temp,'\\');
+ p = strchr_m(temp,'\\');
if(p == NULL) {
pstrcpy(pdp->servicename,temp);
pdp->reqpath[0] = '\0';
@@ -67,9 +67,8 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp)
/* rest is reqpath */
pstrcpy(pdp->reqpath, p+1);
p = pdp->reqpath;
- while (*p) {
- if (*p == '\\') *p = '/';
- p++;
+ while ((p = strchr_m(p, '\\'))!=NULL) {
+ *p++ = '/';
}
DEBUG(10,("rest of the path: %s\n",pdp->reqpath));
@@ -148,7 +147,7 @@ static BOOL parse_symlink(char* buf,struct referral** preflist,
for(i=0;i<count;i++) {
/* replace / in the alternate path by a \ */
- char* p = strchr(alt_path[i],'/');
+ char* p = strchr_m(alt_path[i],'/');
if(p)
*p = '\\';
@@ -270,7 +269,7 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
/* redirect if any component in the path is a link */
pstrcpy(reqpath, dp->reqpath);
- p = strrchr(reqpath, '/');
+ p = strrchr_m(reqpath, '/');
while (p) {
*p = '\0';
pstrcpy(localpath, reqpath);
@@ -288,7 +287,7 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
pstrcpy(buf, dfspath);
trim_char(buf, '\0', '\\');
for (; consumed_level; consumed_level--) {
- q = strrchr(buf, '\\');
+ q = strrchr_m(buf, '\\');
if (q)
*q = 0;
}
@@ -298,7 +297,7 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
return True;
}
- p = strrchr(reqpath, '/');
+ p = strrchr_m(reqpath, '/');
consumed_level++;
}
@@ -526,7 +525,7 @@ static int setup_ver2_dfs_referral(char* pathname, char** ppdata,
offset = 8;
/* add the referral elements */
for(i=0;i<junction->referral_count;i++) {
- struct referral* ref = &(junction->referral_list[i]);
+ struct referral* ref = &junction->referral_list[i];
int unilen;
SSVAL(pdata,offset,2); /* version 2 */
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 38fed4beae..19269cbc6c 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3390,7 +3390,6 @@ static int call_trans2getdfsreferral(connection_struct *conn, char* inbuf,
pstring pathname;
int reply_size = 0;
int max_referral_level;
- NTSTATUS status = NT_STATUS_OK;
DEBUG(10,("call_trans2getdfsreferral\n"));
@@ -3402,11 +3401,7 @@ static int call_trans2getdfsreferral(connection_struct *conn, char* inbuf,
if(!lp_host_msdfs())
return ERROR_DOS(ERRDOS,ERRbadfunc);
- srvstr_get_path(inbuf, pathname, &params[2], sizeof(pathname), -1, STR_TERMINATE, &status);
- if (!NT_STATUS_IS_OK(status)) {
- return ERROR_NT(status);
- }
-
+ srvstr_pull(inbuf, pathname, &params[2], sizeof(pathname), -1, STR_TERMINATE);
if((reply_size = setup_dfs_referral(conn, pathname,max_referral_level,ppdata)) < 0)
return UNIXERROR(ERRDOS,ERRbadfile);