<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib/realpath.c, branch release/11.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r318303:</title>
<updated>2017-05-29T12:55:26+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2017-05-29T12:55:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=20810595e1756b873297453877ce8dad0b3e8dd8'/>
<id>20810595e1756b873297453877ce8dad0b3e8dd8</id>
<content type='text'>
Style.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Style.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r318299:</title>
<updated>2017-05-29T12:53:44+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2017-05-29T12:53:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=da0461f1d737feca1fa0f76be44f9c0c67e21482'/>
<id>da0461f1d737feca1fa0f76be44f9c0c67e21482</id>
<content type='text'>
Simplify cleanup on failure in realpath(3).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simplify cleanup on failure in realpath(3).
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r318298:</title>
<updated>2017-05-29T12:52:13+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2017-05-29T12:52:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=de06d29d66660aac247874343ceb52c3f58f7cc0'/>
<id>de06d29d66660aac247874343ceb52c3f58f7cc0</id>
<content type='text'>
Fix several buffer overflows in realpath(3), and other minor issues.

PR:	219154
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix several buffer overflows in realpath(3), and other minor issues.

PR:	219154
</pre>
</div>
</content>
</entry>
<entry>
<title>realpath(): Properly fail "." or ".." components after non-directories.</title>
<updated>2014-04-13T19:48:28+00:00</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2014-04-13T19:48:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=310c8f3c99499326d1053ce811348bf2e35e09af'/>
<id>310c8f3c99499326d1053ce811348bf2e35e09af</id>
<content type='text'>
If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR:		kern/82980
MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR:		kern/82980
MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>- Correct mispellings of the word occurrence</title>
<updated>2013-04-17T11:40:10+00:00</updated>
<author>
<name>Gabor Kovesdan</name>
<email>gabor@FreeBSD.org</email>
</author>
<published>2013-04-17T11:40:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ab3f6b347ef97e755cf291ed77f9eb4a48531d15'/>
<id>ab3f6b347ef97e755cf291ed77f9eb4a48531d15</id>
<content type='text'>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Submitted by:	Christoph Mallon &lt;christoph.mallon@gmx.de&gt; (via private mail)
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid mapping ENOENT to ENOTDIR for non-existent path components.</title>
<updated>2012-09-12T17:05:39+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2012-09-12T17:05:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7877ed7ce33ed9b977ac9b521f9a2f95b5d589bd'/>
<id>7877ed7ce33ed9b977ac9b521f9a2f95b5d589bd</id>
<content type='text'>
The ENOTDIR mapping was introduced in r235266 for kern/128933 based on
an interpretation of the somewhat ambiguous language in the POSIX realpath
specification.  The interpretation is inconsistent with Solaris and Linux,
a regression from 9.0, and does not appear to be permitted by the
description of ENOTDIR:

     20 ENOTDIR Not a directory.  A component of the specified pathname
             existed, but it was not a directory, when a directory was
             expected.

PR:		standards/171577
MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ENOTDIR mapping was introduced in r235266 for kern/128933 based on
an interpretation of the somewhat ambiguous language in the POSIX realpath
specification.  The interpretation is inconsistent with Solaris and Linux,
a regression from 9.0, and does not appear to be permitted by the
description of ENOTDIR:

     20 ENOTDIR Not a directory.  A component of the specified pathname
             existed, but it was not a directory, when a directory was
             expected.

PR:		standards/171577
MFC after:	3 days
</pre>
</div>
</content>
</entry>
<entry>
<title>1) Although unpublished version of standard</title>
<updated>2012-06-05T16:16:33+00:00</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2012-06-05T16:16:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5f5a50728c89942f4c223cc8856ae1f978549240'/>
<id>5f5a50728c89942f4c223cc8856ae1f978549240</id>
<content type='text'>
http://austingroupbugs.net/view.php?id=385#c713
(Resolved state) recommend this way for the current standard (called
"earlier" in the text)

"However, earlier versions of this standard did not require this, and the
same example had to be written as:

    // buf was obtained by malloc(buflen)
    ret = write(fd, buf, buflen);
    if (ret &lt; 0) {
        int save = errno;
        free(buf);
        errno = save;
        return ret;
    }
"

from feedback I have for previous commit it seems that many people prefer
to avoid mass code change needed for current standard compliance
and prefer to track unpublished standard instead, which requires now
that free() itself must save errno, not its usage code.

