Re: [PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Duy,

On Sun, 7 Feb 2016, Nguyễn Thái Ngọc Duy wrote:

> Noticed-by: Ole Tange <ole@xxxxxxxx>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
>  On Sun, Feb 7, 2016 at 4:56 AM, Ole Tange <ole@xxxxxxxx> wrote:
>  > If file name too long it should just try to see if it is a reference
>  > to a revision.
> 
>  Looks easy enough to fix.

Maybe with a little bit more informative commit message? ;-)

Something like

	Avoid interpreting too-long parameter as file name

	Even if it is easier to write HEAD~2000, it is legal to write
	HEAD^^^... (repeats "^" 2000 times in total). However, such a
	string is too long to be a legal filename (and on Windows, by
	default even much, much shorter strings are still illegal
	because they exceed MAX_PATH).

	Therefore, if the check_filename() function encounters too long
	a command-line parameter, it should interpet the error code
	ENAMETOOLONG as a strong hint that this is not a file name
	instead of dying with an error message.

	Noticed-by: ...

What do you think?
Dscho

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]