Re: fchown() on a socket

From: Michal Vitecek (M.Vitecek@sh.cvut.cz)
Date: Tue May 02 2000 - 05:52:03 EST


Richard Zidlicky <Richard.Zidlicky@stud.informatik.uni-erlangen.de> wrote:
>did it ever work? I would be surprised as I know for sure that fchmod() on
>sockets never worked.

   i don't know whether it ever worked, but i guess it should since the
 socket has a pointer to struct file with uid/gid information.
   i'm using the ipacct patch to know how many bytes users on my box are
 sending and receiving to and fro. however, it uses the information in
 SOCK_INODE(skb->sk->socket)->i_uid to determine which user owns the
 socket and accounts the bytes to them. the problem is that daemons like
 sshd and telnet etc. open a new socket as root and the bytes are wrongly
 accounted to root. fchown()ing the socket after the authentication is the
 solution to this problem. however the kernel doesnt want to cooperate and
 OOPSes :)

-- 
			fuf

------------------------------ na IRC ------------------------------------- BillGates [bgates@www.microsoft.com] has joined #LINUX ... mode/#linux [+b BillGates!*@*] by DoDad BillGates was kicked off #linux by DoDad (banned: We see enough of Bill Gates already.)

- 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/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:10 EST