Skip to contentSkip to conversation

converting drivers/net/wan/lmc/lmc_main.c from suser() to capable()

PATCH New Morten Helgesen 1 participant 1 message Dec 6, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 converting drivers/net/wan/lmc/lmc_main.c from suser() to capable()

Hey Linus, Marcelo and the rest of you.

The code mentioned in the subject does not seem to have a maintainer. I sent the patch to those mentioned in lmc_main.c, and from Andrew Stanley-Jones I got the following answer:

"I'm not sure it's really being maintained, but I was the last one to work
on it afaik. Feel free to apply it.
-Andrew"

So I guess, if the patch looks good, it is just for you to apply it ... it is against 2.5.1-pre5, but should apply cleanly to 2.4 as well ...

== Morten

Signature · 63 lines
mvh
Morten Helgesen 
UNIX System Administrator & C Developer 
Nextframe AS
[email protected] / 93445641
http://www.nextframe.net

--- /usr/src/linux-2.5.1-pre5/drivers/net/wan/lmc/lmc_main.c    Fri Sep 14 01:04:43 2001
+++ /usr/src/patched-linux-2.5.1-pre5/drivers/net/wan/lmc/lmc_main.c    Thu Dec  6 13:17:21 2001
@@ -176,7 +176,7 @@

     case LMCIOCSINFO: /*fold01*/
         sp = &((struct ppp_device *) dev)->sppp;
-        if (!suser ()) {
+        if (!capable(CAP_NET_ADMIN)) {
             ret = -EPERM;
             break;
         }
@@ -211,7 +211,7 @@
             u_int16_t  old_type = sc->if_type;
             u_int16_t  new_type;

-           if (!suser ()) {
+           if (!capable(CAP_NET_ADMIN)) {
                ret = -EPERM;
                break;
            }
@@ -291,7 +291,7 @@
         break;

     case LMCIOCCLEARLMCSTATS: /*fold01*/
-        if (!suser ()){
+        if (!capable(CAP_NET_ADMIN)){
             ret = -EPERM;
             break;
         }
@@ -305,7 +305,7 @@
         break;

     case LMCIOCSETCIRCUIT: /*fold01*/
-        if (!suser ()){
+        if (!capable(CAP_NET_ADMIN)){
             ret = -EPERM;
             break;
         }
@@ -323,7 +323,7 @@
         break;

     case LMCIOCRESET: /*fold01*/
-        if (!suser ()){
+        if (!capable(CAP_NET_ADMIN)){
             ret = -EPERM;
             break;
         }
@@ -356,7 +356,7 @@
         {
             struct lmc_xilinx_control xc; /*fold02*/

-            if (!suser ()){
+            if (!capable(CAP_NET_ADMIN)){
                 ret = -EPERM;
                 break;
             }