svn commit: samba r24549 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

vlendec at samba.org vlendec at samba.org
Sun Aug 19 20:00:44 GMT 2007


Author: vlendec
Date: 2007-08-19 20:00:43 +0000 (Sun, 19 Aug 2007)
New Revision: 24549

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24549

Log:
Fix unix_convert to return the already converted part

This API will change anyway when moving away from pstrings.

It took so long to fix, because that rename bug I just fixed gave make
test failures that had nothing to do with this one.

I have samba4 tests for both bugs, will check them in when the build
farm has caught up

Modified:
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/filename.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/filename.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/filename.c	2007-08-19 19:57:55 UTC (rev 24548)
+++ branches/SAMBA_3_2/source/smbd/filename.c	2007-08-19 20:00:43 UTC (rev 24549)
@@ -173,7 +173,7 @@
 			result =determine_path_error(
 				&orig_path[2], allow_wcard_last_component);
 		}
-		goto fail;
+		return result;
 	}
 
 	/*
@@ -222,8 +222,8 @@
 
 	if ((dirpath == NULL) && (!(dirpath = SMB_STRDUP("")))) {
 		DEBUG(0, ("strdup failed\n"));
-		result = NT_STATUS_NO_MEMORY;
-		goto fail;
+		SAFE_FREE(name);
+		return NT_STATUS_NO_MEMORY;
 	}
 
 	/*
@@ -602,9 +602,15 @@
 	DEBUG(5,("conversion finished %s -> %s\n",orig_path, name));
 
  done:
-	result = NT_STATUS_OK;
 	pstrcpy(orig_path, name);
+	SAFE_FREE(name);
+	SAFE_FREE(dirpath);
+	return NT_STATUS_OK;
  fail:
+	DEBUG(10, ("dirpath = [%s] start = [%s]\n", dirpath, start));
+	pstrcpy(orig_path, dirpath);
+	pstrcat(orig_path, "/");
+	pstrcat(orig_path, start);
 	SAFE_FREE(name);
 	SAFE_FREE(dirpath);
 	return result;

Modified: branches/SAMBA_3_2_0/source/smbd/filename.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/filename.c	2007-08-19 19:57:55 UTC (rev 24548)
+++ branches/SAMBA_3_2_0/source/smbd/filename.c	2007-08-19 20:00:43 UTC (rev 24549)
@@ -173,7 +173,7 @@
 			result =determine_path_error(
 				&orig_path[2], allow_wcard_last_component);
 		}
-		goto fail;
+		return result;
 	}
 
 	/*
@@ -222,8 +222,8 @@
 
 	if ((dirpath == NULL) && (!(dirpath = SMB_STRDUP("")))) {
 		DEBUG(0, ("strdup failed\n"));
-		result = NT_STATUS_NO_MEMORY;
-		goto fail;
+		SAFE_FREE(name);
+		return NT_STATUS_NO_MEMORY;
 	}
 
 	/*
@@ -602,9 +602,15 @@
 	DEBUG(5,("conversion finished %s -> %s\n",orig_path, name));
 
  done:
-	result = NT_STATUS_OK;
 	pstrcpy(orig_path, name);
+	SAFE_FREE(name);
+	SAFE_FREE(dirpath);
+	return NT_STATUS_OK;
  fail:
+	DEBUG(10, ("dirpath = [%s] start = [%s]\n", dirpath, start));
+	pstrcpy(orig_path, dirpath);
+	pstrcat(orig_path, "/");
+	pstrcat(orig_path, start);
 	SAFE_FREE(name);
 	SAFE_FREE(dirpath);
 	return result;



More information about the samba-cvs mailing list