* [PATCH] LOG target - log GID
@ 2007-07-10 19:25 Maciej Sołtysiak
2007-07-12 8:10 ` Jan Engelhardt
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Maciej Sołtysiak @ 2007-07-10 19:25 UTC (permalink / raw)
To: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 3293 bytes --]
Hi,
While I was browsing through the files in my home directory I stumbled
upon my patch from
May 2003 that adds to the LOG target an option to log UID and GID.
I noticed that someone already has done that in the past 4 years ;-)
However currently LOG only logs UID. My patch used to log GID too, so
what do you say about applying the patches attached.
log_gid_kern.diff - patch ipt_LOG.c and ip6t_LOG.c
log_gid_user.diff - patch libipt_LOG.c and libip6t_LOG.c
Please CC me, I am not on the list for some time now.
Best Regards,
Maciej Soltysiak
diff -Nru linux-2.6.22.orig/net/ipv4/netfilter/ipt_LOG.c
linux-2.6.22/net/ipv4/netfilter/ipt_LOG.c
--- linux-2.6.22.orig/net/ipv4/netfilter/ipt_LOG.c 2007-07-10
20:57:44.000000000 +0200
+++ linux-2.6.22/net/ipv4/netfilter/ipt_LOG.c 2007-07-10
21:01:16.000000000 +0200
@@ -337,7 +337,9 @@
if ((logflags & IPT_LOG_UID) && !iphoff && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
- printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
+ printk("UID=%u GID=%u",
+ skb->sk->sk_socket->file->f_uid,
+ skb->sk->sk_socket->file->f_gid);
read_unlock_bh(&skb->sk->sk_callback_lock);
}
diff -Nru linux-2.6.22.orig/net/ipv6/netfilter/ip6t_LOG.c
linux-2.6.22/net/ipv6/netfilter/ip6t_LOG.c
--- linux-2.6.22.orig/net/ipv6/netfilter/ip6t_LOG.c 2007-07-10
20:57:44.000000000 +0200
+++ linux-2.6.22/net/ipv6/netfilter/ip6t_LOG.c 2007-07-10
21:01:41.000000000 +0200
@@ -359,7 +359,9 @@
if ((logflags & IP6T_LOG_UID) && recurse && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
- printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
+ printk("UID=%u GID=%u",
+ skb->sk->sk_socket->file->f_uid,
+ skb->sk->sk_socket->file->f_gid);
read_unlock_bh(&skb->sk->sk_callback_lock);
}
}
diff -Nru iptables-1.3.8-20070709.orig/extensions/libip6t_LOG.c
iptables-1.3.8-20070709/extensions/libip6t_LOG.c
--- iptables-1.3.8-20070709.orig/extensions/libip6t_LOG.c 2006-10-10
08:18:40.000000000 +0200
+++ iptables-1.3.8-20070709/extensions/libip6t_LOG.c 2007-07-10
20:52:50.000000000 +0200
@@ -28,7 +28,7 @@
" --log-tcp-sequence Log TCP sequence numbers.\n\n"
" --log-tcp-options Log TCP options.\n\n"
" --log-ip-options Log IP options.\n\n"
-" --log-uid Log UID owning the local socket.\n\n",
+" --log-uid Log UID/GID owning the local socket.\n\n",
IPTABLES_VERSION);
}
diff -Nru iptables-1.3.8-20070709.orig/extensions/libipt_LOG.c
iptables-1.3.8-20070709/extensions/libipt_LOG.c
--- iptables-1.3.8-20070709.orig/extensions/libipt_LOG.c 2006-10-10
08:18:40.000000000 +0200
+++ iptables-1.3.8-20070709/extensions/libipt_LOG.c 2007-07-10
20:52:46.000000000 +0200
@@ -28,7 +28,7 @@
" --log-tcp-sequence Log TCP sequence numbers.\n\n"
" --log-tcp-options Log TCP options.\n\n"
" --log-ip-options Log IP options.\n\n"
-" --log-uid Log UID owning the local socket.\n\n",
+" --log-uid Log UID/GID owning the local socket.\n\n",
IPTABLES_VERSION);
}
[-- Attachment #2: log_gid_kern.diff --]
[-- Type: text/plain, Size: 1322 bytes --]
diff -Nru linux-2.6.22.orig/net/ipv4/netfilter/ipt_LOG.c linux-2.6.22/net/ipv4/netfilter/ipt_LOG.c
--- linux-2.6.22.orig/net/ipv4/netfilter/ipt_LOG.c 2007-07-10 20:57:44.000000000 +0200
+++ linux-2.6.22/net/ipv4/netfilter/ipt_LOG.c 2007-07-10 21:01:16.000000000 +0200
@@ -337,7 +337,9 @@
if ((logflags & IPT_LOG_UID) && !iphoff && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
- printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
+ printk("UID=%u GID=%u",
+ skb->sk->sk_socket->file->f_uid,
+ skb->sk->sk_socket->file->f_gid);
read_unlock_bh(&skb->sk->sk_callback_lock);
}
diff -Nru linux-2.6.22.orig/net/ipv6/netfilter/ip6t_LOG.c linux-2.6.22/net/ipv6/netfilter/ip6t_LOG.c
--- linux-2.6.22.orig/net/ipv6/netfilter/ip6t_LOG.c 2007-07-10 20:57:44.000000000 +0200
+++ linux-2.6.22/net/ipv6/netfilter/ip6t_LOG.c 2007-07-10 21:01:41.000000000 +0200
@@ -359,7 +359,9 @@
if ((logflags & IP6T_LOG_UID) && recurse && skb->sk) {
read_lock_bh(&skb->sk->sk_callback_lock);
if (skb->sk->sk_socket && skb->sk->sk_socket->file)
- printk("UID=%u ", skb->sk->sk_socket->file->f_uid);
+ printk("UID=%u GID=%u",
+ skb->sk->sk_socket->file->f_uid,
+ skb->sk->sk_socket->file->f_gid);
read_unlock_bh(&skb->sk->sk_callback_lock);
}
}
[-- Attachment #3: log_gid_user.diff --]
[-- Type: text/plain, Size: 1178 bytes --]
diff -Nru iptables-1.3.8-20070709.orig/extensions/libip6t_LOG.c iptables-1.3.8-20070709/extensions/libip6t_LOG.c
--- iptables-1.3.8-20070709.orig/extensions/libip6t_LOG.c 2006-10-10 08:18:40.000000000 +0200
+++ iptables-1.3.8-20070709/extensions/libip6t_LOG.c 2007-07-10 20:52:50.000000000 +0200
@@ -28,7 +28,7 @@
" --log-tcp-sequence Log TCP sequence numbers.\n\n"
" --log-tcp-options Log TCP options.\n\n"
" --log-ip-options Log IP options.\n\n"
-" --log-uid Log UID owning the local socket.\n\n",
+" --log-uid Log UID/GID owning the local socket.\n\n",
IPTABLES_VERSION);
}
diff -Nru iptables-1.3.8-20070709.orig/extensions/libipt_LOG.c iptables-1.3.8-20070709/extensions/libipt_LOG.c
--- iptables-1.3.8-20070709.orig/extensions/libipt_LOG.c 2006-10-10 08:18:40.000000000 +0200
+++ iptables-1.3.8-20070709/extensions/libipt_LOG.c 2007-07-10 20:52:46.000000000 +0200
@@ -28,7 +28,7 @@
" --log-tcp-sequence Log TCP sequence numbers.\n\n"
" --log-tcp-options Log TCP options.\n\n"
" --log-ip-options Log IP options.\n\n"
-" --log-uid Log UID owning the local socket.\n\n",
+" --log-uid Log UID/GID owning the local socket.\n\n",
IPTABLES_VERSION);
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-07-10 19:25 [PATCH] LOG target - log GID Maciej Sołtysiak
@ 2007-07-12 8:10 ` Jan Engelhardt
2007-07-12 9:03 ` Yasuyuki KOZAKAI
[not found] ` <474D30A8.3070208@trash.net>
2 siblings, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2007-07-12 8:10 UTC (permalink / raw)
To: Maciej Sołtysiak; +Cc: netfilter-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 388 bytes --]
On Jul 10 2007 21:25, Maciej Sołtysiak wrote:
>
> I noticed that someone already has done that in the past 4 years ;-)
> However currently LOG only logs UID. My patch used to log GID too, so
> what do you say about applying the patches attached.
So.. what happens when you ping or a kernel thread (e.g. knfsd) sends out data,
which do not normally have an owner?
Jan
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-07-10 19:25 [PATCH] LOG target - log GID Maciej Sołtysiak
2007-07-12 8:10 ` Jan Engelhardt
@ 2007-07-12 9:03 ` Yasuyuki KOZAKAI
2007-07-13 9:59 ` Jan Engelhardt
[not found] ` <474D30A8.3070208@trash.net>
2 siblings, 1 reply; 9+ messages in thread
From: Yasuyuki KOZAKAI @ 2007-07-12 9:03 UTC (permalink / raw)
To: maciej.soltysiak; +Cc: netfilter-devel
Hi,
From: Maciej Sołtysiak <maciej.soltysiak@ae.poznan.pl>
Date: Tue, 10 Jul 2007 21:25:11 +0200
> Hi,
>
> While I was browsing through the files in my home directory I stumbled
> upon my patch from
> May 2003 that adds to the LOG target an option to log UID and GID.
>
> I noticed that someone already has done that in the past 4 years ;-)
> However currently LOG only logs UID. My patch used to log GID too, so
> what do you say about applying the patches attached.
We cannot change format of LOG target because that breaks programs parsing logs.
But it might be possible by introducing new option like '--log-gid'.
-- Yasuyuki Kozakai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-07-12 9:03 ` Yasuyuki KOZAKAI
@ 2007-07-13 9:59 ` Jan Engelhardt
2007-07-13 10:30 ` Yasuyuki KOZAKAI
0 siblings, 1 reply; 9+ messages in thread
From: Jan Engelhardt @ 2007-07-13 9:59 UTC (permalink / raw)
To: Yasuyuki KOZAKAI; +Cc: maciej.soltysiak, netfilter-devel
On Jul 12 2007 18:03, Yasuyuki KOZAKAI wrote:
>> Hi,
>>
>> While I was browsing through the files in my home directory I stumbled
>> upon my patch from
>> May 2003 that adds to the LOG target an option to log UID and GID.
>>
>> I noticed that someone already has done that in the past 4 years ;-)
>> However currently LOG only logs UID. My patch used to log GID too, so
>> what do you say about applying the patches attached.
>
>We cannot change format of LOG target because that breaks programs parsing logs.
Hm, then it's time to write a specification on how to correctly parse things
(namely, splitting at whitespace and parsing the ^\S+= component of it rather
than assuming things were in a fixed order)
>But it might be possible by introducing new option like '--log-gid'.
Jan
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-07-13 9:59 ` Jan Engelhardt
@ 2007-07-13 10:30 ` Yasuyuki KOZAKAI
0 siblings, 0 replies; 9+ messages in thread
From: Yasuyuki KOZAKAI @ 2007-07-13 10:30 UTC (permalink / raw)
To: jengelh; +Cc: maciej.soltysiak, netfilter-devel, yasuyuki.kozakai
From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Fri, 13 Jul 2007 11:59:21 +0200 (CEST)
> On Jul 12 2007 18:03, Yasuyuki KOZAKAI wrote:
> >> Hi,
> >>
> >> While I was browsing through the files in my home directory I stumbled
> >> upon my patch from
> >> May 2003 that adds to the LOG target an option to log UID and GID.
> >>
> >> I noticed that someone already has done that in the past 4 years ;-)
> >> However currently LOG only logs UID. My patch used to log GID too, so
> >> what do you say about applying the patches attached.
> >
> >We cannot change format of LOG target because that breaks programs parsing logs.
>
> Hm, then it's time to write a specification on how to correctly parse things
> (namely, splitting at whitespace and parsing the ^\S+= component of it rather
> than assuming things were in a fixed order)
Unfortunately, there is no way for us to know every program to do that. So
what we can do is to keep current format including the number of objects
and white spaces, order of things, and so on.
> >But it might be possible by introducing new option like '--log-gid'.
-- Yasuyuki Kozakai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
[not found] ` <474D30A8.3070208@trash.net>
@ 2007-11-28 9:13 ` Patrick McHardy
2007-11-28 16:45 ` Maciej Sołtysiak
0 siblings, 1 reply; 9+ messages in thread
From: Patrick McHardy @ 2007-11-28 9:13 UTC (permalink / raw)
To: Maciej So?tysiak; +Cc: Netfilter Development Mailinglist
[CCed new list]
Maciej So?tysiak wrote:
> Hi,
>
> While I was browsing through the files in my home directory I stumbled
> upon my patch from
> May 2003 that adds to the LOG target an option to log UID and GID.
>
> I noticed that someone already has done that in the past 4 years ;-)
> However currently LOG only logs UID. My patch used to log GID too, so
> what do you say about applying the patches attached.
>
> log_gid_kern.diff - patch ipt_LOG.c and ip6t_LOG.c
> log_gid_user.diff - patch libipt_LOG.c and libip6t_LOG.c
Just noticed these old patches. Please send me a Signed-off-by: line
and I'm going to apply them.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-11-28 9:13 ` Patrick McHardy
@ 2007-11-28 16:45 ` Maciej Sołtysiak
2007-11-28 17:07 ` Patrick McHardy
0 siblings, 1 reply; 9+ messages in thread
From: Maciej Sołtysiak @ 2007-11-28 16:45 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Netfilter Development Mailinglist
Hi Patrick,
As I remember there was some debate over these patches both back in 2003 and
2007. I don't know if they apply cleanly to the current source, but if
you find them
OK, here's my Signed-off-by:
> Just noticed these old patches. Please send me a Signed-off-by: line
> and I'm going to apply them.
Signed-off-by: Maciej Soltysiak <maciej.soltysiak@ae.poznan.pl>
Thanks Patrick and best regards,
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-11-28 16:45 ` Maciej Sołtysiak
@ 2007-11-28 17:07 ` Patrick McHardy
2007-11-28 18:41 ` Maciej Sołtysiak
0 siblings, 1 reply; 9+ messages in thread
From: Patrick McHardy @ 2007-11-28 17:07 UTC (permalink / raw)
To: Maciej So?tysiak; +Cc: Netfilter Development Mailinglist
Maciej So?tysiak wrote:
> Hi Patrick,
>
> As I remember there was some debate over these patches both back in 2003
> and
> 2007. I don't know if they apply cleanly to the current source, but if
> you find them
> OK, here's my Signed-off-by:
>
>> Just noticed these old patches. Please send me a Signed-off-by: line
>> and I'm going to apply them.
> Signed-off-by: Maciej Soltysiak <maciej.soltysiak@ae.poznan.pl>
Applied, thanks. I'll add the userspace part once we've settled when
to release iptables 1.4.0.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] LOG target - log GID
2007-11-28 17:07 ` Patrick McHardy
@ 2007-11-28 18:41 ` Maciej Sołtysiak
0 siblings, 0 replies; 9+ messages in thread
From: Maciej Sołtysiak @ 2007-11-28 18:41 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Netfilter Development Mailinglist
Hi Patrick,
> Applied, thanks. I'll add the userspace part once we've settled when
> to release iptables 1.4.0.
Cool, thanks again :-)
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-11-28 18:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-10 19:25 [PATCH] LOG target - log GID Maciej Sołtysiak
2007-07-12 8:10 ` Jan Engelhardt
2007-07-12 9:03 ` Yasuyuki KOZAKAI
2007-07-13 9:59 ` Jan Engelhardt
2007-07-13 10:30 ` Yasuyuki KOZAKAI
[not found] ` <474D30A8.3070208@trash.net>
2007-11-28 9:13 ` Patrick McHardy
2007-11-28 16:45 ` Maciej Sołtysiak
2007-11-28 17:07 ` Patrick McHardy
2007-11-28 18:41 ` Maciej Sołtysiak
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.