tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Socket credentials (take 2)



On Mon, Apr 27, 2009 at 3:44 AM, YAMAMOTO Takashi
<yamt%mwd.biglobe.ne.jp@localhost> wrote:

>> or is there a different solution? or
>> am I missing the problem? :)
>
> i doubt if sodisconnect is the right place to free the credential.
> (i think i said this before.)
> is sodisconnect called for all sockets, even for non-connected ones?
> are you sure that so_cred will never be used after sodisconnect?

First let me apologize for not remembering this -- I did go over past
discussions and apparently missed it.

Anyway, you're 100% right. Doing it in sodisconnect() is pretty much
a bug. How about soput()? :)

(FWIW, FreeBSD puts it in sodealloc(), which looks like their
equivalent to our soput().)

> i guess that it's better to write something which actually use so_cred
> before commiting the patch.

I have uses for it both in tree (anything that uses uidinfo->ui_uid for
authorization, anything that uses so_egid) and planned (bluetooth
sockets receiving privileged requests).

Thanks,

-e.


Home | Main Index | Thread Index | Old Index