FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 11-13-2009, 10:00 AM
Gerrit Pape
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

On Sat, Oct 17, 2009 at 01:36:03AM +0100, Ben Hutchings wrote:
> On Tue, 2009-10-13 at 11:13 +0000, Gerrit Pape wrote:
> > tags 547902 + patch
> > quit
> >
> > Hi, please see http://bugs.debian.org/547902
> >
> > Here's a patch from Christian Hohnstaedt <chohnstaedt@innominate.com>
> [...]
>
> Let us know when this change is accepted upstream.

Sorry, I neither forwarded it upstream, nor follow upstream development.

Regards, Gerrit.



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-13-2009, 11:34 AM
Ben Hutchings
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

On Fri, 2009-11-13 at 11:00 +0000, Gerrit Pape wrote:
> On Sat, Oct 17, 2009 at 01:36:03AM +0100, Ben Hutchings wrote:
> > On Tue, 2009-10-13 at 11:13 +0000, Gerrit Pape wrote:
> > > tags 547902 + patch
> > > quit
> > >
> > > Hi, please see http://bugs.debian.org/547902
> > >
> > > Here's a patch from Christian Hohnstaedt <chohnstaedt@innominate.com>
> > [...]
> >
> > Let us know when this change is accepted upstream.
>
> Sorry, I neither forwarded it upstream, nor follow upstream development.

Then we will not apply your patch.

Ben.

--
Ben Hutchings
The two most common things in the universe are hydrogen and stupidity.
 
Old 11-18-2009, 08:13 PM
Moritz Muehlenhoff
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

On Tue, Oct 13, 2009 at 11:13:01AM +0000, Gerrit Pape wrote:
> tags 547902 + patch
> quit

[ Adding Christian to CC: ]

Christian, did you submit your patch upstream?

Cheers,
Moritz

