From: Greg Kroah-Hartman Date: Mon, 5 Jan 2009 22:18:40 +0000 (-0800) Subject: Staging: rt2860: disable root hack for reading files X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=18727963278a7199c75dba5ca3ad1e3455b1554a;p=linux-beck.git Staging: rt2860: disable root hack for reading files We are now using credentials, so just blindly setting the fsuid and fsguid isn't acceptable. All this means is that the config file needs to be readable by the driver thread, not a big deal. Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rt2860/rt_profile.c b/drivers/staging/rt2860/rt_profile.c index a38e557a9ece..cd7ffc8a6e8a 100644 --- a/drivers/staging/rt2860/rt_profile.c +++ b/drivers/staging/rt2860/rt_profile.c @@ -925,9 +925,11 @@ NDIS_STATUS RTMPReadParametersHook( // Save uid and gid used for filesystem access. // Set user and group to 0 (root) - orgfsuid = current->fsuid; - orgfsgid = current->fsgid; - current->fsuid=current->fsgid = 0; + orgfsuid = current_fsuid(); + orgfsgid = current_fsgid(); + /* Hm, can't really do this nicely anymore, so rely on these files + * being set to the proper permission to read them... */ + /* current->cred->fsuid = current->cred->fsgid = 0; */ orgfs = get_fs(); set_fs(KERNEL_DS); @@ -1551,8 +1553,11 @@ NDIS_STATUS RTMPReadParametersHook( } set_fs(orgfs); - current->fsuid = orgfsuid; - current->fsgid = orgfsgid; + +#if 0 + current->cred->fsuid = orgfsuid; + current->cred->fsgid = orgfsgid; +#endif kfree(buffer); kfree(tmpbuf);