Displaying 2 results from an estimated 2 matches for "check_sticky".
1999 Jan 30
0
Re: Capabilities and the sticky-bit...
...ting around the
sticky bit... (This is what you observe happenning when, as 'root', you
fail to delete the file in your home directory.)
The reason root is still able to delete the /tmp/ file and not the
/home/wini/ file is because root owns the /tmp/ directory. Take a look
at the function check_sticky() in linux/fs/namei.c. You'll see that
there is a check to see if the owner of the directory is the user trying
to do the deed. If so, the sys_unlink() succeeds.
For the security paranoid: all system files/directories should be owned
by some user with no login account: 'adm' or 'sy...
2010 Oct 25
2
[PATCH] Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed
...btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 906e3b3..919b23f 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -409,6 +409,76 @@ fail:
return ret;
}
+/* copy of check_sticky in fs/namei.c()
+* It''s inline, so penalty for filesystems that don''t use sticky bit is
+* minimal.
+*/
+static inline int btrfs_check_sticky(struct inode *dir, struct inode *inode)
+{
+ uid_t fsuid = current_fsuid();
+
+ if (!(dir->i_mode & S_ISVTX))
+ return 0;
+ if (in...