Re: on buffer overflows and insecurity
- From: $)CHarald van D)&k <truedfx@xxxxxxxxx>
- Date: Mon, 24 Sep 2007 19:18:59 +0000 (UTC)
On Mon, 24 Sep 2007 18:34:28 +0000, Richard Harter wrote:
On Mon, 24 Sep 2007 16:47:25 +0000 (UTC),
=?iso-2022-kr?q?=1B=24=29CHarald_van_D=0E=29=26=0Fk?=
<truedfx@xxxxxxxxx> wrote:
On Mon, 24 Sep 2007 16:34:06 +0000, Richard Harter wrote:
On Mon, 24 Sep 2007 10:48:00 -0400, Eric Sosman <Eric.Sosman@xxxxxxx>
wrote:
What happens on a system where fopen() can fail for
reasons POSIX doesn't enumerate? I have used a system where a file
specification could (optionally) include an account name and password;
the attempt to open could fail because of bad credentials. You might,
with a stretch, translate this to POSIX' EACCESS, but that's really
not how EACCESS is described.
[snip litany of possible differences]
The obvious thing to do is have a general error code in addition to
the ones imported from posix. The general code would cover all errors
not otherwise classified. Do you have a problem with that?
I do. If fopen can fail for other reasons than specified by POSIX, the
implementation should define additional error codes properly. There's no
point in using something like EIDUNNO, which tells you nothing more than
fopen's NULL return value, when an implementation-specific EBADCRED
could be defined just as easily. It would then make sure a decent
message can get printed by strerror. (As an aside, I don't see the
problem with EACCES for this specific error, but I do agree with some of
the other snipped examples.)
I don't quite understand your objection. What we are talking about are
the error codes (that should be) required by the standard.
And you're suggesting requiring something like EIDUNNO, while I'm saying
this should not be required or even standardised at all.
Clearly the
standard cannot specify codes for all possible errors in all possible
implementations. What it can do is specify that there are codes for the
commonest errors.
Adding codes for all possible errors is up to the implementation.
That's what I would like to see required, and what I believe you stated
should not even be allowed: you stated "The general code would cover all
errors not otherwise classified." I took this to mean fopen would be
allowed to a) succeed, b) set errno to one of the imported error codes,
or c) set errno to a general error indicator. Missing is the possibility
to set errno to an implementation-defined error indicator, and with that
possibility, I personally don't see a use for a general error indicator.
If I misunderstood what you meant, then could you please clarify?
However that is necessarily non-portable.
They can be portably used with strerror, and that's enough to make them
useful. Would they cause any problems that you can see?
.
- Follow-Ups:
- Re: on buffer overflows and insecurity
- From: Keith Thompson
- Re: on buffer overflows and insecurity
- References:
- returning error from main()
- From: junky_fellow@xxxxxxxxxxx
- Re: on buffer overflows and insecurity (was returning error from main())
- From: jacob navia
- Re: on buffer overflows and insecurity (was returning error from main())
- From: Charlie Gordon
- Re: on buffer overflows and insecurity
- From: Ben Bacarisse
- Re: on buffer overflows and insecurity
- From: Richard Tobin
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Mark McIntyre
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Ian Collins
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Eric Sosman
- Re: on buffer overflows and insecurity
- From: Richard Harter
- Re: on buffer overflows and insecurity
- From: $)CHarald van D)&k
- Re: on buffer overflows and insecurity
- From: Richard Harter
- returning error from main()
- Prev by Date: Any preprocessor definition to tell if inline is supported?
- Next by Date: Re: Float as Infinity
- Previous by thread: Re: on buffer overflows and insecurity
- Next by thread: Re: on buffer overflows and insecurity
- Index(es):
Relevant Pages
|
|