All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: [PATCH] fix format specifier for netfilter log targets
Date: Mon, 15 May 2006 18:56:00 +1000	[thread overview]
Message-ID: <44684220.9050107@snapgear.com> (raw)

The prefix argument for nf_log_packet is a format specifier,
so don't pass the user defined string directly to it.

Signed-off-by: Philip Craig <philipc@snapgear.com>

Index: linux-2.6.x/net/ipv4/netfilter/ipt_LOG.c
===================================================================
RCS file: /cvs/sw/linux-2.6.x/net/ipv4/netfilter/ipt_LOG.c,v
retrieving revision 1.1.1.16
diff -u -p -r1.1.1.16 ipt_LOG.c
--- linux-2.6.x/net/ipv4/netfilter/ipt_LOG.c	21 Mar 2006 01:35:40 -0000	1.1.1.16
+++ linux-2.6.x/net/ipv4/netfilter/ipt_LOG.c	15 May 2006 08:44:39 -0000
@@ -427,7 +427,7 @@ ipt_log_target(struct sk_buff **pskb,

 	if (loginfo->logflags & IPT_LOG_NFLOG)
 		nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
-		              loginfo->prefix);
+		              "%s", loginfo->prefix);
 	else
 		ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
 		               loginfo->prefix);
Index: linux-2.6.x/net/ipv6/netfilter/ip6t_LOG.c
===================================================================
RCS file: /cvs/sw/linux-2.6.x/net/ipv6/netfilter/ip6t_LOG.c,v
retrieving revision 1.1.1.14
diff -u -p -r1.1.1.14 ip6t_LOG.c
--- linux-2.6.x/net/ipv6/netfilter/ip6t_LOG.c	21 Mar 2006 01:35:41 -0000	1.1.1.14
+++ linux-2.6.x/net/ipv6/netfilter/ip6t_LOG.c	15 May 2006 08:44:39 -0000
@@ -438,7 +438,7 @@ ip6t_log_target(struct sk_buff **pskb,

 	if (loginfo->logflags & IP6T_LOG_NFLOG)
 		nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
-		              loginfo->prefix);
+		              "%s", loginfo->prefix);
 	else
 		ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
 		                loginfo->prefix);
Index: linux-2.6.x/net/bridge/netfilter/ebt_log.c
===================================================================
RCS file: /cvs/sw/linux-2.6.x/net/bridge/netfilter/ebt_log.c,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 ebt_log.c
--- linux-2.6.x/net/bridge/netfilter/ebt_log.c	21 Mar 2006 01:35:39 -0000	1.1.1.9
+++ linux-2.6.x/net/bridge/netfilter/ebt_log.c	15 May 2006 08:44:39 -0000
@@ -168,7 +168,7 @@ static void ebt_log(const struct sk_buff

 	if (info->bitmask & EBT_LOG_NFLOG)
 		nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
-		              info->prefix);
+		              "%s", info->prefix);
 	else
 		ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
 		               info->prefix);

             reply	other threads:[~2006-05-15  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15  8:56 Philip Craig [this message]
2006-05-15 11:40 ` [PATCH] fix format specifier for netfilter log targets Patrick McHardy

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=44684220.9050107@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@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.