We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4015bd commit 48fb1bbCopy full SHA for 48fb1bb
std/src/os/unix/fs.rs
@@ -986,6 +986,10 @@ impl DirBuilderExt for fs::DirBuilder {
986
/// Changing the owner typically requires privileges, such as root or a specific capability.
987
/// Changing the group typically requires either being the owner and a member of the group, or
988
/// having privileges.
989
+///
990
+/// Be aware that changing owner clears the `suid` and `sgid` permission bits in most cases
991
+/// according to POSIX, usually even if the user is root. The sgid is not cleared when
992
+/// the file is non-group-executable.
993
///
994
/// If called on a symbolic link, this will change the owner and group of the link target. To
995
/// change the owner and group of the link itself, see [`lchown`].
0 commit comments