ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Paul Wolneykien <manowar@altlinux.org>
To: devel@lists.altlinux.org
Subject: Re: [devel] Как опознать клиента unix-сокета?
Date: Thu, 11 Oct 2018 16:26:30 +0300
Message-ID: <f257b70b-025c-491e-faf4-20717be7424c@altlinux.org> (raw)
In-Reply-To: <52498885-e697-1af2-6fbf-915d34924e8b@etersoft.ru>

11.10.2018 16:19, Pavel Vainerman пишет:
> 11.10.2018 16:16, Paul Wolneykien пишет:
>>
>>   Всем привет. Есть ли простой (относительно) способ опознать клиента,
>> который подключился к unix-сокету (sockaddr_un)? Интересует номер
>> процесса, ну и, в идеале, имя программы. Спасибо.
> 
> ss -px  ?
> 

  Спасибо. Чуть конкретизирую. Во-первых, желательно на C, вот в таком
куске:

new_sock = accept(commonSocket, (struct sockaddr *) &clnt_addr,
		  &clnt_len),

где мы получаем дескриптор (new_sock) и адрес (в котором, правда,
sun_path пустой).
Во-вторых, нужно не просто получить список всех клиентов данного сервера
(он и так известен), а определить к которому из них относится конкретное
соединение.


  reply	other threads:[~2018-10-11 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 13:16 Paul Wolneykien
2018-10-11 13:19 ` Pavel Vainerman
2018-10-11 13:26   ` Paul Wolneykien [this message]
2018-10-11 13:26 ` Aleksei Nikiforov
2018-10-11 17:34   ` Paul Wolneykien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f257b70b-025c-491e-faf4-20717be7424c@altlinux.org \
    --to=manowar@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git