netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix source code corruption in ebtables Makefile
@ 2009-02-11 16:31 Tino Keitel
  2009-02-11 16:34 ` Tino Keitel
  2009-02-12 20:22 ` Bart De Schuymer
  0 siblings, 2 replies; 3+ messages in thread
From: Tino Keitel @ 2009-02-11 16:31 UTC (permalink / raw)
  To: bart.de.schuymer, ebtables-devel, netfilter-devel

Hi,

the attached patch fixes source code corruption in the static: target
of the ebtables userspace Makefile. The sed magic tries to clean up the
modified source files, but fails. It ends up with this modifications:

diff -ru ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c
ebtables-v2.0.8-2/extensions/ebt_nflog.c
--- ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c       2009-02-11
16:21:37.000000000 +0100
+++ ebtables-v2.0.8-2/extensions/ebt_nflog.c    2009-02-11
17:22:58.000000000 +0100
@@ -45,7 +45,7 @@
               "in-kernel queue\n");
 }
 
-static void nflog_init(struct ebt_entry_watcher *watcher)
+static _init(struct ebt_entry_watcher *watcher)
 {
        struct ebt_nflog_info *info = (struct ebt_nflog_info
*)watcher->data;
 
@@ -165,7 +165,7 @@
        .name = "nflog",
        .size = sizeof(struct ebt_nflog_info),
        .help = nflog_help,
-       .init = nflog_init,
+       .init _init,
        .parse = nflog_parse,
        .final_check = nflog_final_check,
        .print = nflog_print,

With the patch, the Makefile makes a backup of the original files and
restores it after compilation.

Signed-off-by: Tino Keitel <tino.keitel@innominate.com>

-- 
Tino Keitel
Software Engineer
 
Innominate Security Technologies AG
/protecting industrial networks/
Tel: +49.30.921028-206
Fax: +49.30.921028-020
Rudower Chaussee 13
12489 Berlin / Germany
http://www.innominate.com/

Register Court: AG Charlottenburg, HRB 81603 Management Board: Dirk
Seewald, Chairman of the Supervisory Board: Volker Bibelhausen

INNOMINATE HAS MOVED. PLEASE NOTE THAT OUR BUSINESS CONTACT DATA HAS
CHANGED.

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

* Re: [PATCH] fix source code corruption in ebtables Makefile
  2009-02-11 16:31 [PATCH] fix source code corruption in ebtables Makefile Tino Keitel
@ 2009-02-11 16:34 ` Tino Keitel
  2009-02-12 20:22 ` Bart De Schuymer
  1 sibling, 0 replies; 3+ messages in thread
From: Tino Keitel @ 2009-02-11 16:34 UTC (permalink / raw)
  To: bart.de.schuymer, ebtables-devel, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

On Wed, Feb 11, 2009 at 17:31:42 +0100, Tino Keitel wrote:
> Hi,
> 
> the attached patch fixes source code corruption in the static: target
> of the ebtables userspace Makefile. The sed magic tries to clean up the
> modified source files, but fails. It ends up with this modifications:
> 
> diff -ru ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c
> ebtables-v2.0.8-2/extensions/ebt_nflog.c
> --- ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c       2009-02-11
> 16:21:37.000000000 +0100
> +++ ebtables-v2.0.8-2/extensions/ebt_nflog.c    2009-02-11
> 17:22:58.000000000 +0100
> @@ -45,7 +45,7 @@
>                "in-kernel queue\n");
>  }
>  
> -static void nflog_init(struct ebt_entry_watcher *watcher)
> +static _init(struct ebt_entry_watcher *watcher)
>  {
>         struct ebt_nflog_info *info = (struct ebt_nflog_info
> *)watcher->data;
>  
> @@ -165,7 +165,7 @@
>         .name = "nflog",
>         .size = sizeof(struct ebt_nflog_info),
>         .help = nflog_help,
> -       .init = nflog_init,
> +       .init _init,
>         .parse = nflog_parse,
>         .final_check = nflog_final_check,
>         .print = nflog_print,
> 
> With the patch, the Makefile makes a backup of the original files and
> restores it after compilation.
> 
> Signed-off-by: Tino Keitel <tino.keitel@innominate.com>

And now with the patch.

-- 
Tino Keitel
Software Engineer
 
Innominate Security Technologies AG
/protecting industrial networks/
Tel: +49.30.921028-206
Fax: +49.30.921028-020
Rudower Chaussee 13
12489 Berlin / Germany
http://www.innominate.com/

Register Court: AG Charlottenburg, HRB 81603 Management Board: Dirk
Seewald, Chairman of the Supervisory Board: Volker Bibelhausen

INNOMINATE HAS MOVED. PLEASE NOTE THAT OUR BUSINESS CONTACT DATA HAS
CHANGED.

[-- Attachment #2: static-restore.patch --]
[-- Type: text/x-diff, Size: 1918 bytes --]

--- ebtables-v2.0.8-2.orig/Makefile	2007-09-21 19:27:20.000000000 +0200
+++ ebtables-v2.0.8-2/Makefile	2009-02-11 17:21:22.000000000 +0100
@@ -121,15 +121,17 @@
 	printf "\nint main(int argc, char *argv[])\n{\n "  >> ebtables-standalone.c ; \
 	for arg in $(EXT_FUNC) \
 	; do \
-	sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \
-	mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \
+	cp extensions/ebt_$${arg}.c extensions/ebt_$${arg}.c_ ;\
+	sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c__ ; \
+	mv extensions/ebt_$${arg}.c__ extensions/ebt_$${arg}.c ; \
 	printf "\t%s();\n" _$${arg}_init >> ebtables-standalone.c ; \
 	printf "extern void %s();\n" _$${arg}_init >> include/ebtables_u.h ; \
 	done ; \
 	for arg in $(EXT_TABLES) \
 	; do \
-	sed s/_init/_t_$${arg}_init/ extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \
-	mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \
+	cp extensions/ebtable_$${arg}.c extensions/ebtable_$${arg}.c_ ;\
+	sed s/_init/_t_$${arg}_init/ extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c__ ; \
+	mv extensions/ebtable_$${arg}.c__ extensions/ebtable_$${arg}.c ; \
 	printf "\t%s();\n" _t_$${arg}_init >> ebtables-standalone.c ; \
 	printf "extern void %s();\n" _t_$${arg}_init >> include/ebtables_u.h ; \
 	done ; \
@@ -137,12 +139,10 @@
 	$(CC) $(CFLAGS) $(PROGSPECS) -o $@ $^ -I$(KERNEL_INCLUDES) -Iinclude ; \
 	for arg in $(EXT_FUNC) \
 	; do \
-	sed "s/ .*_init/ _init/" extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \
 	mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \
 	done ; \
 	for arg in $(EXT_TABLES) \
 	; do \
-	sed "s/ .*_init/ _init/" extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \
 	mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \
 	done ; \
 	mv ebtables-standalone.c_ ebtables-standalone.c ; \

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

* Re: [PATCH] fix source code corruption in ebtables Makefile
  2009-02-11 16:31 [PATCH] fix source code corruption in ebtables Makefile Tino Keitel
  2009-02-11 16:34 ` Tino Keitel
@ 2009-02-12 20:22 ` Bart De Schuymer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart De Schuymer @ 2009-02-12 20:22 UTC (permalink / raw)
  To: Tino Keitel; +Cc: bart.de.schuymer, ebtables-devel, netfilter-devel

Hi,

Thanks for the report. The problem was actually in the naming of the 
nflog init function, see the update in cvs.

cheers,
Bart

Tino Keitel schreef:
> Hi,
>
> the attached patch fixes source code corruption in the static: target
> of the ebtables userspace Makefile. The sed magic tries to clean up the
> modified source files, but fails. It ends up with this modifications:
>
> diff -ru ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c
> ebtables-v2.0.8-2/extensions/ebt_nflog.c
> --- ebtables-v2.0.8-2.orig/extensions/ebt_nflog.c       2009-02-11
> 16:21:37.000000000 +0100
> +++ ebtables-v2.0.8-2/extensions/ebt_nflog.c    2009-02-11
> 17:22:58.000000000 +0100
> @@ -45,7 +45,7 @@
>                "in-kernel queue\n");
>  }
>  
> -static void nflog_init(struct ebt_entry_watcher *watcher)
> +static _init(struct ebt_entry_watcher *watcher)
>  {
>         struct ebt_nflog_info *info = (struct ebt_nflog_info
> *)watcher->data;
>  
> @@ -165,7 +165,7 @@
>         .name = "nflog",
>         .size = sizeof(struct ebt_nflog_info),
>         .help = nflog_help,
> -       .init = nflog_init,
> +       .init _init,
>         .parse = nflog_parse,
>         .final_check = nflog_final_check,
>         .print = nflog_print,
>
> With the patch, the Makefile makes a backup of the original files and
> restores it after compilation.
>
> Signed-off-by: Tino Keitel <tino.keitel@innominate.com>
>
>   


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

end of thread, other threads:[~2009-02-12 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 16:31 [PATCH] fix source code corruption in ebtables Makefile Tino Keitel
2009-02-11 16:34 ` Tino Keitel
2009-02-12 20:22 ` Bart De Schuymer

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).