Re: Getting PID of a unix domain socket client
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=doK5wVnEgeaWqxjyuqGwFF8mbepob0hOX3hY/pEwTTs=; b=GwAOfZatD2ZEaDgKDFunP1NTbw7X0S+yEmhVgGWUrbA9Tga8K5G71CtCyghlisg6LhdnmH3Lii/AYoSdSAR4Z+EpuXOH7f5IxbXBGCyrNF1Qc57azMq2Umli3ZiuZLzpml1HJDZiSqK4BoDvHu0Ku7wf8mjdDibhMmFqvQ8nBj8= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XxnTSrRSeUy7falQu++8qPo9lmnmrZaXqQbLCg4z9YrToT7znh8aq4qH005zuaRvgYSLyL6lGwh89bDhnzgtBhSCsBklpKfHE4THylpOjJmMrvqLO3OWriw13DnghJvPwKUNm6Ttz6Xdv7R8OJJg83E+50cgohLpEhFhCdZECAs= Hi, i ve suggested to Murali to use getpeereid : euid, egid the effective UID and GID can be used to verify the privileges but maybe incomplete, especially for the fs checks. -mmw On Nov 28, 2007 8:36 AM, Terry Lambert <tlambert@apple.com> wrote:
On Nov 27, 2007, at 9:38 PM, Murali J <jmuralinux@gmail.com> wrote:
Hi all, I am writing a simple client server program using Unix domain sockets. Client sends some 10 bytes to the server and the server responses with another 10 bytes.
Is there any way I can get the PID of the client which sends the request to the server?!?
In linux, I am able to do this by using getsockopt(). But in MAC OS X, I am able to get only GID and UID of the client. I am running Darwin Kernal 8.6.0.
Were you intending to use the PID as a simple client identifier, or were you intending to make security inferences based on it?
If as an identifier, you could just send the information in-band as the first thing in the data stream.
If you were intending to make security decisions, that's probaly not useful, since you can't trust the other end to be who they say they are, based on the PID: it's not a security identifier.
-- Terry
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/openspecies%40gmail.com
This email sent to openspecies@gmail.com
-- echo zapydapntpd.rxltw@nzx | tr a-z@. p-za-o.@ _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
mm w