diff options
author | Phillip Susi <psusi@cfl.rr.com> | 2006-03-25 06:08:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:23:00 -0500 |
commit | 0e6b3e5e97e2e8a25bcfc528dad94edf5220dfeb (patch) | |
tree | de537ca068cd7fc2a1d20a47f16c9091cf4c64ff /fs/udf/inode.c | |
parent | 11b0b5abb2097a63c1081d9b7e825b987b227972 (diff) |
[PATCH] udf: fix uid/gid options and add uid/gid=ignore and forget options
As Pekka Enberg pointed out, with the if still following the else, you can
still get a null uid written to the disk if you specify a default uid= without
uid=forget. In other words, if the desktop user is uid=1000 and the mount
option uid=1000 is given ( which is done on ubuntu automatically and probably
other distributions that use hal ), then if any other user besides uid 1000
owns a file then a 0 will be written to the media as the owning uid instead.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index d04cff2273b6..81e0e8459af1 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1341,13 +1341,11 @@ udf_update_inode(struct inode *inode, int do_sync) | |||
1341 | 1341 | ||
1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) | 1342 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET)) |
1343 | fe->uid = cpu_to_le32(-1); | 1343 | fe->uid = cpu_to_le32(-1); |
1344 | else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid) | 1344 | else fe->uid = cpu_to_le32(inode->i_uid); |
1345 | fe->uid = cpu_to_le32(inode->i_uid); | ||
1346 | 1345 | ||
1347 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) | 1346 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET)) |
1348 | fe->gid = cpu_to_le32(-1); | 1347 | fe->gid = cpu_to_le32(-1); |
1349 | else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid) | 1348 | else fe->gid = cpu_to_le32(inode->i_gid); |
1350 | fe->gid = cpu_to_le32(inode->i_gid); | ||
1351 | 1349 | ||
1352 | udfperms = ((inode->i_mode & S_IRWXO) ) | | 1350 | udfperms = ((inode->i_mode & S_IRWXO) ) | |
1353 | ((inode->i_mode & S_IRWXG) << 2) | | 1351 | ((inode->i_mode & S_IRWXG) << 2) | |