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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/VBox/Additions/linux/sharedfolders/vfsmod.c b/src/VBox/Additions/linux/sharedfolders/vfsmod.c
index 18324fe1..5c4d55c1 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>
/*********************************************************************************************************************************
@@ -473,8 +474,7 @@ static int vbsf_create_root_inode(struct super_block *sb, struct vbsf_super_info
path->u16Length = 1;
path->u16Size = 2;
- path->String.utf8[0] = '/';
- path->String.utf8[1] = 0;
+ RTStrCopy(path->String.utf8, path->u16Size, "/");
/*
* Stat the root directory (for inode info).
@@ -1408,7 +1408,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 +1469,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 +1528,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 +1621,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.
*/