summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-02-15 23:45:28 -0800
committerTim Prouty <tprouty@samba.org>2009-02-19 20:58:26 -0800
commite4675ce8db436ac572fcc476b9bfb1116e997f9f (patch)
tree7381a8a3aa92536fbfa58a75dee450f1f26d66ce /source3/smbd
parent6fbebb5369211b72545a1dd588bc6b9fa04210a1 (diff)
downloadsamba-e4675ce8db436ac572fcc476b9bfb1116e997f9f.tar.gz
samba-e4675ce8db436ac572fcc476b9bfb1116e997f9f.tar.bz2
samba-e4675ce8db436ac572fcc476b9bfb1116e997f9f.zip
s3: Add extid to the dev/inode pair
This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/globals.c3
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/open.c4
-rw-r--r--source3/smbd/oplock.c28
4 files changed, 20 insertions, 17 deletions
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index 3f8cb411e5..9e7d103562 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -66,7 +66,8 @@ struct fsp_singleton_cache fsp_fi_cache = {
.fsp = NULL,
.id = {
.devid = 0,
- .inode = 0
+ .inode = 0,
+ .extid = 0
}
};
unsigned long file_gen_counter = 0;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index ad2366efae..86a46505a2 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1856,6 +1856,8 @@ static void call_nt_transact_ioctl(connection_struct *conn,
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
+
+ /* For backwards compatibility only store the dev/inode. */
push_file_id_16(pdata, &fsp->file_id);
memcpy(pdata+16,create_volume_objectid(conn,objid),16);
push_file_id_16(pdata+32, &fsp->file_id);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 9971ffa679..239d4ff0c4 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2597,8 +2597,8 @@ void msg_file_was_renamed(struct messaging_context *msg,
}
/* Unpack the message. */
- pull_file_id_16(frm, &id);
- sharepath = &frm[16];
+ pull_file_id_24(frm, &id);
+ sharepath = &frm[24];
newname = sharepath + strlen(sharepath) + 1;
sp_len = strlen(sharepath);
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index b39e5bf634..22870283fa 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -40,8 +40,8 @@ void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp)
uint8_t msg[MSG_SMB_KERNEL_BREAK_SIZE];
/* Put the kernel break info into the message. */
- push_file_id_16((char *)msg, &fsp->file_id);
- SIVAL(msg,16,fsp->fh->gen_id);
+ push_file_id_24((char *)msg, &fsp->file_id);
+ SIVAL(msg,24,fsp->fh->gen_id);
/* Don't need to be root here as we're only ever
sending to ourselves. */
@@ -583,8 +583,8 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
}
/* Pull the data from the message. */
- pull_file_id_16((char *)data->data, &id);
- file_id = (unsigned long)IVAL(data->data, 16);
+ pull_file_id_24((char *)data->data, &id);
+ file_id = (unsigned long)IVAL(data->data, 24);
DEBUG(10, ("Got kernel oplock break message from pid %d: %s/%u\n",
(int)procid_to_pid(&src), file_id_string_tos(&id),
@@ -865,12 +865,12 @@ void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e)
SIVAL(msg,16,e->private_options);
SIVAL(msg,20,(uint32)e->time.tv_sec);
SIVAL(msg,24,(uint32)e->time.tv_usec);
- push_file_id_16(msg+28, &e->id);
- SIVAL(msg,44,e->share_file_id);
- SIVAL(msg,48,e->uid);
- SSVAL(msg,52,e->flags);
+ push_file_id_24(msg+28, &e->id);
+ SIVAL(msg,52,e->share_file_id);
+ SIVAL(msg,56,e->uid);
+ SSVAL(msg,60,e->flags);
#ifdef CLUSTER_SUPPORT
- SIVAL(msg,54,e->pid.vnn);
+ SIVAL(msg,62,e->pid.vnn);
#endif
}
@@ -888,12 +888,12 @@ void message_to_share_mode_entry(struct share_mode_entry *e, char *msg)
e->private_options = IVAL(msg,16);
e->time.tv_sec = (time_t)IVAL(msg,20);
e->time.tv_usec = (int)IVAL(msg,24);
- pull_file_id_16(msg+28, &e->id);
- e->share_file_id = (unsigned long)IVAL(msg,44);
- e->uid = (uint32)IVAL(msg,48);
- e->flags = (uint16)SVAL(msg,52);
+ pull_file_id_24(msg+28, &e->id);
+ e->share_file_id = (unsigned long)IVAL(msg,52);
+ e->uid = (uint32)IVAL(msg,56);
+ e->flags = (uint16)SVAL(msg,60);
#ifdef CLUSTER_SUPPORT
- e->pid.vnn = IVAL(msg,54);
+ e->pid.vnn = IVAL(msg,62);
#endif
}