All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maximilian Wilhelm <max@rfc2324.org>
To: netfilter@lists.netfilter.org
Subject: Re: ipset: how to run non-root
Date: Sun, 19 Nov 2006 01:15:41 +0100	[thread overview]
Message-ID: <20061119001541.GA13056@outback.rfc2324.org> (raw)
In-Reply-To: <455F8DE9.8060105@mailinator.com>

Am Samstag, den 18 November hub Mike Wright folgendes in die Tasten:

Hi!

> I'm trying to use ipset from a php script on an apache server.

> ipset requires root user in order to execute, but the webserver is 
> running as apache.  suexec is not a possibility because it won't execute 
> programs with root permissions.  It is possible to have a cron job 
> perform the task but that introduces a time delay.

> I've tried changing ownership of ipset to apache:apache but that didn't 
> work.  Still received the "must be root" warning.

> I looked into the source of ipset.c but it seems like the socket() call 
> must be done as root, and I don't know how to hack around that.

> Does anybody know how I might accomplish this?

I never used ipset, but you could use a generic trick:
 Set the owner of the ipset binary back to root and set the suid bit
 which will result in the ability for everyone who can execute the
 binary to do this "as root".

You might want to think about an execution restriction (e.g. via the group)
to prevent people who should no fiddle with ipset from doing so.

I hope you have some access control via your web application...

Ciao
Max
-- 
	Follow the white penguin.


  reply	other threads:[~2006-11-19  0:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-18 22:49 ipset: how to run non-root Mike Wright
2006-11-19  0:15 ` Maximilian Wilhelm [this message]
2006-11-19  1:23   ` Mike Wright
2006-11-19  7:01     ` PINTU
2006-11-20 19:52   ` R. DuFresne

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=20061119001541.GA13056@outback.rfc2324.org \
    --to=max@rfc2324.org \
    --cc=netfilter@lists.netfilter.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.