Skip to content

Instantly share code, notes, and snippets.

@peo3
Created March 18, 2013 16:45
Show Gist options
  • Save peo3/5188677 to your computer and use it in GitHub Desktop.
Save peo3/5188677 to your computer and use it in GitHub Desktop.
A patch to compile vboxsf.ko for 3.8.x kernel with user namespace enabled.
--- vboxsf/utils.c.orig 2013-03-19 01:32:18.189109241 +0900
+++ vboxsf/utils.c 2013-03-19 01:38:19.403778661 +0900
@@ -144,8 +144,13 @@
#endif
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) && defined(CONFIG_UIDGID_CONVERTED)
+ inode->i_uid = make_kuid(&init_user_ns, sf_g->uid);
+ inode->i_gid = make_kgid(&init_user_ns, sf_g->gid);
+#else
inode->i_uid = sf_g->uid;
inode->i_gid = sf_g->gid;
+#endif
inode->i_size = info->cbObject;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && !defined(KERNEL_FC6)
inode->i_blksize = 4096;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment