Re: Possible coding issue in udf??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alex Davis <alex14641@xxxxxxxxx> writes:

> In fs/udf/inode.c, line 1455, linux 2.6.35, there is the following code:
>
> 	udfperms = ((inode->i_mode & S_IRWXO)) |
> 		   ((inode->i_mode & S_IRWXG) << 2) |
> 		   ((inode->i_mode & S_IRWXU) << 4);
>
> Shouldn't we be shifting by 3 bits? i.e:
> 	udfperms = ((inode->i_mode & S_IRWXO)) |
> 		   ((inode->i_mode & S_IRWXG) << 3) |
> 		   ((inode->i_mode & S_IRWXU) << 6);

udfperms contains three bit fields of 5 bits each, of which 3 bits are
each filled from one of the three RWX parts of i_mode, and 2 bits
(DELETE and CHATTR) are added later.  Thus each of the three bit fields
are expanded from 3 to 5 bits, so that the second one needs to be
shifted by 2 and the third one by 4.

Andreas.

-- 
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux