4.25 changed the formats, so bump the version. This gives us a way to autodetect
old formats easier in case cluster upgrades from older versions is implemented
in future.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
import "file_id.idl";
import "smb2_lease_struct.idl";
import "misc.idl";
-import "smbXsrv.idl";
[
pointer_default(unique)
smb2_lease_key lease_key;
uint32 access_mask;
uint32 share_access;
- timeval_legacy time;
+ timeval time;
udlong share_file_id;
uint32 uid;
share_entry_flags flags;
[ignore] file_id id; /* In memory key used to lookup cache. */
} share_mode_data;
+ typedef [public, v1_enum] enum {
+ SHARE_MODE_DATA_VERSION_1 = 0x00000001
+ } share_mode_data_version;
+
typedef union {
- [case(0)] share_mode_data *data0;
- [default] hyper *dummy;
+ [case(SHARE_MODE_DATA_VERSION_1),ref] share_mode_data *data1;
+ [default] ;
} share_mode_dataU;
typedef [public] struct {
- smbXsrv_version_values version;
+ share_mode_data_version version;
hyper unique_content_epoch;
share_mode_flags flags;
[switch_is(version)] share_mode_dataU data;
/* these are 0x30 (48) characters */
const string VFS_DEFAULT_DURABLE_COOKIE_MAGIC =
"VFS_DEFAULT_DURABLE_COOKIE_MAGIC ";
- const uint32 VFS_DEFAULT_DURABLE_COOKIE_VERSION = 0;
+ const uint32 VFS_DEFAULT_DURABLE_COOKIE_VERSION = 1;
/* this corresponds to struct stat_ex (SMB_STRUCT_STAT) */
typedef struct {
hyper st_ex_gid;
hyper st_ex_rdev;
hyper st_ex_size;
- timespec_legacy st_ex_atime;
- timespec_legacy st_ex_mtime;
- timespec_legacy st_ex_ctime;
- timespec_legacy st_ex_btime;
+ timespec st_ex_atime;
+ timespec st_ex_mtime;
+ timespec st_ex_ctime;
+ timespec st_ex_btime;
hyper st_ex_blksize;
hyper st_ex_blocks;
uint32 st_ex_flags;
#include "messages.h"
#include "util_tdb.h"
#include "source3/locking/share_mode_lock.h"
-#include "../librpc/gen_ndr/ndr_smbXsrv.h"
+#include "../librpc/gen_ndr/ndr_open_files.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LOCKING
store_flags |= DBWRAP_STORE_PERSISTENT;
}
- PUSH_BE_U32(version_buf, 0, smbXsrv_version_global_current());
+ PUSH_BE_U32(version_buf, 0, SHARE_MODE_DATA_VERSION_1);
status = dbwrap_record_storev(br_lck->record,
data,
return false;
}
version = PULL_BE_U32(data.dptr, 0);
- if (version != SMBXSRV_VERSION_0) {
+ if (version != SHARE_MODE_DATA_VERSION_1) {
DBG_WARNING("Invalid version: %"PRIu32"\n", version);
return false;
}
.data = discard_const_p(uint8_t, buf),
.data_size = buflen,
};
- enum smbXsrv_version_values v;
- NDR_CHECK(ndr_pull_smbXsrv_version_values(&ndr, NDR_SCALARS, &v));
- if (v != SMBXSRV_VERSION_0) {
+ enum share_mode_data_version v;
+ NDR_CHECK(ndr_pull_share_mode_data_version(&ndr, NDR_SCALARS, &v));
+ if (v != SHARE_MODE_DATA_VERSION_1) {
DBG_ERR("Invalid version\n");
return NDR_ERR_VALIDATE;
}
*/
struct share_mode_entry_buf {
- uint8_t buf[140];
+ uint8_t buf[128];
};
#define SHARE_MODE_ENTRY_SIZE (sizeof(struct share_mode_entry_buf))
goto fail;
}
- if (data_blob.version != SMBXSRV_VERSION_0) {
+ if (data_blob.version != SHARE_MODE_DATA_VERSION_1) {
DBG_ERR("Invalid record in locking.tdb:"
"key '%s' unsupported version: %d\n",
file_id_str_buf(id, &idbuf),
(int)data_blob.version);
goto fail;
}
- d = data_blob.data.data0;
+ d = data_blob.data.data1;
if (DEBUGLEVEL >= 10) {
DBG_DEBUG("parse_share_modes:\n");
return d;
fail:
- TALLOC_FREE(data_blob.data.data0);
+ TALLOC_FREE(data_blob.data.data1);
return NULL;
}
enum ndr_err_code ndr_err;
data_blob = (struct share_mode_dataB) {
- .version = smbXsrv_version_global_current(),
+ .version = SHARE_MODE_DATA_VERSION_1,
.unique_content_epoch = d->unique_content_epoch,
.flags = d->flags,
};
- data_blob.data.data0 = d;
+ data_blob.data.data1 = d;
ndr_err = ndr_push_struct_blob(
&blob,