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
F153080859: D56015.id174080.diff
Sun, Apr 19, 12:20 AM
Unknown Object (File)
Thu, Apr 16, 12:05 PM
Unknown Object (File)
Wed, Apr 15, 12:17 AM
Unknown Object (File)
Tue, Apr 14, 6:12 AM
Unknown Object (File)
Mon, Apr 13, 10:45 PM
Unknown Object (File)
Sat, Apr 11, 8:04 PM
Unknown Object (File)
Sat, Apr 11, 2:28 PM
Unknown Object (File)
Fri, Apr 10, 4:04 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 Passed
Unit
No Test Coverage
Build Status
Buildable 71623
Build 68506: arc lint + arc unit

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.