svn commit: samba r2904 - in branches/SAMBA_4_0/source/ntvfs/posix: .

tridge at samba.org tridge at samba.org
Mon Oct 11 03:27:16 GMT 2004


Author: tridge
Date: 2004-10-11 03:27:16 +0000 (Mon, 11 Oct 2004)
New Revision: 2904

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ntvfs/posix&rev=2904&nolog=1

Log:
- fixed the old style SMBsearch to return the pvfs shortname, not a truncated long name.

- short name can be up to 12 bytes, not 11



Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c	2004-10-11 03:26:17 UTC (rev 2903)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c	2004-10-11 03:27:16 UTC (rev 2904)
@@ -36,6 +36,7 @@
 {
 	struct pvfs_filename *name;
 	NTSTATUS status;
+	const char *shortname;
 
 	status = pvfs_resolve_partial(pvfs, file, unix_path, fname, &name);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -50,13 +51,15 @@
 	case RAW_SEARCH_SEARCH:
 	case RAW_SEARCH_FFIRST:
 	case RAW_SEARCH_FUNIQUE:
+		shortname = pvfs_short_name(pvfs, name, name);
 		file->search.attrib           = name->dos.attrib;
 		file->search.write_time       = nt_time_to_unix(name->dos.write_time);
 		file->search.size             = name->st.st_size;
-		file->search.name             = fname;
+		file->search.name             = shortname;
 		file->search.id.reserved      = 8;
 		memset(file->search.id.name, ' ', sizeof(file->search.id.name));
-		memcpy(file->search.id.name, fname, MIN(strlen(fname)+1, sizeof(file->search.id.name)));
+		memcpy(file->search.id.name, shortname, 
+		       MIN(strlen(shortname)+1, sizeof(file->search.id.name)));
 		file->search.id.handle        = search->handle;
 		file->search.id.server_cookie = dir_index+1;
 		file->search.id.client_cookie = 0;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c	2004-10-11 03:26:17 UTC (rev 2903)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c	2004-10-11 03:27:16 UTC (rev 2904)
@@ -63,7 +63,7 @@
 	char c1, c2;
 	const char *ext;
 
-	if (strlen(name) < 12) {
+	if (strlen(name) <= 12) {
 		return talloc_strdup(pvfs, name);
 	}
 



More information about the samba-cvs mailing list