Page MenuHomeFreeBSD

stat(2): Send to sticky(7) in the S_ISVTX description
ClosedPublic

Authored by arrowd on Sat, Mar 21, 11:17 AM.
Tags
None
Referenced Files
F151070999: D56015.diff
Sun, Apr 5, 7:08 PM
Unknown Object (File)
Sun, Mar 29, 5:10 AM
Unknown Object (File)
Sat, Mar 28, 10:15 PM
Unknown Object (File)
Fri, Mar 27, 9:43 PM
Unknown Object (File)
Fri, Mar 27, 9:30 AM
Unknown Object (File)
Thu, Mar 26, 1:36 PM
Subscribers

Details

Summary

The current description feels unclear to me. It took me a while to find
the sticky(7) manpage, which explains how the sticky bit works on files and
directories. chmod(2) already refers sticky(7) and also gives a good
explanation on how S_ISVTX works.

This change allows for going to sticky(7) from the stat(2) manpage and
the header file.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The comment currently in place dates back to FreeBSD 1.0,
and I had assumed it was kept as a historical artifact.
However, the same wording was also present in the chmod(2) man page
in FreeBSD 1.0, and in FreeBSD 3.0 it was updated to match what
this patch proposes. The existing description referencing
"save swapped text even after use" is difficult to understand
without knowing the historical context, which is now largely obsolete.

Since this bit is part of the POSIX specification, I also checked
the documentation of other Unix distributions. In all of them,
the current behavior (restricting file deletion) is described,
rather than any reference to a text segment of an application.

I support this change, especially since it aligns with
the explanation already found in chmod(2).

This revision is now accepted and ready to land.Mon, Mar 30, 6:00 AM

Stat.2 should have a .Xr sticky 7 somewhere, like SEE ALSO?

In D56015#1284481, @imp wrote:

Stat.2 should have a .Xr sticky 7 somewhere, like SEE ALSO?

I thought the same thing, but it's on line 459 already.