lkml.org 
[lkml]   [1999]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: current->uid

> couldn't be better to use a something like this???
>
> if (current->uid == 0) {
> return 0;
> } else {
> return root_uid;
> }
>
>
> also that way, maybe, INIT will not start to complain if uid 0 is not
> the power/super user...
>
> the BIG BIG problem about this, is that script kiddies will still able
> to run exploits and so on....

Well, the exact point of using a macro would be to replace code like:

if(!current->uid){
do_root_stuff();
}

with somethig like:

if(IS_ROOT_PROCESS(current)){
do_root_stuff();
}

That way if someone does't like the idea, the macro could be defined
diffrent ways:

#ifdef DYNAMIC_ROOT_ID
#define IS_ROOT_PROCESS(P) p->uid == special_id
#else
#define IS_ROOT_PROCESS(p) !p->uid
#endif



Papi



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

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.475 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site