aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorPhillip Susi <psusi@cfl.rr.com>2006-03-08 00:55:24 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-08 17:14:00 -0500
commit4d6660eb3665f22d16aff466eb9d45df6102b254 (patch)
treed70e689d8c23c92164f601fa6f8589ed7a5e394b /fs/udf/super.c
parent7f709ed0e3ccd3e88e0632b69f00174e83f8d98b (diff)
[PATCH] udf: fix uid/gid options and add uid/gid=ignore and forget options
Fix a bug in udf where it would write uid/gid = 0 to the disk for files owned by the id given with the uid=/gid= mount options. It also adds 4 new mount options: uid/gid=forget and uid/gid=ignore. Without any options the id in core and on disk always match. Giving uid/gid=nnn specifies a default ID to be used in core when the on disk ID is -1. uid/gid=ignore forces the in core ID to allways be used no matter what the on disk ID is. uid/gid=forget forces the on disk ID to always be written out as -1. The use of these options allows you to override ownerships on a disk or disable ownwership information from being written, allowing the media to be used portably between different computers and possibly different users without permissions issues that would require root to correct. Signed-off-by: Phillip Susi <psusi@cfl.rr.com> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 4a6f49adc609..368d8f81fe54 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -269,7 +269,7 @@ enum {
269 Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock, 269 Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock,
270 Opt_anchor, Opt_volume, Opt_partition, Opt_fileset, 270 Opt_anchor, Opt_volume, Opt_partition, Opt_fileset,
271 Opt_rootdir, Opt_utf8, Opt_iocharset, 271 Opt_rootdir, Opt_utf8, Opt_iocharset,
272 Opt_err 272 Opt_err, Opt_uforget, Opt_uignore, Opt_gforget, Opt_gignore
273}; 273};
274 274
275static match_table_t tokens = { 275static match_table_t tokens = {
@@ -282,6 +282,10 @@ static match_table_t tokens = {
282 {Opt_adinicb, "adinicb"}, 282 {Opt_adinicb, "adinicb"},
283 {Opt_shortad, "shortad"}, 283 {Opt_shortad, "shortad"},
284 {Opt_longad, "longad"}, 284 {Opt_longad, "longad"},
285 {Opt_uforget, "uid=forget"},
286 {Opt_uignore, "uid=ignore"},
287 {Opt_gforget, "gid=forget"},
288 {Opt_gignore, "gid=ignore"},
285 {Opt_gid, "gid=%u"}, 289 {Opt_gid, "gid=%u"},
286 {Opt_uid, "uid=%u"}, 290 {Opt_uid, "uid=%u"},
287 {Opt_umask, "umask=%o"}, 291 {Opt_umask, "umask=%o"},
@@ -414,6 +418,18 @@ udf_parse_options(char *options, struct udf_options *uopt)
414 uopt->flags |= (1 << UDF_FLAG_NLS_MAP); 418 uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
415 break; 419 break;
416#endif 420#endif
421 case Opt_uignore:
422 uopt->flags |= (1 << UDF_FLAG_UID_IGNORE);
423 break;
424 case Opt_uforget:
425 uopt->flags |= (1 << UDF_FLAG_UID_FORGET);
426 break;
427 case Opt_gignore:
428 uopt->flags |= (1 << UDF_FLAG_GID_IGNORE);
429 break;
430 case Opt_gforget:
431 uopt->flags |= (1 << UDF_FLAG_GID_FORGET);
432 break;
417 default: 433 default:
418 printk(KERN_ERR "udf: bad mount option \"%s\" " 434 printk(KERN_ERR "udf: bad mount option \"%s\" "
419 "or missing value\n", p); 435 "or missing value\n", p);