[OMPI devel] mixing stdio and write?

2006-10-13 Thread Ralf Wildenhues
Hello Brian, all,

| r12094 | brbarret | 2006-10-11 20:40:21 +0200 (Wed, 11 Oct 2006) | 11 lines
| Changed paths:
|M /trunk/opal/util/output.c
| 
| Use write() instead of fprintf() for output to stdout / stderr.  Fixes an 
issue
| I was running into where if a string in the argument list contains a printf
| escape sequence, we would segfault.  In particular, I was using opal_output
| to print the environment and had something like:
| 
|   LESSOPEN=|/usr/bin/lesspipe.sh %s
| 
| in my environment.  So I called opal_output(0, "%s", environ[i]) and
| got a segfault because the fprintf tried to expand the %s in the
| environment variable

This looks weird to me.  Unless that function is the only one producing
output on stdout/stderr (or all of them do a flush after each output, or
you also flush before each output -- yuck), I think things may be
reordered.  Why not just use fputs instead to avoid the format string
vulnerability?

Cheers,
Ralf


Re: [OMPI devel] mixing stdio and write?

2006-10-13 Thread Brian Barrett

Because I'm silly.  I shall make it so - Thanks!

Brian

On Oct 13, 2006, at 5:44 AM, Ralf Wildenhues wrote:


Hello Brian, all,

| r12094 | brbarret | 2006-10-11 20:40:21 +0200 (Wed, 11 Oct 2006)  
| 11 lines

| Changed paths:
|M /trunk/opal/util/output.c
|
| Use write() instead of fprintf() for output to stdout / stderr.   
Fixes an issue
| I was running into where if a string in the argument list  
contains a printf
| escape sequence, we would segfault.  In particular, I was using  
opal_output

| to print the environment and had something like:
|
|   LESSOPEN=|/usr/bin/lesspipe.sh %s
|
| in my environment.  So I called opal_output(0, "%s", environ[i]) and
| got a segfault because the fprintf tried to expand the %s in the
| environment variable

This looks weird to me.  Unless that function is the only one  
producing
output on stdout/stderr (or all of them do a flush after each  
output, or

you also flush before each output -- yuck), I think things may be
reordered.  Why not just use fputs instead to avoid the format string
vulnerability?

Cheers,
Ralf
___
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel




[OMPI devel] configure changes (ooops!)

2006-10-13 Thread Brian Barrett

Hi all -

At the last minute last night I wanted to change one small detail in  
the wrapper compiler code.  Then, as is typical with me, I got  
distracted.  As some of you noticed, none of the configure changes  
made it into the trunk last night.  Should happen this weekend.   
Sorry about that!


Brian