Re: [PATCH] tweak lstat.c to avoid mingw link failure

2008-11-12 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> I needed this patch in libvirt to avoid a link error. >> * lib/lstat.c: Include *before* the use of stat in >> orig_stat. > > This is not right: On Unix systems on which lstat is not POSIX compliant, > it will lead to an endless recu

Re: [PATCH] tweak lstat.c to avoid mingw link failure

2008-11-12 Thread Bruno Haible
Jim Meyering wrote: > I needed this patch in libvirt to avoid a link error. > * lib/lstat.c: Include *before* the use of stat in > orig_stat. This is not right: On Unix systems on which lstat is not POSIX compliant, it will lead to an endless recursion rpl_lstat -> orig_lstat -> rpl_lstat -> .

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Bruno Haible
Paolo Bonzini wrote: > ... it makes no sense at all (and gives a false sense of security) to > add the attribute to fwrite if you do not add it to fflush and fclose too. Additionally, it seems strange to use the same trigger (_FORTIFY_SOURCE = 2) for two semantically very different things: for ena

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Bruno Haible
Hi Jim, > > Subject: [PATCH] * lib/unicodeio.c (unicode_to_mb): Correct spelling of > > u8_uctomb. > > I've just pushed that. Thanks. I apologize for the mistake. Bruno

Re: code/module request: undo setuid

2008-11-12 Thread Bruno Haible
Sam Steingold wrote: > > If so, the magic is > > > > /* This is for executables that have the setgid bit set. */ > > #if HAVE_SETREGID > > setregid (getgid (), getgid ()); > > #else > > setegid (getgid ()); > > #endif > > /* This is for executables that have the setuid bit set. */ > > #if HA

Re: [PATCH] tweak lstat.c to avoid mingw link failure

2008-11-12 Thread Paolo Bonzini
Jim Meyering wrote: > I needed this patch in libvirt to avoid a link error. > FYI, there, lstat is pulled in solely via the dependency from tempname. > Anyone see a problem with it? I don't think it works if gnulib's sys/stat.h happens to redefine lstat to rpl_lstat. What about instead doing #if

Re: code/module request: undo setuid

2008-11-12 Thread Ben Pfaff
Bruno Haible <[EMAIL PROTECTED]> writes: > /* This is for executables that have the setgid bit set. */ > #if HAVE_SETREGID > setregid (getgid (), getgid ()); > #else > setegid (getgid ()); > #endif > /* This is for executables that have the setuid bit set. */ > #if HAVE_SETREUID > setreuid

Re: code/module request: undo setuid

2008-11-12 Thread Ben Pfaff
Sam Steingold <[EMAIL PROTECTED]> writes: > All I can do is to revert setuid for a dangerous operation. > advice? You might find the following paper on the topic interesting: http://www.usenix.org/events/sec02/full_papers/chen/chen.pdf -- "...dans ce pays-ci il est bon de tuer de temps en te

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> wrote: > ... >>> 2008-11-12 Bruno Haible <[EMAIL PROTECTED]> >>> >>> * lib/unicodeio.c: Include unistr.h. >>> (utf8_wctomb): Remove function. >>> (unicode_to_mb): Use utf8_uctomb instead of utf8_wctomb. >> >> T

[PATCH] tweak lstat.c to avoid mingw link failure

2008-11-12 Thread Jim Meyering
I needed this patch in libvirt to avoid a link error. FYI, there, lstat is pulled in solely via the dependency from tempname. Anyone see a problem with it? >From 96045aad0862b2f6166b41ec51088b7932c2cf6b Mon Sep 17 00:00:00 2001 From: Jim Meyering <[EMAIL PROTECTED]> Date: Wed, 12 Nov 2008 17:33:35

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Paolo Bonzini
>> - We have a wrapper xprintf() for printf(), because printf has some >> errors (like ENOMEM or EILSEQ) which are not stream related and >> therefore may not set the stream error indicator. But for fwrite(), >> you are sure that if there's an error, ferror (stream) will be true. >>

Re: code/module request: undo setuid

