Skip to contentSkip to conversation

mkfs.ubifs: Fix --squash-rino-perm / --nosquash-rino-perm

PATCH In review Kevin Cernekee 2 participants 2 messages Sep 23, 2010 – Sep 24, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.ubifs: Fix --squash-rino-perm / --nosquash-rino-perm

This addresses a couple of issues:

1) Code was only allowing these options if --root was NOT specified (the opposite of the documented usage)

2) -q / -Q short options did not work

3) Spacing fixes in the error/warning strings

---
 mkfs.ubifs/mkfs.ubifs.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
mkfs.ubifs/mkfs.ubifs.c +4 -4
index ec38f0e..d83f6bd 100644
@@ -132,7 +132,7 @@ static struct inum_mapping **hash_table;
 /* Inode creation sequence number */
 static unsigned long long creat_sqnum;
 
-static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:P:k:x:X:j:R:l:j:U";
+static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:P:k:x:X:j:R:l:j:UQq";
 
 static const struct option longopts[] = {
 	{"root",               1, NULL, 'r'},
@@ -698,8 +698,8 @@ static int get_options(int argc, char**argv)
 		return err_msg("Maximum count of LEBs was not specified "
 			       "(use -h for help)");
 
-	if (squash_rino_perm != -1 && root)
-		return err_msg("--squash-rino-perm and nosquash-rino-perm options"
+	if (squash_rino_perm != -1 && !root)
+		return err_msg("--squash-rino-perm and nosquash-rino-perm options "
 			       "can be used only with the --root option");
 
 	if (c->max_bud_bytes == -1) {
@@ -1673,7 +1673,7 @@ static int write_data(void)
 		if (squash_rino_perm == -1) {
 			printf("WARNING: setting root UBIFS inode UID=GID=0 (root) and permissions "
 				 "to u+rwx,go+rx; use --squash-rino-perm or --nosquash-rino-perm "
-				 "to suppress this warning");
+				 "to suppress this warning\n");
 			squash_rino_perm = 1;
 		}
 		if (squash_rino_perm) {
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 5 lines · Kevin Cernekee

This addresses a couple of issues:

1) Code was only allowing these options if --root was NOT specified (the opposite of the documented usage)

Quoted 8 lines

2) -q / -Q short options did not work

3) Spacing fixes in the error/warning strings

---
 mkfs.ubifs/mkfs.ubifs.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Oh, yeah, thanks, pushed!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)