netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Introductions, some tweaks to ulogd
@ 2013-05-11 17:01 Chris Boot
  2013-05-11 17:01 ` [PATCH 1/2] ulogd: Perform nice() before giving up root Chris Boot
  2013-05-11 17:01 ` [PATCH 2/2] ulogd: Implement PID file writing Chris Boot
  0 siblings, 2 replies; 24+ messages in thread
From: Chris Boot @ 2013-05-11 17:01 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Chris Boot, Eric Leblond

Hi folks,

I am working on packaging ulogd-2.x for Debian, and currently have an initial
set of packages uploaded and waiting for ftpmaster review in the NEW queue.
I'd like to say hello to all folks involved with ulogd, and thanks for all the
hard work getting it to where it is. Hopefully we can work together and make
ulogd-2.x a first class citizen in Debian.

I intend to be a fully cooperative downstream maintainer, and to prove my
intentions here are a couple of patches that I've been working on for the next
upload of ulogd2.

The first patch simply fixes the deamon being able to nice() itself when run
with the --uid argument. Currently the code runs nice() after setuid(); this
fails to increase its priority as it is no longer root. The patch simply moves
the code around a little to fix this.

The second patch adds a --pidfile option to ulogd, which enables it to write a
PID file to somewhere like /var/run (or just /run). This is very useful within
init scripts to make sure you're sending signals to the correct process.

Cheers,
Chris

Chris Boot (2):
  ulogd: Perform nice() before giving up root
  ulogd: Implement PID file writing

 src/ulogd.c |   89 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 81 insertions(+), 8 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ulogd: Perform nice() before giving up root
@ 2013-05-17 12:01 Eric Leblond
  0 siblings, 0 replies; 24+ messages in thread
From: Eric Leblond @ 2013-05-17 12:01 UTC (permalink / raw)
  To: Chris Boot; +Cc: netfilter-devel

Hi

I will finish to review both your patches this week end. At first look they are OK.

BR

Chris Boot <bootc@bootc.net> a écrit :

>On 11/05/13 18:01, Chris Boot wrote:
>> The daemon code currently tries to nice(-1) just after having given up root
>> privileges, which fails. This patch moves the nice(-1) call to just before
>> the code that gives up the required privileges.
>>
>> Signed-off-by: Chris Boot <bootc@bootc.net>
>> ---
>>  src/ulogd.c |   14 +++++++-------
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/ulogd.c b/src/ulogd.c
>> index b28d0f8..8a144e3 100644
>> --- a/src/ulogd.c
>> +++ b/src/ulogd.c
>> @@ -1235,6 +1235,13 @@ int main(int argc, char* argv[])
>>  		warn_and_exit(daemonize);
>>  	}
>>  
>> +	errno = 0;
>> +	if (nice(-1) == -1) {
>> +		if (errno != 0)
>> +			ulogd_log(ULOGD_ERROR, "Could not nice process: %s\n",
>> +				  strerror(errno));
>> +	}
>> +
>>  	if (change_uid) {
>>  		ulogd_log(ULOGD_NOTICE, "Changing UID / GID\n");
>>  		if (setgid(gid)) {
>> @@ -1261,13 +1268,6 @@ int main(int argc, char* argv[])
>>  		}
>>  	}
>>  
>> -	errno = 0;
>> -	if (nice(-1) == -1) {
>> -		if (errno != 0)
>> -			ulogd_log(ULOGD_ERROR, "Could not nice process: %s\n",
>> -				  strerror(errno));
>> -	}
>> -
>>  
>>  	if (daemonize){
>>  		if (fork()) {
>
>Hi all,
>
>I have had no comments about this patch since I submitted it; is it
>likely to get pulled into ulogd?
>
>Cheers,
>Chris
>
>-- 
>Chris Boot
>bootc@bootc.net
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-05-22  9:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-11 17:01 [PATCH 0/2] Introductions, some tweaks to ulogd Chris Boot
2013-05-11 17:01 ` [PATCH 1/2] ulogd: Perform nice() before giving up root Chris Boot
2013-05-17  7:34   ` Chris Boot
2013-05-17  8:28     ` Eric Leblond
2013-05-11 17:01 ` [PATCH 2/2] ulogd: Implement PID file writing Chris Boot
2013-05-11 19:21   ` Pablo Neira Ayuso
2013-05-11 20:27     ` Chris Boot
2013-05-12  0:48       ` Pablo Neira Ayuso
2013-05-12  8:11         ` Chris Boot
2013-05-12  9:34           ` Pablo Neira Ayuso
2013-05-12  9:38             ` Chris Boot
2013-05-12 10:50               ` Pablo Neira Ayuso
2013-05-12 19:34                 ` Eric Leblond
2013-05-12  9:47             ` Eric Leblond
2013-05-12 10:08               ` Chris Boot
2013-05-12 10:49               ` Pablo Neira Ayuso
2013-05-12  9:53   ` Eric Leblond
2013-05-12 10:59     ` Chris Boot
2013-05-12 12:47       ` [PATCH v2] " Chris Boot
2013-05-17  7:33         ` Chris Boot
2013-05-19 19:19           ` Eric Leblond
2013-05-19 19:22             ` [Ulogd PATCH] Improve pid file handling Eric Leblond
2013-05-22  9:22               ` Chris Boot
  -- strict thread matches above, loose matches on Subject: below --
2013-05-17 12:01 [PATCH 1/2] ulogd: Perform nice() before giving up root Eric Leblond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).