Re: [PATCH] kernel/time: Make /proc/timer_list mode 0400

From: Eric Dumazet
Date: Thu Nov 18 2010 - 03:28:49 EST


Le jeudi 18 novembre 2010 Ã 09:12 +0100, Ingo Molnar a Ãcrit :

> We should do something like:
>
> if (!capable(CAP_SYS_ADMIN))
> print_ptr = NULL;
>
> sprintf(s, "%p", print_ptr);

A while ago, Thomas suggested following idea :

<quote>

Considering the amount of duplication you are about to do, you may
want to think about adding a new pointer format extension then. We
already have special '%p' modes for IPv6 addresse, MAC addresses and
various other pointer types. It wouldn't be hard to add one which
does not print (null).

</quote>

http://www.spinics.net/lists/netdev/msg146606.html

So the if (!capable(CAP_SYS_ADMIN)) could be centralized in %pX handling
(X being a new letter, not actually 'X')



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/