summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-23 21:07:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:39 -0500
commit4742fa9366020accb033e622881c8cb29a6e427f (patch)
treef0d929dbca75961c2990e315b9b80e474b10ae9b
parent7d859f04f2c9b51c34b5445743f04ae743489ba3 (diff)
downloadsamba-4742fa9366020accb033e622881c8cb29a6e427f.tar.gz
samba-4742fa9366020accb033e622881c8cb29a6e427f.tar.bz2
samba-4742fa9366020accb033e622881c8cb29a6e427f.zip
r22492: Add objectid code.
Jeremy. (This used to be commit d3df922038032b65f52e1e0ac1f2dd53a6933fb7)
-rw-r--r--source3/include/ntioctl.h2
-rw-r--r--source3/smbd/nttrans.c33
2 files changed, 24 insertions, 11 deletions
diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h
index 1dbde54277..b4b8169a51 100644
--- a/source3/include/ntioctl.h
+++ b/source3/include/ntioctl.h
@@ -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
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index fa9828ae03..1a4b43ce51 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -2285,15 +2285,30 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
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
@@ -2301,8 +2316,7 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
*/
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 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
*/
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...*/