svn commit: samba r22492 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/smbd SAMBA_3_0_25/source/include SAMBA_3_0_25/source/smbd

jra at samba.org jra at samba.org
Mon Apr 23 21:07:06 GMT 2007


Author: jra
Date: 2007-04-23 21:07:05 +0000 (Mon, 23 Apr 2007)
New Revision: 22492

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

Log:
Add objectid code.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/ntioctl.h
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0_25/source/include/ntioctl.h
   branches/SAMBA_3_0_25/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/ntioctl.h
===================================================================
--- branches/SAMBA_3_0/source/include/ntioctl.h	2007-04-23 16:45:56 UTC (rev 22491)
+++ branches/SAMBA_3_0/source/include/ntioctl.h	2007-04-23 21:07:05 UTC (rev 22492)
@@ -47,7 +47,7 @@
 #define FSCTL_SET_REPARSE_POINT      0x000900A4
 #define FSCTL_GET_REPARSE_POINT      0x000900A8
 #define FSCTL_DELETE_REPARSE_POINT   0x000900AC
-#define FSCTL_0x000900C0	     0x000900C0
+#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0
 #define FSCTL_SET_SPARSE             0x000900C4
 #define FSCTL_SET_ZERO_DATA          0x000900C8
 #define FSCTL_SET_ENCRYPTION         0x000900D7

Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/nttrans.c	2007-04-23 16:45:56 UTC (rev 22491)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c	2007-04-23 21:07:05 UTC (rev 22492)
@@ -2285,24 +2285,38 @@
 				0);
 		return -1;
 	
-	case FSCTL_0x000900C0:
-		/* pretend this succeeded - don't know what this really is
-		   but works ok like this --metze
+	case FSCTL_CREATE_OR_GET_OBJECT_ID:
+	{
+		unsigned char objid[16];
+
+		/* This should return the object-id on this file.
+		 * I think I'll make this be the inode+dev. JRA.
 		 */
 
-		DEBUG(10,("FSCTL_0x000900C0: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL,
-				0);
+		DEBUG(10,("FSCTL_CREATE_OR_GET_OBJECT_ID: called on FID[0x%04X]\n",fidnum));
+
+		data_count = 64;
+		pdata = nttrans_realloc(ppdata, data_count);
+		if (pdata == NULL) {
+			return ERROR_NT(NT_STATUS_NO_MEMORY);
+		}
+		SINO_T_VAL(pdata,0,fsp->inode);
+		SDEV_T_VAL(pdata,8,fsp->dev);
+		memcpy(pdata+16,create_volume_objectid(conn,objid),16);
+		SINO_T_VAL(pdata,32,fsp->inode);
+		SDEV_T_VAL(pdata,40,fsp->dev);
+		send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, pdata, data_count);
 		return -1;
+	}
 
+
 	case FSCTL_GET_REPARSE_POINT:
 		/* pretend this fail - my winXP does it like this
 		 * --metze
 		 */
 
 		DEBUG(10,("FSCTL_GET_REPARSE_POINT: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_NOT_A_REPARSE_POINT,
-				NULL, 0, NULL, 0);
+		return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
 		return -1;
 
 	case FSCTL_SET_REPARSE_POINT:
@@ -2311,8 +2325,7 @@
 		 */
 
 		DEBUG(10,("FSCTL_SET_REPARSE_POINT: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_NOT_A_REPARSE_POINT,
-				NULL, 0, NULL, 0);
+		return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
 		return -1;
 			
 	case FSCTL_GET_SHADOW_COPY_DATA: /* don't know if this name is right...*/

Modified: branches/SAMBA_3_0_25/source/include/ntioctl.h
===================================================================
--- branches/SAMBA_3_0_25/source/include/ntioctl.h	2007-04-23 16:45:56 UTC (rev 22491)
+++ branches/SAMBA_3_0_25/source/include/ntioctl.h	2007-04-23 21:07:05 UTC (rev 22492)
@@ -47,7 +47,7 @@
 #define FSCTL_SET_REPARSE_POINT      0x000900A4
 #define FSCTL_GET_REPARSE_POINT      0x000900A8
 #define FSCTL_DELETE_REPARSE_POINT   0x000900AC
-#define FSCTL_0x000900C0	     0x000900C0
+#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0
 #define FSCTL_SET_SPARSE             0x000900C4
 #define FSCTL_SET_ZERO_DATA          0x000900C8
 #define FSCTL_SET_ENCRYPTION         0x000900D7

Modified: branches/SAMBA_3_0_25/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/nttrans.c	2007-04-23 16:45:56 UTC (rev 22491)
+++ branches/SAMBA_3_0_25/source/smbd/nttrans.c	2007-04-23 21:07:05 UTC (rev 22492)
@@ -2279,15 +2279,29 @@
 				0);
 		return -1;
 	
-	case FSCTL_0x000900C0:
-		/* pretend this succeeded - don't know what this really is
-		   but works ok like this --metze
+	case FSCTL_CREATE_OR_GET_OBJECT_ID:
+	{
+		unsigned char objid[16];
+
+		/* This should return the object-id on this file.
+ 		 * I think I'll make this be the inode+dev. JRA.
 		 */
 
-		DEBUG(10,("FSCTL_0x000900C0: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL,
-				0);
+		DEBUG(10,("FSCTL_CREATE_OR_GET_OBJECT_ID: called on FID[0x%04X]\n",fidnum));
+
+		data_count = 64;
+		pdata = nttrans_realloc(ppdata, data_count);
+		if (pdata == NULL) {
+			return ERROR_NT(NT_STATUS_NO_MEMORY);
+		}		
+		SINO_T_VAL(pdata,0,fsp->inode);
+		SDEV_T_VAL(pdata,8,fsp->dev);
+		memcpy(pdata+16,create_volume_objectid(conn,objid),16);
+		SINO_T_VAL(pdata,32,fsp->inode);
+		SDEV_T_VAL(pdata,40,fsp->dev);
+		send_nt_replies(outbuf, bufsize, NT_STATUS_OK, NULL, 0, pdata, data_count);
 		return -1;
+	}
 
 	case FSCTL_GET_REPARSE_POINT:
 		/* pretend this fail - my winXP does it like this
@@ -2295,9 +2309,7 @@
 		 */
 
 		DEBUG(10,("FSCTL_GET_REPARSE_POINT: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(outbuf, bufsize, NT_STATUS_NOT_A_REPARSE_POINT,
-				NULL, 0, NULL, 0);
-		return -1;
+		return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
 
 	case FSCTL_SET_REPARSE_POINT:
 		/* pretend this fail - I'm assuming this because of the FSCTL_GET_REPARSE_POINT case.
@@ -2305,9 +2317,7 @@
 		 */
 
 		DEBUG(10,("FSCTL_SET_REPARSE_POINT: called on FID[0x%04X](but not implemented)\n",fidnum));
-		send_nt_replies(outbuf, bufsize, NT_STATUS_NOT_A_REPARSE_POINT,
-				NULL, 0, NULL, 0);
-		return -1;
+		return ERROR_NT(NT_STATUS_NOT_A_REPARSE_POINT);
 			
 	case FSCTL_GET_SHADOW_COPY_DATA: /* don't know if this name is right...*/
 	{



More information about the samba-cvs mailing list