Re: [Toybox] [PATCH] mkpathat: return EEXIST only if MKPATHAT_MKLAST is given

2021-02-07 Thread Rob Landley
On 2/7/21 10:07 AM, Yi-Yo Chiang via Toybox wrote: > There was a regression: > > $ mkdir a > $ touch a/b I just tried that and it worked with no error? > Calling mkpath("a/b") would return an error with EEXIST errno. This is > because "a/b" is a regular file. However mkpath() should only create

[Toybox] [PATCH] cpio: fix misaligned header if readlink() returns unexpected value

2021-02-07 Thread Yi-Yo Chiang via Toybox
If file type is symlink and readlink() fails or returns unexpected link size, then the file body wouldn't be written, resulting in a misaligned archive. As explained in the comments, there are some cases where the link size returned by lstat() and readlink() may be different. To accommodate this,

[Toybox] [PATCH] mkpathat: return EEXIST only if MKPATHAT_MKLAST is given

2021-02-07 Thread Yi-Yo Chiang via Toybox
There was a regression: $ mkdir a $ touch a/b Calling mkpath("a/b") would return an error with EEXIST errno. This is because "a/b" is a regular file. However mkpath() should only create the leading directories of "a/b", which is "a/", which shouldn't be an error because attempting to create an