From 51a44cae5fb563fee0e1cc9a96b26c845cd4121c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 5 Feb 2000 11:59:54 +0000 Subject: 2000-02-05 Roland McGrath * ext2_fs.h: Update from Linux 2.3.42 version (ext2_fs_i.h unchanged). * inode.c (check_high_bits): In accordance with Linux 2.3.42 behavior, permit 32-bit uids on non-hurd filesystems unless i_dtime is zero (which indicates an extra old Linux ext2 implementation I guess). --- ext2fs/inode.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ext2fs/inode.c') diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 6be299fd..b3f07df4 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -335,8 +335,17 @@ check_high_bits (struct node *np, long l) { if (sblock->s_creator_os == EXT2_OS_HURD) return 0; - else - return ((l & ~0xFFFF) == 0) ? 0 : EINVAL; + + /* Linux 2.3.42 has a mount-time option (not a bit stored on disk) + NO_UID32 to ignore the high 16 bits of uid and gid, but by default + allows them. It also does this check for "interoperability with old + kernels". Note that our check refuses to change the values, while + Linux 2.3.42 just silently clears the high bits in an inode it updates, + even if it was updating it for an unrelated reason. */ + if (np->dn->info.i_dtime != 0) + return 0; + + return ((l & ~0xFFFF) == 0) ? 0 : EINVAL; } /* Return 0 if NP's owner can be changed to UID; otherwise return an error -- cgit v1.2.3