2008-11-12 Thread Sam Steingold
Bruno Haible wrote: Sam Steingold wrote: Please see the discussion here: https://sourceforge.net/forum/message.php?msg_id=5611456 The discussion is here: http://news.gmane.org/gmane.lisp.clisp.general/cutoff=12548 http://article.gmane.org/gmane.lisp.clisp.general/12533 Please don't recomm

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: ... >> 2008-11-12 Bruno Haible <[EMAIL PROTECTED]> >> >> * lib/unicodeio.c: Include unistr.h. >> (utf8_wctomb): Remove function. >> (unicode_to_mb): Use utf8_uctomb instead of utf8_wctomb. > > This causes a link error in coreutils, due to the

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > It's a long time I last looked at the unicodeio module. I'm applying the > changes below, for better integration with gnulib. > >> unicodeio.c: In function 'fwrite_success_callback': >> unicodeio.c:203: warning: ignoring return value of 'fwrite', declar

Re: code/module request: undo setuid

2008-11-12 Thread Bruno Haible
Sam Steingold wrote: > > The general opinion, among security aware developers, already for 10 > > years, is that the amount of code which is executed with setuid root > > permissions should be minimal. > > this is all nice, but this does not answer my question. > I agree that that it is not a good

Re: unicodeio.c ignores fwrite return value

2008-11-12 Thread Bruno Haible
Hi Jim, It's a long time I last looked at the unicodeio module. I'm applying the changes below, for better integration with gnulib. > unicodeio.c: In function 'fwrite_success_callback': > unicodeio.c:203: warning: ignoring return value of 'fwrite', declared with > attribute warn_unused_resul

Re: warning: module to simplify adding compiler warnings

2008-11-12 Thread Simon Josefsson
An AC_SUBST is still needed for WARN_CFLAGS though. This fixes it. /Simon >From ea74b5798d06c81b0fead783668b42ce6080a177 Mon Sep 17 00:00:00 2001 From: Simon Josefsson <[EMAIL PROTECTED]> Date: Wed, 12 Nov 2008 12:33:58 +0100 Subject: [PATCH] warnings: Invoke AC_SUBST on WARN_CFLAGS. --- Chang

Re: warning: module to simplify adding compiler warnings

2008-11-12 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> >> FWIW, I wouldn't use AC_ARG_VAR for gl_WARN_INIT. >> > >> > Yes, agreed: When the user wants to disable some warnings, he can do so by >> > putting the opposite -W options into the CFLAGS when configuring. That's >> > what my

Re: warning: module to simplify adding compiler warnings

2008-11-12 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Here's what I understood: ... > Simon, maybe you can add a piece of text like this as documentation? Excellent! Many thanks. It matches my intentions. I have added it to the gnulib manual. /Simon

Re: warning: module to simplify adding compiler warnings

2008-11-12 Thread Bruno Haible
Simon Josefsson wrote: > >> FWIW, I wouldn't use AC_ARG_VAR for gl_WARN_INIT. > > > > Yes, agreed: When the user wants to disable some warnings, he can do so by > > putting the opposite -W options into the CFLAGS when configuring. That's > > what my proposed piece of documentation says. Non-maintai

Re: test-select-out failures

2008-11-12 Thread Bruno Haible
Simon Josefsson wrote: > I can reproduce this on mingw as well: > > gnulib-tool --create-testdir --dir m --with-tests select > cd m > ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu > make check > > results in: > > FAIL: test-select-in.sh > FAIL: test-select-out.sh That's not a st

Re: test-select-out failures

2008-11-12 Thread Simon Josefsson
I can reproduce this on mingw as well: gnulib-tool --create-testdir --dir m --with-tests select cd m ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu make check results in: FAIL: test-select-in.sh FAIL: test-select-out.sh For test-select-out.sh, it is the same test that fails on x8

unicodeio.c ignores fwrite return value

2008-11-12 Thread Jim Meyering
Hi Bruno, unicodeio.c: In function 'fwrite_success_callback': unicodeio.c:203: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Would you be open to a change that would suppress the above warning? It comes from this: /* Simple success callback that outp

Re: sockets.h comment

2008-11-12 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> Maybe also add a link to >> >> http://msdn.microsoft.com/en-us/library/ms742213(VS.85).aspx >> >> which contains much additional information? > > Not needed: When googling for a function name together with > "site:msdn.microsof

Re: warning: module to simplify adding compiler warnings

2008-11-12 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Ralf Wildenhues wrote: >> FWIW, I wouldn't use AC_ARG_VAR for gl_WARN_INIT. > > Yes, agreed: When the user wants to disable some warnings, he can do so by > putting the opposite -W options into the CFLAGS when configuring. That's > what my proposed piece