make sure we can expand the critical versions structure without
authorAndrew Tridgell <tridge@samba.org>
Tue, 2 Dec 2003 09:16:53 +0000 (09:16 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 2 Dec 2003 09:16:53 +0000 (09:16 +0000)
causing crashes in old modules. Thanks to metze for pointing this out!
(This used to be commit 2ee5540629e7922cd76d87ed53b70bf37b83e100)

source4/include/ntvfs.h
source4/ntvfs/ntvfs_base.c

index b972a4ef9954a14851c7d3313e4c3eea9e369e62..af23f1060705601ee3509c55b451c6e7d10d2b8f 100644 (file)
@@ -82,6 +82,7 @@ struct ntvfs_ops {
 
 /* this structure is used by backends to determine the size of some critical types */
 struct ntvfs_critical_sizes {
+       int interface_version;
        int sizeof_ntvfs_ops;
        int sizeof_SMB_OFF_T;
        int sizeof_tcon_context;
index 11f39c5d593a25a384420ec85093b051a170042b..ad1b3ae671b479d32a86590123cd032c098aa3e1 100644 (file)
@@ -88,14 +88,17 @@ struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type)
   This can be used by backends to either detect compilation errors, or provide
   multiple implementations for different smbd compilation options in one module
 */
-int ntvfs_interface_version(struct ntvfs_critical_sizes *sizes)
+const struct ntvfs_critical_sizes *ntvfs_interface_version(void)
 {
-       sizes->sizeof_ntvfs_ops = sizeof(struct ntvfs_ops);
-       sizes->sizeof_SMB_OFF_T = sizeof(SMB_OFF_T);
-       sizes->sizeof_tcon_context = sizeof(struct tcon_context);
-       sizes->sizeof_request_context = sizeof(struct request_context);
-
-       return NTVFS_INTERFACE_VERSION;
+       static const struct ntvfs_critical_sizes critical_sizes = {
+               NTVFS_INTERFACE_VERSION,
+               sizeof(struct ntvfs_ops),
+               sizeof(SMB_OFF_T),
+               sizeof(struct tcon_context),
+               sizeof(struct request_context),
+       };
+
+       return &critical_sizes;
 }