Staging: rt2870: disable root hack for reading files
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jan 2009 23:23:19 +0000 (15:23 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:52:35 +0000 (13:52 -0800)
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 <gregkh@suse.de>
drivers/staging/rt2870/rt_profile.c

index 3e360c661589bcdf6b1143c0d5386814495007c6..c4474a6428ace5e762a73dedfa669addb7d37902 100644 (file)
@@ -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);
 
@@ -1590,8 +1592,10 @@ NDIS_STATUS      RTMPReadParametersHook(
        }
 
        set_fs(orgfs);
+#if 0
        current->fsuid = orgfsuid;
        current->fsgid = orgfsgid;
+#endif
 
        kfree(buffer);
        kfree(tmpbuf);