summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions/linux/sharedfolders/vfsmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Additions/linux/sharedfolders/vfsmod.c')
-rw-r--r--src/VBox/Additions/linux/sharedfolders/vfsmod.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/VBox/Additions/linux/sharedfolders/vfsmod.c b/src/VBox/Additions/linux/sharedfolders/vfsmod.c
index 18324fe1..0c5c77af 100644
--- a/src/VBox/Additions/linux/sharedfolders/vfsmod.c
+++ b/src/VBox/Additions/linux/sharedfolders/vfsmod.c
@@ -63,6 +63,7 @@
#elif RTLNX_VER_MIN(2,6,0)
# include <linux/parser.h>
#endif
+#include <VBox/VBoxLnxModInline.h>
/*********************************************************************************************************************************
@@ -1408,7 +1409,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param)
switch (opt) {
case Opt_iocharset:
case Opt_nls:
- strlcpy(info->nls_name, param->string, sizeof(info->nls_name));
+ RTStrCopy(info->nls_name, sizeof(info->nls_name), param->string);
break;
case Opt_uid:
info->uid = result.uint_32;
@@ -1469,7 +1470,7 @@ static int vbsf_parse_param(struct fs_context *fc, struct fs_parameter *param)
printk(KERN_WARNING "vboxsf: cache mode (%u) is out of range, using default instead.\n", result.uint_32);
break;
case Opt_tag:
- strlcpy(info->szTag, param->string, sizeof(info->szTag));
+ RTStrCopy(info->szTag, sizeof(info->szTag), param->string);
break;
default:
return invalf(fc, "Invalid mount option: '%s'", param->key);
@@ -1528,7 +1529,7 @@ static int vbsf_get_tree(struct fs_context *fc)
}
/* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */
- strlcpy(info->name, fc->source, sizeof(info->name));
+ RTStrCopy(info->name, sizeof(info->name), fc->source);
# if RTLNX_VER_MAX(5,3,0)
return vfs_get_super(fc, vfs_get_independent_super, vbsf_read_super_aux);
@@ -1621,6 +1622,10 @@ static int __init init(void)
int rc;
SFLOGFLOW(("vboxsf: init\n"));
+ /* Check if modue loading was disabled. */
+ if (!vbox_mod_should_load())
+ return -EINVAL;
+
/*
* Must be paranoid about the vbsf_mount_info_new size.
*/