> Hi, please see http://bugs.debian.org/547902
>
> Here's a patch from Christian Hohnstaedt <chohnstaedt@innominate.com>
>
> Thanks, Gerrit.
>
>
> ---
> Testparameter:
> for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do dd if=/proc/sys/net/ipv4/tcp_wmem bs=$i 2>/dev/null; done
>
> for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do dd if=/proc/sys/net/ipv4/tcp_wmem skip=$i bs=1 2>/dev/null |wc -c ; done
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 9270125..038df14 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2117,17 +2117,16 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
> #define TMPBUFLEN 21
> int *i, vleft, first=1, neg, val;
> unsigned long lval;
> - size_t left, len;
> + size_t left, len, off;
>
> char buf[TMPBUFLEN], *p;
> char __user *s = buffer;
>
> - if (!tbl_data || !table->maxlen || !*lenp ||
> - (*ppos && !write)) {
> + if (!tbl_data || !table->maxlen || !*lenp) {
> *lenp = 0;
> return 0;
> }
> -
> + off = 0;
> i = (int *) tbl_data;
> vleft = table->maxlen / sizeof(*i);
> left = *lenp;
> @@ -2176,25 +2175,31 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
> if (conv(&neg, &lval, i, 1, data))
> break;
> } else {
> + loff_t diff;
> p = buf;
> - if (!first)
> - *p++ = ' ';
> -
> if (conv(&neg, &lval, i, 0, data))
> break;
>
> - sprintf(p, "%s%lu", neg ? "-" : "", lval);
> - len = strlen(buf);
> - if (len > left)
> - len = left;
> - if(copy_to_user(s, buf, len))
> - return -EFAULT;
> - left -= len;
> - s += len;
> + len = sprintf(p, "%s%s%lu", first ? "" : " ",
> + neg ? "-" : "", lval);
> + diff = *ppos - off;
> + off += len;
> + if (diff > 0 && diff < len) {
> + p += diff;
> + len -= diff;
> + }
> + if (off > *ppos) {
> + if (len > left)
> + len = left;
> + if(copy_to_user(s, p, len))
> + return -EFAULT;
> + left -= len;
> + s += len;
> + }
> }
> }
>
> - if (!write && !first && left) {
> + if (!write && !first && left && off >= *ppos) {
> if(put_user('
', s))
> return -EFAULT;
> left--, s++;
>
>
>



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-19-2009, 07:27 AM
Christian Hohnstaedt
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

On Wed, Nov 18, 2009 at 10:13:48PM +0100, Moritz Muehlenhoff wrote:
> On Tue, Oct 13, 2009 at 11:13:01AM +0000, Gerrit Pape wrote:
> > tags 547902 + patch
> > quit
>
> [ Adding Christian to CC: ]
>
> Christian, did you submit your patch upstream?

No, not yet.

It still has the problem that reading the value(s) bytewise returns garbage
if the value(s) change during reading.

But I can try to send it to lkml and see what they say.
Shall I point to this bug-report and may I add a "Tested-by" line ?

Christian

>
> Cheers,
> Moritz
>
> > Hi, please see http://bugs.debian.org/547902
> >
> > Here's a patch from Christian Hohnstaedt <chohnstaedt@innominate.com>
> >
> > Thanks, Gerrit.
> >
> >
> > ---
> > Testparameter:
> > for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do dd if=/proc/sys/net/ipv4/tcp_wmem bs=$i 2>/dev/null; done
> >
> > for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do dd if=/proc/sys/net/ipv4/tcp_wmem skip=$i bs=1 2>/dev/null |wc -c ; done
> >
> > diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> > index 9270125..038df14 100644
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -2117,17 +2117,16 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
> > #define TMPBUFLEN 21
> > int *i, vleft, first=1, neg, val;
> > unsigned long lval;
> > - size_t left, len;
> > + size_t left, len, off;
> >
> > char buf[TMPBUFLEN], *p;
> > char __user *s = buffer;
> >
> > - if (!tbl_data || !table->maxlen || !*lenp ||
> > - (*ppos && !write)) {
> > + if (!tbl_data || !table->maxlen || !*lenp) {
> > *lenp = 0;
> > return 0;
> > }
> > -
> > + off = 0;
> > i = (int *) tbl_data;
> > vleft = table->maxlen / sizeof(*i);
> > left = *lenp;
> > @@ -2176,25 +2175,31 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
> > if (conv(&neg, &lval, i, 1, data))
> > break;
> > } else {
> > + loff_t diff;
> > p = buf;
> > - if (!first)
> > - *p++ = ' ';
> > -
> > if (conv(&neg, &lval, i, 0, data))
> > break;
> >
> > - sprintf(p, "%s%lu", neg ? "-" : "", lval);
> > - len = strlen(buf);
> > - if (len > left)
> > - len = left;
> > - if(copy_to_user(s, buf, len))
> > - return -EFAULT;
> > - left -= len;
> > - s += len;
> > + len = sprintf(p, "%s%s%lu", first ? "" : " ",
> > + neg ? "-" : "", lval);
> > + diff = *ppos - off;
> > + off += len;
> > + if (diff > 0 && diff < len) {
> > + p += diff;
> > + len -= diff;
> > + }
> > + if (off > *ppos) {
> > + if (len > left)
> > + len = left;
> > + if(copy_to_user(s, p, len))
> > + return -EFAULT;
> > + left -= len;
> > + s += len;
> > + }
> > }
> > }
> >
> > - if (!write && !first && left) {
> > + if (!write && !first && left && off >= *ppos) {
> > if(put_user('
', s))
> > return -EFAULT;
> > left--, s++;
> >
> >
> >
Christian Hohnstaedt

--
Christian Hohnstaedt / Project Manager Hardware and Manufacturing

Innominate Security Technologies AG / protecting industrial networks
tel: +49.30.921028.208 / fax: +49.30.921028.020
Rudower Chaussee 13, D-12489 Berlin / http://www.innominate.com

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



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2009, 08:16 PM
Moritz Muehlenhoff
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

On Thu, Nov 19, 2009 at 09:27:47AM +0100, Christian Hohnstaedt wrote:
> On Wed, Nov 18, 2009 at 10:13:48PM +0100, Moritz Muehlenhoff wrote:
> > On Tue, Oct 13, 2009 at 11:13:01AM +0000, Gerrit Pape wrote:
> > > tags 547902 + patch
> > > quit
> >
> > [ Adding Christian to CC: ]
> >
> > Christian, did you submit your patch upstream?
>
> No, not yet.

Please keep this bug CCed if you submit it.

> It still has the problem that reading the value(s) bytewise returns garbage
> if the value(s) change during reading.
>
> But I can try to send it to lkml and see what they say.
> Shall I point to this bug-report and may I add a "Tested-by" line ?

I didn't test it myself, but maybe Corin can give feedback on this.

Cheers,
Moritz



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 05-06-2011, 07:26 PM
Jonathan Nieder
 
Default Bug#547902: dash only reads the first character from pipe (bash reads whole line)

reassign 547906 dash 0.5.6.1-1~exp2
reopen 547906
tags 547906 = patch
quit

Moritz Muehlenhoff wrote:

> Closing due to lack of activity.

I'll take it. Will reassign back to linux-2.6 if there is progress.



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110506192607.GA12489@elie">http://lists.debian.org/20110506192607.GA12489@elie
 

Thread Tools




All times are GMT. The time now is 04:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org