RE: trusting relatives

"Tikka, Sami" <[email protected]>
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>
>-----Original Message-----
>From: John Ogness [mailto:[email protected]] 

>@sami.tikka: This should be exactly what you have been looking 
>for. I am quite happy with how it has turned out. This can be 
>very useful for applications that use other external processes 
>or helper-apps (and the helper-apps are not Dazuko-aware).

Woohoo! This looks very nice! Your current implementation matches, at least
conceptually, pretty closely the trusted pid patch I originally posted. You
have added some extra checks for the situation where another process has
taken the same pid. I am happy!

I'd like to clarify how the "relatives" check is done. It seems to me that
the while loop below would step up thru the process family hierarchy until it
finds a process that is its own parent. What kind of a process is that?

static inline struct task_struct* get_root_parent(struct task_struct *p)
{
        struct task_struct      *ts = p;

        while (1)
        {
                if (ts == NULL)
                        return NULL;

                if (ts->p_pptr == NULL)
                        return ts;

                if (ts == ts->p_pptr)
                        return ts;

                if (ts->p_pptr == ts->p_pptr->p_pptr)
                        return ts;

                ts = ts->p_pptr;
        }
}

-- 
Sami Tikka                tel. +358 9 2520 5115 
senior software engineer  fax. +358 9 2520 5014
                          mobile +358 40 7379388
F-Secure Corporation      http://www.f-secure.com
BE SURE
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.