Bug#516294: klibc sys/resource.h now more broken than ever

2010-03-25 Thread Thorsten Glaser
clone 516294 -1
reassign -1 linux-libc-dev
found -1 linux-libc-dev/2.6.32-10
tags -1 = patch
retitle -1 linux-libc-dev: linux/resource.h getrusage() prototype should be 
protected from user space
severity -1 normal
thanks

Hi,

with 1.5.17 you chose to make /usr/lib/klibc/include/linux a symbolic
link… congratulations, you just made the situation worse.

I tried to fix it with the following approach:
• on build time, replace the 「#include linux/resource.h」 with
  the actual file, sans the bogus prototype
• add the correct prototype below

Of course, this now breaks if linux/resource.h is included by a
programme before sys/resource.h:

│In file included from 
/tmp/buildd/klibc-1.5.17/usr/klibc/../include/sys/wait.h:11,
│ from usr/klibc/wait.c:7:
│/tmp/buildd/klibc-1.5.17/usr/klibc/../include/sys/resource.h:15: error: 
conflicting types for 'getrusage'
│/tmp/buildd/klibc-1.5.17/linux/include/linux/resource.h:73: note: previous 
declaration of 'getrusage' was here
│make[4]: *** [usr/klibc/wait.o] Error 1

Of course, the *correct* fix would be to protect the prototype,
for example like this:

--- /usr/include/linux/resource.h   2010-03-17 20:44:47.0 +
+++ resource.h  2010-03-25 11:24:43.0 +
@@ -70,6 +70,8 @@ struct rlimit {
  */
 #include asm/resource.h
 
+#ifdef __KERNEL__
 int getrusage(struct task_struct *p, int who, struct rusage *ru);
+#endif
 
 #endif

This is why I split the bug.


(In case someone wonders, my goal is still to build mksh with klibc;
I have both static and shared, both -DMKSH_SMALL and full-featured
(almost) versions working with a patched 1.5.15 version… maybe we
could even replace klibc’s ash with it, after all Android has done
the same recently and mksh’s not much bigger but much better.)

bye,
//mirabilos
-- 
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
be a database”  (#nosec)‣‣‣ Please let MySQL and MariaDB finally die!



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#516294: klibc sys/resource.h now more broken than ever

2010-03-25 Thread maximilian attems
On Thu, Mar 25, 2010 at 12:29:38PM +0100, Thorsten Glaser wrote:
 clone 516294 -1
 reassign -1 linux-libc-dev
 found -1 linux-libc-dev/2.6.32-10
 tags -1 = patch
 retitle -1 linux-libc-dev: linux/resource.h getrusage() prototype should be 
 protected from user space
 severity -1 normal
 thanks
 
 Hi,
 
 with 1.5.17 you chose to make /usr/lib/klibc/include/linux a symbolic
 link??? congratulations, you just made the situation worse.

dude take a chill pill first.

you seem to have not received my message about *how* the work is done.
there is no point in duplication.
 
 I tried to fix it with the following approach:
 ??? on build time, replace the ???#include linux/resource.h??? with
   the actual file, sans the bogus prototype
 ??? add the correct prototype below

yes this is wrong and seding includes is even more wrong.
 
 Of course, this now breaks if linux/resource.h is included by a
 programme before sys/resource.h:

yes, known.

patch that fixes linux-libc-dev is in 2.6.33 and sent to
sta...@kernel.org for 2.6.32 inclusion, may take some time
as queue is long, but is scheduled.

once this patch is landed your getrusage klibc patch will be
pushed upstream it is already queued and acked by hpa.
 
thanks for your patience.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#516294: klibc sys/resource.h now more broken than ever

2010-03-25 Thread Thorsten Glaser
maximilian attems dixit:

patch that fixes linux-libc-dev is in 2.6.33 and sent to
sta...@kernel.org for 2.6.32 inclusion, may take some time
as queue is long, but is scheduled.

once this patch is landed your getrusage klibc patch will be
pushed upstream it is already queued and acked by hpa.

Ah, great. Thanks a lot!

dude take a chill pill first.
thanks for your patience.

Sorry if I came over as unpatient, I did not intend that,
I “just” wanted to document the state of affairs as I saw it.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org