From a78212be3364887b5ff9f9902cfb65eb211b269b Mon Sep 17 00:00:00 2001 From: nil Date: Thu, 18 Mar 2010 07:21:09 +0000 Subject: --- .../post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn (limited to 'doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn') diff --git a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn new file mode 100644 index 000000000..1594036dc --- /dev/null +++ b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn @@ -0,0 +1,14 @@ +Thinking that any c compiler would do the job, I tried to use tcc with ikiwiki, as explicitely allowed by the Debian package dependencies. + +I installed `tcc` and `libc6-dev` (for `libcrt1`). The wrapper compilation was OK, but the wrapper fails to run correctly and dies with + + usage: ikiwiki [options] source dest + ikiwiki --setup configfile + +Everything works fine with gcc. + +versions: Debian etch+backports + + + + -- cgit v1.2.3 From 7b7d1cfcb75451bf9f8fc7efb3814c47deef0059 Mon Sep 17 00:00:00 2001 From: nil Date: Thu, 18 Mar 2010 07:56:15 +0000 Subject: distro confusion --- doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn') diff --git a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn index 1594036dc..4226c026a 100644 --- a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn +++ b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn @@ -7,7 +7,7 @@ I installed `tcc` and `libc6-dev` (for `libcrt1`). The wrapper compilation was O Everything works fine with gcc. -versions: Debian etch+backports +versions: Debian lenny + backports -- cgit v1.2.3 From dddd6aa99055d8505f73e39b12f049633d9cb4c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Mar 2010 17:44:46 -0400 Subject: Allow wrappers to be built using tcc. --- IkiWiki/Wrapper.pm | 10 +++++++--- debian/changelog | 1 + .../post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 11 ++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn') diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 830b04877..f175b4a0b 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -101,7 +101,6 @@ EOF #include #include -extern char **environ; char *newenviron[$#envsave+6]; int i=0; @@ -121,8 +120,13 @@ $check_commit_hook $envsave newenviron[i++]="HOME=$ENV{HOME}"; newenviron[i++]="WRAPPED_OPTIONS=$configstring"; - newenviron[i]=NULL; - environ=newenviron; + + if (clearenv() != 0) { + perror("clearenv"); + exit(1); + } + for (; i>0; i--) + putenv(newenviron[i-1]); if (setregid(getegid(), -1) != 0 && setregid(getegid(), -1) != 0) { diff --git a/debian/changelog b/debian/changelog index e5347e2a1..73f6fcff8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.20100313) UNRELEASED; urgency=low wiki source files, such as .htaccess, that would normally be skipped for security or other reasons. Closes: #447267 (Thanks to Aaron Wilson for the original patch.) + * Allow wrappers to be built using tcc. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn index 4226c026a..a8fb19888 100644 --- a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn +++ b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn @@ -9,6 +9,11 @@ Everything works fine with gcc. versions: Debian lenny + backports - - - +> Seems that tcc does not respect changing where `environ` points as a way +> to change the environment seen after `exec` +> +> Given that the man page for `clearenv` suggests using `environ=NULL` +> if `clearenv` is not available, I would be lerry or using tcc to compile +> stuff, since that could easily lead to a security compromise of code that +> expects that to work. However, I have fixed ikiwiki to use `clearenv`. +> --[[Joey]] [[done]] -- cgit v1.2.3