So, I back out "save errno across free()" part of previous commit,
and will fill PR for changing free() isntead.

2) Remove now unused serrno.

MFC after:      1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
http://austingroupbugs.net/view.php?id=385#c713
(Resolved state) recommend this way for the current standard (called
"earlier" in the text)

"However, earlier versions of this standard did not require this, and the
same example had to be written as:

    // buf was obtained by malloc(buflen)
    ret = write(fd, buf, buflen);
    if (ret &lt; 0) {
        int save = errno;
        free(buf);
        errno = save;
        return ret;
    }
"

from feedback I have for previous commit it seems that many people prefer
to avoid mass code change needed for current standard compliance
and prefer to track unpublished standard instead, which requires now
that free() itself must save errno, not its usage code.

So, I back out "save errno across free()" part of previous commit,
and will fill PR for changing free() isntead.

2) Remove now unused serrno.

MFC after:      1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>1) IEEE Std 1003.1-2008, "errno" section, is explicit that</title>
<updated>2012-06-04T21:34:49+00:00</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2012-06-04T21:34:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=96700463ec225e5f1d8bf058fd26f4160e4b7ed6'/>
<id>96700463ec225e5f1d8bf058fd26f4160e4b7ed6</id>
<content type='text'>
"The setting of errno after a successful call to a function is
unspecified unless the description of that function specifies that
errno shall not be modified."

However, free() in IEEE Std 1003.1-2008 does not mention its interaction
with errno, so MAY modify it after successful call
(it depends on particular free() implementation, OS-specific, etc.).

So, save errno across free() calls to make code portable and
POSIX-conformant.

2) Remove unused serrno assignment.

MFC after:      1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"The setting of errno after a successful call to a function is
unspecified unless the description of that function specifies that
errno shall not be modified."

However, free() in IEEE Std 1003.1-2008 does not mention its interaction
with errno, so MAY modify it after successful call
(it depends on particular free() implementation, OS-specific, etc.).

So, save errno across free() calls to make code portable and
POSIX-conformant.

2) Remove unused serrno assignment.

MFC after:      1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>According to SUSv4, realpath(3) must fail if</title>
<updated>2012-05-11T11:29:08+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-05-11T11:29:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fdbe55fccb1c5de177001aa691addb77fb297362'/>
<id>fdbe55fccb1c5de177001aa691addb77fb297362</id>
<content type='text'>
[ENOENT]  A component of file_name does not name an existing file or
    file_name points to an empty string.
[ENOTDIR] A component of the path prefix is not a directory, or the
    file_name argument contains at least one non- &lt;slash&gt; character
    and ends with one or more trailing &lt;slash&gt; characters and the last
    pathname component names an existing file that is neither a
    directory nor a symbolic link to a directory.
Add checks for the listed conditions, and set errno accordingly.

Update the realpath(3) manpage to mention SUS behaviour. Remove the
requirement to include sys/param.h before stdlib.h.

PR:	    128933
MFC after:  3 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ENOENT]  A component of file_name does not name an existing file or
    file_name points to an empty string.
[ENOTDIR] A component of the path prefix is not a directory, or the
    file_name argument contains at least one non- &lt;slash&gt; character
    and ends with one or more trailing &lt;slash&gt; characters and the last
    pathname component names an existing file that is neither a
    directory nor a symbolic link to a directory.
Add checks for the listed conditions, and set errno accordingly.

Update the realpath(3) manpage to mention SUS behaviour. Remove the
requirement to include sys/param.h before stdlib.h.

PR:	    128933
MFC after:  3 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a warning emitted by Clang.</title>
<updated>2011-11-04T19:56:34+00:00</updated>
<author>
<name>Ed Schouten</name>
<email>ed@FreeBSD.org</email>
</author>
<published>2011-11-04T19:56:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=24a92ae013c8f82a5a64566a1128f3da140a0e08'/>
<id>24a92ae013c8f82a5a64566a1128f3da140a0e08</id>
<content type='text'>
The size passed to strlcat() must depend on the input length, not the
output length. Because the input and output buffers are equal in size,
the resulting binary does not change at all.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The size passed to strlcat() must depend on the input length, not the
output length. Because the input and output buffers are equal in size,
the resulting binary does not change at all.
</pre>
</div>
</content>
</entry>
</feed>
