[MPlayer-dev-eng] [PATCH] fix for unconditional use of PATH_MAX
D Richard Felker III
dalias at aerifal.cx
Thu May 1 16:15:54 CEST 2003
On Thu, May 01, 2003 at 02:35:01PM +0200, Robert Millan wrote:
> On Wed, Apr 30, 2003 at 07:39:27PM +0200, Fabian Franz wrote:
> >
> > I think we should stick to what we have now and just add, what I mentioned adn
> > no it is no security risk, see Tobias Mail, about it.
>
> please don't do that, it's a _bad_ solution. what if i run mplayer in
> a directory longer than 512 bytes? then it will fail or not work as
> expected.
Then you deserve what you get for making such a nonsense directory!!
> if you hardcode PATH_MAX, you'll recieve bug reports from users telling
> that mplayer fails or behaves unexpectedly.
No, no one uses such long paths, because on ALL unices but Hurd,
they're forbidden!
> if you don't want to stick with two code snippets (one for PATH_MAX and
> other for non-PATH_MAX), then just use dynamic allocation as someone
> suggested before. that will work for all systems.
I agree this is acceptable, but IMO it's not worth the code clutter.
It's definitely not worth #ifdef clutter.
There's a reason PATH_MAX exists. In order to make an operating system
robust, there have to be resource limits on users. If I could make a
500-meg directory name, then pass it to a syscall, that would be some
serious denial of service on the system.....
Rich
More information about the MPlayer-dev-eng
mailing list