Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Nikolay S." <nowhere@hakkenden.ath.cx>
To: "p. awa" <pawa@tormail.net>
Cc: netfilter@vger.kernel.org
Subject: Re: tag process's future sockets for iptables rules?
Date: Sun, 23 Oct 2011 23:20:58 +0400	[thread overview]
Message-ID: <1319397658.9866.6.camel@hakkenden.homenet> (raw)
In-Reply-To: <1RI1gs-000H1O-OY@internal.tormail.net>

В Вск, 23/10/2011 в 17:18 +0000, p. awa пишет:
> > >| netfilter_add_tag("public-addresses-proxied-via-tor");
> > >| netfilter_add_tag("internal-addresses-directly");
> > >| netfilter_remove_tag("proxy-dns");
> > >| execlp("wget", ...);
> >
> > A socket option, SO_MARK, for use with setsockopt/getsockopt.
> 
> but setsockopt is per socket. i'm looking for something that is
> per process (and inherited by children - in the example, wget).
> this is to replace what i do at the moment, namely
> 
> | setgid(123);
> | execlp("wget", ...);
> 
> and
> 
> # iptables ... -m owner --gid-owner 123 ...

Well, you could do interposition of libc's socket() with LD_PRELOAD, and
call setsockopt SO_MARK in the wrapper.

> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2011-10-23 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22 16:34 tag process's future sockets for iptables rules? p. awa
2011-10-22 20:43 ` Jan Engelhardt
2011-10-22 23:28   ` pawa
2011-10-23 17:18   ` p. awa
2011-10-23 19:20     ` Nikolay S. [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-22 14:44 p. awa

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=1319397658.9866.6.camel@hakkenden.homenet \
    --to=nowhere@hakkenden.ath.cx \
    --cc=netfilter@vger.kernel.org \
    --cc=pawa@tormail.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox