aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e2fsck/badblocks.c8
-rw-r--r--e2fsck/journal.c2
-rw-r--r--e2fsck/pass1b.c2
-rw-r--r--e2fsck/unix.c103
-rw-r--r--e2fsck/util.c8
-rw-r--r--lib/blkid/getsize.c4
-rw-r--r--misc/badblocks.c65
-rw-r--r--misc/chattr.c5
-rw-r--r--misc/dumpe2fs.c32
-rw-r--r--misc/e2image.c24
-rw-r--r--misc/e2undo.c10
-rw-r--r--misc/mke2fs.c169
-rw-r--r--misc/mklost+found.c2
-rw-r--r--misc/tune2fs.c41
-rw-r--r--misc/uuidd.c2
-rw-r--r--resize/main.c20
-rw-r--r--resize/resize2fs.c2
17 files changed, 266 insertions, 233 deletions
diff --git a/e2fsck/badblocks.c b/e2fsck/badblocks.c
index 71b1c56e..8519df0d 100644
--- a/e2fsck/badblocks.c
+++ b/e2fsck/badblocks.c
@@ -42,7 +42,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
check_bb_inode_blocks, 0);
if (retval) {
- com_err("ext2fs_block_iterate", retval,
+ com_err("ext2fs_block_iterate", retval, "%s",
_("while sanity checking the bad blocks inode"));
goto fatal;
}
@@ -54,7 +54,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
if (!replace_bad_blocks) {
retval = ext2fs_read_bb_inode(fs, &bb_list);
if (retval) {
- com_err("ext2fs_read_bb_inode", retval,
+ com_err("ext2fs_read_bb_inode", retval, "%s",
_("while reading the bad blocks inode"));
goto fatal;
}
@@ -90,7 +90,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
else
pclose(f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while reading in list of bad blocks from file"));
goto fatal;
}
@@ -101,7 +101,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
printf("%s: Updating bad block inode.\n", ctx->device_name);
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
- com_err("ext2fs_update_bb_inode", retval,
+ com_err("ext2fs_update_bb_inode", retval, "%s",
_("while updating bad block inode"));
goto fatal;
}
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 6483481f..11ccec58 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -521,7 +521,7 @@ static errcode_t e2fsck_journal_load(journal_t *journal)
ll_rw_block(READ, 1, &jbh);
if (jbh->b_err) {
- com_err(ctx->device_name, jbh->b_err,
+ com_err(ctx->device_name, jbh->b_err, "%s",
_("reading journal superblock\n"));
return jbh->b_err;
}
diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c
index a3b880cf..13bd9e98 100644
--- a/e2fsck/pass1b.c
+++ b/e2fsck/pass1b.c
@@ -817,7 +817,7 @@ static errcode_t clone_file(e2fsck_t ctx, ext2_ino_t ino,
goto errout;
}
if (cs.errcode) {
- com_err("clone_file", cs.errcode,
+ com_err("clone_file", cs.errcode, "%s",
_("returned from clone_file_block"));
retval = cs.errcode;
goto errout;
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 6c4e26de..10f0628f 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -77,13 +77,13 @@ static void usage(e2fsck_t ctx)
"\t\t[-E extended-options] device\n"),
ctx->program_name);
- fprintf(stderr, _("\nEmergency help:\n"
+ fprintf(stderr, "%s", _("\nEmergency help:\n"
" -p Automatic repair (no questions)\n"
" -n Make no changes to the filesystem\n"
" -y Assume \"yes\" to all questions\n"
" -c Check for bad blocks and add them to the badblock list\n"
" -f Force checking even if filesystem is marked clean\n"));
- fprintf(stderr, _(""
+ fprintf(stderr, "%s", _(""
" -v Be verbose\n"
" -b superblock Use alternative superblock\n"
" -B blocksize Force blocksize when looking for superblock\n"
@@ -176,7 +176,7 @@ static void show_stats(e2fsck_t ctx)
if (ctx->extent_depth_count[j])
break;
if (++j) {
- log_out(ctx, _(" Extent depth histogram: "));
+ log_out(ctx, "%s", _(" Extent depth histogram: "));
for (i=0; i < j; i++) {
if (i)
fputc('/', stdout);
@@ -261,14 +261,14 @@ static void check_mount(e2fsck_t ctx)
if (!ctx->interactive || ctx->mount_flags & EXT2_MF_BUSY)
fatal_error(ctx, _("Cannot continue, aborting.\n\n"));
puts("\007\007\007\007");
- log_out(ctx, _("\n\nWARNING!!! "
+ log_out(ctx, "%s", _("\n\nWARNING!!! "
"The filesystem is mounted. "
"If you continue you ***WILL***\n"
"cause ***SEVERE*** filesystem damage.\n\n"));
puts("\007\007\007");
cont = ask_yn(ctx, _("Do you really want to continue"), 0);
if (!cont) {
- printf (_("check aborted.\n"));
+ printf("%s", _("check aborted.\n"));
exit (0);
}
return;
@@ -388,7 +388,7 @@ static void check_if_skip(e2fsck_t ctx)
if (reason) {
log_out(ctx, "%s", ctx->device_name);
log_out(ctx, reason, reason_arg);
- log_out(ctx, _(", check forced.\n"));
+ log_out(ctx, "%s", _(", check forced.\n"));
return;
}
@@ -440,12 +440,14 @@ static void check_if_skip(e2fsck_t ctx)
if (next_check <= 5) {
if (next_check == 1) {
if (batt)
- log_out(ctx, _(" (check deferred; "
- "on battery)"));
+ log_out(ctx, "%s",
+ _(" (check deferred; on battery)"));
else
- log_out(ctx, _(" (check after next mount)"));
+ log_out(ctx, "%s",
+ _(" (check after next mount)"));
} else
- log_out(ctx, _(" (check in %ld mounts)"), next_check);
+ log_out(ctx, _(" (check in %ld mounts)"),
+ next_check);
}
log_out(ctx, "\n");
skip:
@@ -663,7 +665,7 @@ static void parse_extended_opts(e2fsck_t ctx, const char *opts)
ea_ver = strtoul(arg, &p, 0);
if (*p ||
((ea_ver != 1) && (ea_ver != 2))) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Invalid EA version.\n"));
extended_usage++;
continue;
@@ -908,17 +910,17 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
usage(ctx);
if ((ctx->options & E2F_OPT_NO) &&
(ctx->options & E2F_OPT_COMPRESS_DIRS)) {
- com_err(ctx->program_name, 0,
+ com_err(ctx->program_name, 0, "%s",
_("The -n and -D options are incompatible."));
fatal_error(ctx, 0);
}
if ((ctx->options & E2F_OPT_NO) && cflag) {
- com_err(ctx->program_name, 0,
+ com_err(ctx->program_name, 0, "%s",
_("The -n and -c options are incompatible."));
fatal_error(ctx, 0);
}
if ((ctx->options & E2F_OPT_NO) && bad_blocks_file) {
- com_err(ctx->program_name, 0,
+ com_err(ctx->program_name, 0, "%s",
_("The -n and -l/-L options are incompatible."));
fatal_error(ctx, 0);
}
@@ -973,8 +975,8 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
close(fd);
}
if (cflag && bad_blocks_file) {
- fprintf(stderr, _("The -c and the -l/-L options may "
- "not be both used at the same time.\n"));
+ fprintf(stderr, "%s", _("The -c and the -l/-L options may not "
+ "be both used at the same time.\n"));
exit(FSCK_USAGE);
}
#ifdef HAVE_SIGNAL_H
@@ -1135,12 +1137,12 @@ check_error:
retval = 0;
}
} else if (retval == EXT2_ET_MMP_FAILED) {
- com_err(ctx->program_name, retval,
+ com_err(ctx->program_name, retval, "%s",
_("while checking MMP block"));
dump_mmp_msg(fs->mmp_buf, NULL);
} else if (retval == EXT2_ET_MMP_FSCK_ON ||
retval == EXT2_ET_MMP_UNKNOWN_SEQ) {
- com_err(ctx->program_name, retval,
+ com_err(ctx->program_name, retval, "%s",
_("while checking MMP block"));
dump_mmp_msg(fs->mmp_buf,
_("If you are sure the filesystem is not "
@@ -1193,14 +1195,14 @@ int main (int argc, char *argv[])
my_ver = ext2fs_parse_version_string(my_ver_string);
lib_ver = ext2fs_get_library_version(0, &lib_ver_date);
if (my_ver > lib_ver) {
- fprintf( stderr, _("Error: ext2fs library version "
- "out of date!\n"));
+ fprintf( stderr, "%s",
+ _("Error: ext2fs library version out of date!\n"));
show_version_only++;
}
retval = PRS(argc, argv, &ctx);
if (retval) {
- com_err("e2fsck", retval,
+ com_err("e2fsck", retval, "%s",
_("while trying to initialize program"));
exit(FSCK_ERROR);
}
@@ -1334,32 +1336,34 @@ failure:
com_err(ctx->program_name, retval, _("while trying to open %s"),
ctx->filesystem_name);
if (retval == EXT2_ET_REV_TOO_HIGH) {
- log_out(ctx, _("The filesystem revision is apparently "
- "too high for this version of e2fsck.\n"
- "(Or the filesystem superblock "
- "is corrupt)\n\n"));
+ log_out(ctx, "%s",
+ _("The filesystem revision is apparently "
+ "too high for this version of e2fsck.\n"
+ "(Or the filesystem superblock "
+ "is corrupt)\n\n"));
fix_problem(ctx, PR_0_SB_CORRUPT, &pctx);
} else if (retval == EXT2_ET_SHORT_READ)
- log_out(ctx, _("Could this be a zero-length "
- "partition?\n"));
+ log_out(ctx, "%s",
+ _("Could this be a zero-length partition?\n"));
else if ((retval == EPERM) || (retval == EACCES))
log_out(ctx, _("You must have %s access to the "
- "filesystem or be root\n"),
+ "filesystem or be root\n"),
(ctx->options & E2F_OPT_READONLY) ?
"r/o" : "r/w");
else if (retval == ENXIO)
- log_out(ctx, _("Possibly non-existent or "
- "swap device?\n"));
+ log_out(ctx, "%s",
+ _("Possibly non-existent or swap device?\n"));
else if (retval == EBUSY)
- log_out(ctx, _("Filesystem mounted or opened "
- "exclusively by another program?\n"));
+ log_out(ctx, "%s", _("Filesystem mounted or opened "
+ "exclusively by another program?\n"));
else if (retval == ENOENT)
- log_out(ctx, _("Possibly non-existent device?\n"));
+ log_out(ctx, "%s",
+ _("Possibly non-existent device?\n"));
#ifdef EROFS
else if (retval == EROFS)
- log_out(ctx, _("Disk write-protected; use the -n "
- "option to do a read-only\n"
- "check of the device.\n"));
+ log_out(ctx, "%s", _("Disk write-protected; use the "
+ "-n option to do a read-only\n"
+ "check of the device.\n"));
#endif
else
fix_problem(ctx, PR_0_SB_CORRUPT, &pctx);
@@ -1477,9 +1481,9 @@ failure:
*/
if (sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER) {
if (ctx->options & E2F_OPT_READONLY) {
- log_out(ctx, _("Warning: skipping journal recovery "
- "because doing a read-only filesystem "
- "check.\n"));
+ log_out(ctx, "%s",
+ _("Warning: skipping journal recovery because "
+ "doing a read-only filesystem check.\n"));
io_channel_flush(ctx->fs->io);
} else {
if (ctx->flags & E2F_FLAG_RESTARTED) {
@@ -1490,7 +1494,8 @@ failure:
* device driver is being bogus.
*/
com_err(ctx->program_name, 0,
- _("unable to set superblock flags on %s\n"), ctx->device_name);
+ _("unable to set superblock flags "
+ "on %s\n"), ctx->device_name);
fatal_error(ctx, 0);
}
retval = e2fsck_run_ext3_journal(ctx);
@@ -1596,8 +1601,8 @@ print_unsupp_features:
log_out(ctx, _("%s: %s while reading bad blocks inode\n"),
ctx->program_name, error_message(retval));
preenhalt(ctx);
- log_out(ctx, _("This doesn't bode well, "
- "but we'll try to go on...\n"));
+ log_out(ctx, "%s", _("This doesn't bode well, "
+ "but we'll try to go on...\n"));
}
/*
@@ -1647,9 +1652,10 @@ print_unsupp_features:
"journal\n", error_message(retval));
goto no_journal;
}
- log_out(ctx, _(" Done.\n"));
- log_out(ctx, _("\n*** journal has been re-created - "
- "filesystem is now ext3 again ***\n"));
+ log_out(ctx, "%s", _(" Done.\n"));
+ log_out(ctx, "%s",
+ _("\n*** journal has been re-created - "
+ "filesystem is now ext3 again ***\n"));
}
}
no_journal:
@@ -1671,10 +1677,11 @@ no_journal:
}
if (run_result == E2F_FLAG_RESTART) {
- log_out(ctx, _("Restarting e2fsck from the beginning...\n"));
+ log_out(ctx, "%s",
+ _("Restarting e2fsck from the beginning...\n"));
retval = e2fsck_reset_context(ctx);
if (retval) {
- com_err(ctx->program_name, retval,
+ com_err(ctx->program_name, retval, "%s",
_("while resetting context"));
fatal_error(ctx, 0);
}
@@ -1750,7 +1757,7 @@ no_journal:
!(ctx->options & E2F_OPT_READONLY)) {
retval = ext2fs_set_gdt_csum(ctx->fs);
if (retval) {
- com_err(ctx->program_name, retval,
+ com_err(ctx->program_name, retval, "%s",
_("while setting block group checksum info"));
fatal_error(ctx, 0);
}
diff --git a/e2fsck/util.c b/e2fsck/util.c
index c9e2ca16..eb3e0f45 100644
--- a/e2fsck/util.c
+++ b/e2fsck/util.c
@@ -220,7 +220,7 @@ int ask_yn(e2fsck_t ctx, const char * string, int def)
log_out(ctx, "\n");
longjmp(e2fsck_global_ctx->abort_loc, 1);
}
- log_out(ctx, _("cancelled!\n"));
+ log_out(ctx, "%s", _("cancelled!\n"));
return 0;
}
if (strchr(short_yes, (char) c)) {
@@ -235,9 +235,9 @@ int ask_yn(e2fsck_t ctx, const char * string, int def)
break;
}
if (def)
- log_out(ctx, _("yes\n"));
+ log_out(ctx, "%s", _("yes\n"));
else
- log_out(ctx, _("no\n"));
+ log_out(ctx, "%s", _("no\n"));
#ifdef HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &termios);
#endif
@@ -633,7 +633,7 @@ errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num,
if (!buf) {
buf = malloc(fs->blocksize * STRIDE_LENGTH);
if (!buf) {
- com_err("malloc", ENOMEM,
+ com_err("malloc", ENOMEM, "%s",
_("while allocating zeroizing buffer"));
exit(1);
}
diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c
index f9be9622..c2a8f72a 100644
--- a/lib/blkid/getsize.c
+++ b/lib/blkid/getsize.c
@@ -206,8 +206,8 @@ int main(int argc, char **argv)
perror(argv[0]);
bytes = blkid_get_dev_size(fd);
- printf("Device %s has %Ld 1k blocks.\n", argv[1],
- (unsigned long long) bytes >> 10);
+ printf("Device %s has %lld 1k blocks.\n", argv[1],
+ (unsigned long long)bytes >> 10);
return 0;
}
diff --git a/misc/badblocks.c b/misc/badblocks.c
index 432c17b1..89f24398 100644
--- a/misc/badblocks.c
+++ b/misc/badblocks.c
@@ -369,7 +369,7 @@ static int do_read (int dev, unsigned char * buffer, int try, int block_size,
/* Seek to the correct loc. */
if (ext2fs_llseek (dev, (ext2_loff_t) current_block * block_size,
SEEK_SET) != (ext2_loff_t) current_block * block_size)
- com_err (program_name, errno, _("during seek"));
+ com_err (program_name, errno, "%s", _("during seek"));
/* Try the read */
if (d_flag)
@@ -442,7 +442,7 @@ static int do_write(int dev, unsigned char * buffer, int try, int block_size,
/* Seek to the correct loc. */
if (ext2fs_llseek (dev, (ext2_loff_t) current_block * block_size,
SEEK_SET) != (ext2_loff_t) current_block * block_size)
- com_err (program_name, errno, _("during seek"));
+ com_err (program_name, errno, "%s", _("during seek"));
/* Try the write */
got = write (dev, buffer, try * block_size);
@@ -466,7 +466,8 @@ static void flush_bufs(void)
#endif
retval = ext2fs_sync_device(host_dev, 1);
if (retval)
- com_err(program_name, retval, _("during ext2fs_sync_device"));
+ com_err(program_name, retval, "%s",
+ _("during ext2fs_sync_device"));
}
static unsigned int test_ro (int dev, blk_t last_block,
@@ -485,8 +486,8 @@ static unsigned int test_ro (int dev, blk_t last_block,
errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter);
if (errcode) {
- com_err (program_name, errcode,
- _("while beginning bad block list iteration"));
+ com_err(program_name, errcode, "%s",
+ _("while beginning bad block list iteration"));
exit (1);
}
do {
@@ -500,13 +501,14 @@ static unsigned int test_ro (int dev, blk_t last_block,
}
if (!blkbuf)
{
- com_err (program_name, ENOMEM, _("while allocating buffers"));
+ com_err(program_name, ENOMEM, "%s",
+ _("while allocating buffers"));
exit (1);
}
if (v_flag) {
- fprintf (stderr, _("Checking blocks %lu to %lu\n"),
- (unsigned long) first_block,
- (unsigned long) last_block - 1);
+ fprintf(stderr, _("Checking blocks %lu to %lu\n"),
+ (unsigned long)first_block,
+ (unsigned long)last_block - 1);
}
if (t_flag) {
fputs(_("Checking for bad blocks in read-only mode\n"), stderr);
@@ -599,7 +601,8 @@ static unsigned int test_rw (int dev, blk_t last_block,
read_buffer = buffer + blocks_at_once * block_size;
if (!buffer) {
- com_err (program_name, ENOMEM, _("while allocating buffers"));
+ com_err(program_name, ENOMEM, "%s",
+ _("while allocating buffers"));
exit (1);
}
@@ -745,8 +748,8 @@ static unsigned int test_nd (int dev, blk_t last_block,
bb_count = 0;
errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter);
if (errcode) {
- com_err (program_name, errcode,
- _("while beginning bad block list iteration"));
+ com_err(program_name, errcode, "%s",
+ _("while beginning bad block list iteration"));
exit (1);
}
do {
@@ -754,9 +757,10 @@ static unsigned int test_nd (int dev, blk_t last_block,
} while (next_bad && next_bad < first_block);
blkbuf = allocate_buffer(3 * blocks_at_once * block_size);
- test_record = malloc (blocks_at_once*sizeof(struct saved_blk_record));
+ test_record = malloc(blocks_at_once * sizeof(struct saved_blk_record));
if (!blkbuf || !test_record) {
- com_err(program_name, ENOMEM, _("while allocating buffers"));
+ com_err(program_name, ENOMEM, "%s",
+ _("while allocating buffers"));
exit (1);
}
@@ -1160,15 +1164,15 @@ int main (int argc, char ** argv)
}
if (!w_flag) {
if (t_flag > 1) {
- com_err(program_name, 0,
- _("Maximum of one test_pattern may be specified "
- "in read-only mode"));
+ com_err(program_name, 0, "%s",
+ _("Maximum of one test_pattern may be "
+ "specified in read-only mode"));
exit(1);
}
if (t_patts && (t_patts[0] == (unsigned int) ~0)) {
- com_err(program_name, 0,
- _("Random test_pattern is not allowed "
- "in read-only mode"));
+ com_err(program_name, 0, "%s",
+ _("Random test_pattern is not allowed "
+ "in read-only mode"));
exit(1);
}
}
@@ -1180,13 +1184,13 @@ int main (int argc, char ** argv)
block_size,
&last_block);
if (errcode == EXT2_ET_UNIMPLEMENTED) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Couldn't determine device size; you "
"must specify\nthe size manually\n"));
exit(1);
}
if (errcode) {
- com_err(program_name, errcode,
+ com_err(program_name, errcode, "%s",
_("while trying to determine device size"));
exit(1);
}
@@ -1263,8 +1267,8 @@ int main (int argc, char ** argv)
errcode = ext2fs_badblocks_list_create(&bb_list,0);
if (errcode) {
- com_err (program_name, errcode,
- _("while creating in-memory bad blocks list"));
+ com_err(program_name, errcode, "%s",
+ _("while creating in-memory bad blocks list"));
exit (1);
}
@@ -1272,21 +1276,26 @@ int main (int argc, char ** argv)
for(;;) {
switch (fscanf(in, "%llu\n", &inblk)) {
case 0:
- com_err (program_name, 0, "input file - bad format");
+ com_err(program_name, 0, "%s",
+ _("input file - bad format"));
exit (1);
case EOF:
break;
default:
if (inblk >> 32) {
com_err(program_name,
- EOVERFLOW,
- _("while adding to in-memory bad block list"));
+ EOVERFLOW, "%s",
+ _("while adding to in-memory "
+ "bad block list"));
exit(1);
}
next_bad = inblk;
errcode = ext2fs_badblocks_list_add(bb_list,next_bad);
if (errcode) {
- com_err (program_name, errcode, _("while adding to in-memory bad block list"));
+ com_err(program_name, errcode,
+ "%s",
+ _("while adding to in-memory "
+ "bad block list"));
exit (1);
}
continue;
diff --git a/misc/chattr.c b/misc/chattr.c
index 6bb33e68..39a60169 100644
--- a/misc/chattr.c
+++ b/misc/chattr.c
@@ -263,8 +263,9 @@ static int chattr_dir_proc (const char * dir_name, struct dirent * de,
path = malloc(strlen (dir_name) + 1 + strlen (de->d_name) + 1);
if (!path) {
- fprintf(stderr, _("Couldn't allocate path variable "
- "in chattr_dir_proc"));
+ fprintf(stderr, "%s",
+ _("Couldn't allocate path variable "
+ "in chattr_dir_proc"));
return -1;
}
sprintf(path, "%s/%s", dir_name, de->d_name);
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c
index d0ea6c34..b4b313a5 100644
--- a/misc/dumpe2fs.c
+++ b/misc/dumpe2fs.c
@@ -215,18 +215,18 @@ static void list_desc (ext2_filsys fs)
print_number(super_blk);
}
if (old_desc_blk) {
- printf(_(", Group descriptors at "));
+ printf("%s", _(", Group descriptors at "));
print_range(old_desc_blk,
old_desc_blk + old_desc_blocks - 1);
if (reserved_gdt) {
- printf(_("\n Reserved GDT blocks at "));
+ printf("%s", _("\n Reserved GDT blocks at "));
print_range(old_desc_blk + old_desc_blocks,
old_desc_blk + old_desc_blocks +
reserved_gdt - 1);
}
} else if (new_desc_blk) {
fputc(has_super ? ',' : ' ', stdout);
- printf(_(" Group descriptor at "));
+ printf("%s", _(" Group descriptor at "));
print_number(new_desc_blk);
has_super++;
}
@@ -307,7 +307,7 @@ static void list_bad_blocks(ext2_filsys fs, int dump)
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("ext2fs_badblocks_list_iterate_begin", retval,
- _("while printing bad block list"));
+ "%s", _("while printing bad block list"));
return;
}
if (dump) {
@@ -339,30 +339,30 @@ static void print_inline_journal_information(ext2_filsys fs)
retval = ext2fs_read_inode(fs, ino, &inode);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while reading journal inode"));
exit(1);
}
retval = ext2fs_file_open2(fs, ino, &inode, 0, &journal_file);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while opening journal inode"));
exit(1);
}
retval = ext2fs_file_read(journal_file, buf, sizeof(buf), 0);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while reading journal super block"));
exit(1);
}
ext2fs_file_close(journal_file);
jsb = (journal_superblock_t *) buf;
if (be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) {
- fprintf(stderr,
- "Journal superblock magic number invalid!\n");
+ fprintf(stderr, "%s",
+ _("Journal superblock magic number invalid!\n"));
exit(1);
}
- printf(_("Journal features: "));
+ printf("%s", _("Journal features: "));
for (i=0, mask_ptr=&jsb->s_feature_compat; i <3; i++,mask_ptr++) {
mask = be32_to_cpu(*mask_ptr);
for (j=0,m=1; j < 32; j++, m<<=1) {
@@ -406,8 +406,10 @@ static void print_journal_information(ext2_filsys fs)
journal_superblock_t *jsb;
/* Get the journal superblock */
- if ((retval = io_channel_read_blk64(fs->io, fs->super->s_first_data_block+1, -1024, buf))) {
- com_err(program_name, retval,
+ if ((retval = io_channel_read_blk64(fs->io,
+ fs->super->s_first_data_block + 1,
+ -1024, buf))) {
+ com_err(program_name, retval, "%s",
_("while reading journal superblock"));
exit(1);
}
@@ -415,7 +417,7 @@ static void print_journal_information(ext2_filsys fs)
if ((jsb->s_header.h_magic != (unsigned) ntohl(JFS_MAGIC_NUMBER)) ||
(jsb->s_header.h_blocktype !=
(unsigned) ntohl(JFS_SUPERBLOCK_V2))) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Couldn't find journal superblock magic numbers"));
exit(1);
}
@@ -448,7 +450,7 @@ static void parse_extended_opts(const char *opts, blk64_t *superblock,
len = strlen(opts);
buf = malloc(len+1);
if (!buf) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Couldn't allocate memory to parse options!\n"));
exit(1);
}
@@ -597,7 +599,7 @@ int main (int argc, char ** argv)
if (retval) {
com_err (program_name, retval, _("while trying to open %s"),
device_name);
- printf (_("Couldn't find valid filesystem superblock.\n"));
+ printf("%s", _("Couldn't find valid filesystem superblock.\n"));
exit (1);
}
fs->default_bitmap_type = EXT2FS_BMAP64_RBTREE;
diff --git a/misc/e2image.c b/misc/e2image.c
index 696359ff..257cbcda 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -135,8 +135,8 @@ static void write_header(int fd, void *hdr, int hdr_size, int wrt_size)
/* Sanity check */
if (hdr_size > wrt_size) {
- fprintf(stderr, _("Error: header size is bigger than "
- "wrt_size\n"));
+ fprintf(stderr, "%s",
+ _("Error: header size is bigger than wrt_size\n"));
}
ret = ext2fs_get_mem(wrt_size, &header_buf);
@@ -171,7 +171,8 @@ static void write_image_file(ext2_filsys fs, int fd)
hdr.offset_super = ext2fs_llseek(fd, 0, SEEK_CUR);
retval = ext2fs_image_super_write(fs, fd, 0);
if (retval) {
- com_err(program_name, retval, _("while writing superblock"));
+ com_err(program_name, retval, "%s",
+ _("while writing superblock"));
exit(1);
}
@@ -179,21 +180,24 @@ static void write_image_file(ext2_filsys fs, int fd)
retval = ext2fs_image_inode_write(fs, fd,
(fd != 1) ? IMAGER_FLAG_SPARSEWRITE : 0);
if (retval) {
- com_err(program_name, retval, _("while writing inode table"));
+ com_err(program_name, retval, "%s",
+ _("while writing inode table"));
exit(1);
}
hdr.offset_blockmap = ext2fs_llseek(fd, 0, SEEK_CUR);
retval = ext2fs_image_bitmap_write(fs, fd, 0);
if (retval) {
- com_err(program_name, retval, _("while writing block bitmap"));
+ com_err(program_name, retval, "%s",
+ _("while writing block bitmap"));
exit(1);
}
hdr.offset_inodemap = ext2fs_llseek(fd, 0, SEEK_CUR);
retval = ext2fs_image_bitmap_write(fs, fd, IMAGER_FLAG_INODEMAP);
if (retval) {
- com_err(program_name, retval, _("while writing inode bitmap"));
+ com_err(program_name, retval, "%s",
+ _("while writing inode bitmap"));
exit(1);
}
@@ -1088,13 +1092,15 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags)
retval = ext2fs_open_inode_scan(fs, 0, &scan);
if (retval) {
- com_err(program_name, retval, _("while opening inode scan"));
+ com_err(program_name, retval,"%s",
+ _("while opening inode scan"));
exit(1);
}
retval = ext2fs_get_mem(fs->blocksize * 3, &block_buf);
if (retval) {
- com_err(program_name, 0, "Can't allocate block buffer");
+ com_err(program_name, 0, "%s",
+ _("Can't allocate block buffer"));
exit(1);
}
@@ -1105,7 +1111,7 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags)
if (retval == EXT2_ET_BAD_BLOCK_IN_INODE_TABLE)
continue;
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while getting next inode"));
exit(1);
}
diff --git a/misc/e2undo.c b/misc/e2undo.c
index b1cb7509..a7402b31 100644
--- a/misc/e2undo.c
+++ b/misc/e2undo.c
@@ -48,8 +48,8 @@ static int check_filesystem(TDB_CONTEXT *tdb, io_channel channel)
io_channel_set_blksize(channel, SUPERBLOCK_OFFSET);
retval = io_channel_read_blk64(channel, 1, -SUPERBLOCK_SIZE, &super);
if (retval) {
- com_err(prg_name,
- retval, _("Failed to read the file system data \n"));
+ com_err(prg_name, retval,
+ "%s", _("Failed to read the file system data \n"));
return retval;
}
@@ -85,7 +85,7 @@ static int check_filesystem(TDB_CONTEXT *tdb, io_channel channel)
}
memcpy(s_uuid, tdb_data.dptr, sizeof(s_uuid));
if (memcmp(s_uuid, super.s_uuid, sizeof(s_uuid))) {
- com_err(prg_name, 0,
+ com_err(prg_name, 0, "%s",
_("The file system UUID didn't match \n"));
return -1;
}
@@ -172,8 +172,8 @@ int main(int argc, char *argv[])
}
if (mount_flags & EXT2_MF_MOUNTED) {
- com_err(prg_name, retval, _("e2undo should only be run on "
- "unmounted file system\n"));
+ com_err(prg_name, retval, "%s", _("e2undo should only be run "
+ "on unmounted file system\n"));
exit(1);
}
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 74df4343..b7b93b05 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -199,7 +199,7 @@ static void read_bb_file(ext2_filsys fs, badblocks_list *bb_list,
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
fclose (f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while reading in list of bad blocks from file"));
exit(1);
}
@@ -228,7 +228,7 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list)
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
pclose(f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while processing list of bad blocks from program"));
exit(1);
}
@@ -299,7 +299,7 @@ _("Warning: the backup superblock/group descriptors at block %u contain\n"
*/
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
- com_err("ext2fs_badblocks_list_iterate_begin", retval,
+ com_err("ext2fs_badblocks_list_iterate_begin", retval, "%s",
_("while marking bad blocks as used"));
exit(1);
}
@@ -359,17 +359,17 @@ static void create_root_dir(ext2_filsys fs)
{
errcode_t retval;
struct ext2_inode inode;
- __u32 uid, gid;
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, 0);
if (retval) {
- com_err("ext2fs_mkdir", retval, _("while creating root dir"));
+ com_err("ext2fs_mkdir", retval, "%s",
+ _("while creating root dir"));
exit(1);
}
if (root_uid != 0 || root_gid != 0) {
retval = ext2fs_read_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
- com_err("ext2fs_read_inode", retval,
+ com_err("ext2fs_read_inode", retval, "%s",
_("while reading root inode"));
exit(1);
}
@@ -381,7 +381,7 @@ static void create_root_dir(ext2_filsys fs)
retval = ext2fs_write_new_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
- com_err("ext2fs_write_inode", retval,
+ com_err("ext2fs_write_inode", retval, "%s",
_("while setting root inode ownership"));
exit(1);
}
@@ -399,14 +399,14 @@ static void create_lost_and_found(ext2_filsys fs)
fs->umask = 077;
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, 0, name);
if (retval) {
- com_err("ext2fs_mkdir", retval,
+ com_err("ext2fs_mkdir", retval, "%s",
_("while creating /lost+found"));
exit(1);
}
retval = ext2fs_lookup(fs, EXT2_ROOT_INO, name, strlen(name), 0, &ino);
if (retval) {
- com_err("ext2_lookup", retval,
+ com_err("ext2_lookup", retval, "%s",
_("while looking up /lost+found"));
exit(1);
}
@@ -419,7 +419,7 @@ static void create_lost_and_found(ext2_filsys fs)
break;
retval = ext2fs_expand_dir(fs, ino);
if (retval) {
- com_err("ext2fs_expand_dir", retval,
+ com_err("ext2fs_expand_dir", retval, "%s",
_("while expanding /lost+found"));
exit(1);
}
@@ -434,7 +434,7 @@ static void create_bad_block_inode(ext2_filsys fs, badblocks_list bb_list)
ext2fs_inode_alloc_stats2(fs, EXT2_BAD_INO, +1, 0);
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
- com_err("ext2fs_update_bb_inode", retval,
+ com_err("ext2fs_update_bb_inode", retval, "%s",
_("while setting bad block inode"));
exit(1);
}
@@ -503,7 +503,7 @@ static void create_journal_dev(ext2_filsys fs)
retval = ext2fs_create_journal_superblock(fs,
ext2fs_blocks_count(fs->super), 0, &buf);
if (retval) {
- com_err("create_journal_dev", retval,
+ com_err("create_journal_dev", retval, "%s",
_("while initializing journal superblock"));
exit(1);
}
@@ -541,7 +541,7 @@ write_superblock:
fs->super->s_first_data_block+1,
1, buf);
if (retval) {
- com_err("create_journal_dev", retval,
+ com_err("create_journal_dev", retval, "%s",
_("while writing journal superblock"));
exit(1);
}
@@ -609,7 +609,7 @@ static void show_stats(ext2_filsys fs)
return;
}
- printf(_("Superblock backups stored on blocks: "));
+ printf("%s", _("Superblock backups stored on blocks: "));
group_block = s->s_first_data_block;
col_left = 0;
for (i = 1; i < fs->group_desc_count; i++) {
@@ -662,7 +662,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
len = strlen(opts);
buf = malloc(len+1);
if (!buf) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Couldn't allocate memory to parse options!\n"));
exit(1);
}
@@ -746,7 +746,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
continue;
}
if (resize <= ext2fs_blocks_count(param)) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("The resize maximum must be greater "
"than the filesystem size.\n"));
r_usage++;
@@ -770,7 +770,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
if (rsv_gdb > 0) {
if (param->s_rev_level == EXT2_GOOD_OLD_REV) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("On-line resizing not supported with revision 0 filesystems\n"));
free(buf);
exit(1);
@@ -1073,11 +1073,11 @@ static char **parse_fs_type(const char *fs_type,
"%s filesystem type.\n"), ext_type);
if (!strcmp(ext_type, "ext3") || !strcmp(ext_type, "ext4") ||
!strcmp(ext_type, "ext4dev")) {
- printf(_("You probably need to install an updated "
- "mke2fs.conf file.\n\n"));
+ printf("%s", _("You probably need to install an "
+ "updated mke2fs.conf file.\n\n"));
}
if (!force) {
- printf(_("Aborting...\n"));
+ printf("%s", _("Aborting...\n"));
exit(1);
}
}
@@ -1289,7 +1289,8 @@ static void PRS(int argc, char *argv[])
pathlen += strlen(oldpath);
newpath = malloc(pathlen);
if (!newpath) {
- fprintf(stderr, _("Couldn't allocate memory for new PATH.\n"));
+ fprintf(stderr, "%s",
+ _("Couldn't allocate memory for new PATH.\n"));
exit(1);
}
strcpy(newpath, PATH_SET);
@@ -1399,7 +1400,7 @@ profile_error:
direct_io = 1;
break;
case 'R':
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("'-R' is deprecated, use '-E' instead"));
/* fallthrough */
case 'E':
@@ -1411,12 +1412,12 @@ profile_error:
case 'g':
fs_param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
if (*tmp) {
- com_err(program_name, 0,
- _("Illegal number for blocks per group"));
+ com_err(program_name, 0, "%s",
+ _("Illegal number for blocks per group"));
exit(1);
}
if ((fs_param.s_blocks_per_group % 8) != 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("blocks per group must be multiple of 8"));
exit(1);
}
@@ -1424,13 +1425,13 @@ profile_error:
case 'G':
flex_bg_size = strtoul(optarg, &tmp, 0);
if (*tmp) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Illegal number for flex_bg size"));
exit(1);
}
if (flex_bg_size < 1 ||
(flex_bg_size & (flex_bg_size-1)) != 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("flex_bg size must be a power of 2"));
exit(1);
}
@@ -1463,17 +1464,18 @@ profile_error:
parse_journal_opts(optarg);
break;
case 'K':
- fprintf(stderr, _("Warning: -K option is deprecated and "
- "should not be used anymore. Use "
- "\'-E nodiscard\' extended option "
- "instead!\n"));
+ fprintf(stderr, "%s",
+ _("Warning: -K option is deprecated and "
+ "should not be used anymore. Use "
+ "\'-E nodiscard\' extended option "
+ "instead!\n"));
discard = 0;
break;
case 'l':
bad_blocks_filename = realloc(bad_blocks_filename,
strlen(optarg) + 1);
if (!bad_blocks_filename) {
- com_err(program_name, ENOMEM,
+ com_err(program_name, ENOMEM, "%s",
_("in malloc for bad_blocks_filename"));
exit(1);
}
@@ -1532,7 +1534,7 @@ profile_error:
break;
case 't':
if (fs_type) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The -t option may only be used once"));
exit(1);
}
@@ -1540,7 +1542,7 @@ profile_error:
break;
case 'T':
if (usage_types) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The -T option may only be used once"));
exit(1);
}
@@ -1639,20 +1641,20 @@ profile_error:
&dev_size);
if (retval && (retval != EXT2_ET_UNIMPLEMENTED)) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine filesystem size"));
exit(1);
}
if (!fs_blocks_count) {
if (retval == EXT2_ET_UNIMPLEMENTED) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Couldn't determine device size; you "
"must specify\nthe size of the "
"filesystem\n"));
exit(1);
} else {
if (dev_size == 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Device size reported to be zero. "
"Invalid partition specified, or\n\t"
"partition table wasn't reread "
@@ -1669,7 +1671,7 @@ profile_error:
EXT2_BLOCK_SIZE(&fs_param))-1));
}
} else if (!force && (fs_blocks_count > dev_size)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Filesystem larger than apparent device size."));
proceed_question();
}
@@ -1690,7 +1692,7 @@ profile_error:
fs_blocks_count ? fs_blocks_count : dev_size,
argv[0]);
if (!fs_types) {
- fprintf(stderr, _("Failed to parse fs types list\n"));
+ fprintf(stderr, "%s", _("Failed to parse fs types list\n"));
exit(1);
}
@@ -1730,13 +1732,13 @@ profile_error:
/* Get the hardware sector sizes, if available */
retval = ext2fs_get_device_sectsize(device_name, &lsector_size);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine hardware sector size"));
exit(1);
}
retval = ext2fs_get_device_phys_sectsize(device_name, &psector_size);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine physical sector size"));
exit(1);
}
@@ -1769,7 +1771,7 @@ profile_error:
fs_blocks_count /= (blocksize / 1024);
} else {
if (blocksize < lsector_size) { /* Impossible */
- com_err(program_name, EINVAL,
+ com_err(program_name, EINVAL, "%s",
_("while setting blocksize; too small "
"for device\n"));
exit(1);
@@ -1819,14 +1821,15 @@ profile_error:
if (r_opt == EXT2_GOOD_OLD_REV &&
(fs_param.s_feature_compat || fs_param.s_feature_incompat ||
fs_param.s_feature_ro_compat)) {
- fprintf(stderr, _("Filesystem features not supported "
- "with revision 0 filesystems\n"));
+ fprintf(stderr, "%s", _("Filesystem features not supported "
+ "with revision 0 filesystems\n"));
exit(1);
}
if (s_opt > 0) {
if (r_opt == EXT2_GOOD_OLD_REV) {
- fprintf(stderr, _("Sparse superblocks not supported "
+ fprintf(stderr, "%s",
+ _("Sparse superblocks not supported "
"with revision 0 filesystems\n"));
exit(1);
}
@@ -1838,8 +1841,8 @@ profile_error:
if (journal_size != 0) {
if (r_opt == EXT2_GOOD_OLD_REV) {
- fprintf(stderr, _("Journals not supported "
- "with revision 0 filesystems\n"));
+ fprintf(stderr, "%s", _("Journals not supported with "
+ "revision 0 filesystems\n"));
exit(1);
}
fs_param.s_feature_compat |=
@@ -1869,8 +1872,8 @@ profile_error:
/* Check the user's mkfs options for 64bit */
if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
!(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
- printf(_("Extents MUST be enabled for a 64-bit filesystem. "
- "Pass -O extents to rectify.\n"));
+ printf("%s", _("Extents MUST be enabled for a 64-bit "
+ "filesystem. Pass -O extents to rectify.\n"));
exit(1);
}
@@ -1888,13 +1891,13 @@ profile_error:
int_log2(cluster_size >> EXT2_MIN_CLUSTER_LOG_SIZE);
if (fs_param.s_log_cluster_size &&
fs_param.s_log_cluster_size < fs_param.s_log_block_size) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The cluster size may not be "
"smaller than the block size.\n"));
exit(1);
}
} else if (cluster_size) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("specifying a cluster size requires the "
"bigalloc feature"));
exit(1);
@@ -1975,7 +1978,7 @@ profile_error:
/* Can't support bigalloc feature without extents feature */
if ((fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) &&
!(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Can't support bigalloc feature without "
"extents feature"));
exit(1);
@@ -1983,24 +1986,24 @@ profile_error:
if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
(fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
- fprintf(stderr, _("The resize_inode and meta_bg features "
- "are not compatible.\n"
- "They can not be both enabled "
- "simultaneously.\n"));
+ fprintf(stderr, "%s", _("The resize_inode and meta_bg "
+ "features are not compatible.\n"
+ "They can not be both enabled "
+ "simultaneously.\n"));
exit(1);
}
if (!quiet &&
(fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC))
- fprintf(stderr, _("\nWarning: the bigalloc feature is still "
- "under development\n"
+ fprintf(stderr, "%s", _("\nWarning: the bigalloc feature is "
+ "still under development\n"
"See https://ext4.wiki.kernel.org/"
"index.php/Bigalloc for more information\n\n"));
if (!quiet &&
(fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_QUOTA))
- fprintf(stderr, _("\nWarning: the quota feature is still "
- "under development\n"
+ fprintf(stderr, "%s", _("\nWarning: the quota feature is "
+ "still under development\n"
"See https://ext4.wiki.kernel.org/"
"index.php/Quota for more information\n\n"));
@@ -2009,7 +2012,7 @@ profile_error:
*/
if ((fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) &&
!(fs_param.s_feature_ro_compat&EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("reserved online resize blocks not supported "
"on non-sparse filesystem"));
exit(1);
@@ -2018,7 +2021,7 @@ profile_error:
if (fs_param.s_blocks_per_group) {
if (fs_param.s_blocks_per_group < 256 ||
fs_param.s_blocks_per_group > 8 * (unsigned) blocksize) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("blocks per group count out of range"));
exit(1);
}
@@ -2042,7 +2045,7 @@ profile_error:
if (flex_bg_size) {
if (!(fs_param.s_feature_incompat &
EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Flex_bg feature not enabled, so "
"flex_bg size may not be specified"));
exit(1);
@@ -2229,7 +2232,7 @@ errout:
if (free_tdb_dir)
free(tdb_dir);
free(tdb_file);
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to setup undo file\n"));
return retval;
}
@@ -2380,7 +2383,8 @@ int main (int argc, char *argv[])
flags |= EXT2_FLAG_PRINT_PROGRESS;
retval = ext2fs_initialize(device_name, flags, &fs_param, io_ptr, &fs);
if (retval) {
- com_err(device_name, retval, _("while setting up superblock"));
+ com_err(device_name, retval, "%s",
+ _("while setting up superblock"));
exit(1);
}
@@ -2395,8 +2399,9 @@ int main (int argc, char *argv[])
retval = mke2fs_discard_device(fs);
if (!retval && io_channel_discard_zeroes_data(fs->io)) {
if (verbose)
- printf(_("Discard succeeded and will return 0s "
- " - skipping inode table wipe\n"));
+ printf("%s",
+ _("Discard succeeded and will return "
+ "0s - skipping inode table wipe\n"));
lazy_itable_init = 1;
itable_zeroed = 1;
}
@@ -2530,19 +2535,19 @@ int main (int argc, char *argv[])
handle_bad_blocks(fs, bb_list);
fs->stride = fs_stride = fs->super->s_raid_stride;
if (!quiet)
- printf(_("Allocating group tables: "));
+ printf("%s", _("Allocating group tables: "));
retval = ext2fs_allocate_tables(fs);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to allocate filesystem tables"));
exit(1);
}
if (!quiet)
- printf(_("done \n"));
+ printf("%s", _("done \n"));
retval = ext2fs_convert_subcluster_bitmap(fs, &fs->block_map);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("\n\twhile converting subcluster bitmap"));
exit(1);
}
@@ -2599,6 +2604,7 @@ int main (int argc, char *argv[])
retval = ext2fs_create_resize_inode(fs);
if (retval) {
com_err("ext2fs_create_resize_inode", retval,
+ "%s",
_("while reserving blocks for online resize"));
exit(1);
}
@@ -2634,14 +2640,14 @@ int main (int argc, char *argv[])
exit(1);
}
if (!quiet)
- printf(_("done\n"));
+ printf("%s", _("done\n"));
ext2fs_close(jfs);
free(journal_device);
} else if ((journal_size) ||
(fs_param.s_feature_compat &
EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
if (super_only) {
- printf(_("Skipping journal creation in super-only mode\n"));
+ printf("%s", _("Skipping journal creation in super-only mode\n"));
fs->super->s_journal_inum = EXT2_JOURNAL_INO;
goto no_journal;
}
@@ -2659,20 +2665,21 @@ int main (int argc, char *argv[])
retval = ext2fs_add_journal_inode(fs, journal_blocks,
journal_flags);
if (retval) {
- com_err (program_name, retval,
- _("\n\twhile trying to create journal"));
+ com_err(program_name, retval, "%s",
+ _("\n\twhile trying to create journal"));
exit(1);
}
if (!quiet)
- printf(_("done\n"));
+ printf("%s", _("done\n"));
}
no_journal:
if (!super_only &&
fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_MMP) {
retval = ext2fs_mmp_init(fs);
if (retval) {
- fprintf(stderr, _("\nError while enabling multiple "
- "mount protection feature."));
+ fprintf(stderr, "%s",
+ _("\nError while enabling multiple "
+ "mount protection feature."));
exit(1);
}
if (!quiet)
@@ -2689,16 +2696,16 @@ no_journal:
create_quota_inodes(fs);
if (!quiet)
- printf(_("Writing superblocks and "
+ printf("%s", _("Writing superblocks and "
"filesystem accounting information: "));
checkinterval = fs->super->s_checkinterval;
max_mnt_count = fs->super->s_max_mnt_count;
retval = ext2fs_close(fs);
if (retval) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("\nWarning, had trouble writing out superblocks."));
} else if (!quiet) {
- printf(_("done\n\n"));
+ printf("%s", _("done\n\n"));
if (!getenv("MKE2FS_SKIP_CHECK_MSG"))
print_check_message(max_mnt_count, checkinterval);
}
diff --git a/misc/mklost+found.c b/misc/mklost+found.c
index 4f78bdec..134e8241 100644
--- a/misc/mklost+found.c
+++ b/misc/mklost+found.c
@@ -47,7 +47,7 @@ int main (int argc, char ** argv)
E2FSPROGS_DATE);
if (argc != 1) {
(void)argv; /* avoid unused argument warning */
- fprintf (stderr, _("Usage: mklost+found\n"));
+ fprintf (stderr, "%s", _("Usage: mklost+found\n"));
exit(1);
}
if (mkdir (LPF, 0700) == -1) {
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index a8dc1112..3730821a 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -208,7 +208,7 @@ static int remove_journal_device(ext2_filsys fs)
EXT2_FLAG_JOURNAL_DEV_OK, 0,
fs->blocksize, io_ptr, &jfs);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to open external journal"));
goto no_valid_journal;
}
@@ -221,7 +221,7 @@ static int remove_journal_device(ext2_filsys fs)
/* Get the journal superblock */
if ((retval = io_channel_read_blk64(jfs->io, 1, -1024, buf))) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while reading journal superblock"));
goto no_valid_journal;
}
@@ -305,14 +305,14 @@ static errcode_t remove_journal_inode(ext2_filsys fs)
retval = ext2fs_read_inode(fs, ino, &inode);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while reading journal inode"));
return retval;
}
if (ino == EXT2_JOURNAL_INO) {
retval = ext2fs_read_bitmaps(fs);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while reading bitmaps"));
return retval;
}
@@ -320,7 +320,7 @@ static errcode_t remove_journal_inode(ext2_filsys fs)
BLOCK_FLAG_READ_ONLY, NULL,
release_blocks_proc, NULL);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while clearing journal inode"));
return retval;
}
@@ -331,7 +331,7 @@ static errcode_t remove_journal_inode(ext2_filsys fs)
inode.i_flags &= ~EXT2_IMMUTABLE_FL;
retval = ext2fs_write_inode(fs, ino, &inode);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while writing journal inode"));
return retval;
}
@@ -377,7 +377,7 @@ static void request_fsck_afterwards(ext2_filsys fs)
fs->super->s_state &= ~EXT2_VALID_FS;
printf("\n%s\n", _(please_fsck));
if (mount_flags & EXT2_MF_READONLY)
- printf(_("(and reboot afterwards!)\n"));
+ printf("%s", _("(and reboot afterwards!)\n"));
}
/*
@@ -501,7 +501,7 @@ static int update_feature_set(ext2_filsys fs, char *features)
"match. expected: %x, actual: %x\n"),
EXT4_MMP_MAGIC, mmp_cmp->mmp_magic);
else
- com_err(program_name, error,
+ com_err(program_name, error, "%s",
_("while reading MMP block."));
goto mmp_error;
}
@@ -694,7 +694,7 @@ static int add_journal(ext2_filsys fs)
journal_flags);
if (retval) {
fprintf(stderr, "\n");
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("\n\twhile trying to create journal file"));
return retval;
} else
@@ -750,7 +750,7 @@ static void handle_quota_options(ext2_filsys fs)
quota_release_context(&qctx);
if ((usrquota == QOPT_ENABLE) || (grpquota == QOPT_ENABLE)) {
- fprintf(stderr, _("\nWarning: the quota feature is still "
+ fprintf(stderr, "%s", _("\nWarning: the quota feature is still "
"under development\n"
"See https://ext4.wiki.kernel.org/"
"index.php/Quota for more information\n\n"));
@@ -1016,7 +1016,7 @@ static void parse_tune2fs_options(int argc, char **argv)
break;
case 'o':
if (mntopts_cmd) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("-o may only be specified once"));
usage();
}
@@ -1025,7 +1025,7 @@ static void parse_tune2fs_options(int argc, char **argv)
break;
case 'O':
if (features_cmd) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("-O may only be specified once"));
usage();
}
@@ -1152,7 +1152,7 @@ static int parse_extended_opts(ext2_filsys fs, const char *opts)
len = strlen(opts);
buf = malloc(len+1);
if (!buf) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Couldn't allocate memory to parse options!\n"));
return 1;
}
@@ -1273,7 +1273,7 @@ static int parse_extended_opts(ext2_filsys fs, const char *opts)
r_usage++;
}
if (r_usage) {
- fprintf(stderr, _("\nBad options specified.\n\n"
+ fprintf(stderr, "%s", _("\nBad options specified.\n\n"
"Extended options are separated by commas, "
"and may take an argument which\n"
"\tis set off by an equals ('=') sign.\n\n"
@@ -1833,7 +1833,7 @@ static int tune2fs_setup_tdb(const char *name, io_manager *io_ptr)
tmp_name = strdup(name);
if (!tmp_name) {
alloc_fn_fail:
- com_err(program_name, ENOMEM,
+ com_err(program_name, ENOMEM, "%s",
_("Couldn't allocate memory for tdb filename\n"));
return ENOMEM;
}
@@ -1938,7 +1938,7 @@ retry_open:
_("MMP block magic is bad. Try to fix it by "
"running:\n'e2fsck -f %s'\n"), device_name);
else if (retval != EXT2_ET_MMP_FAILED)
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Couldn't find valid filesystem superblock.\n"));
ext2fs_free(fs);
@@ -1959,8 +1959,8 @@ retry_open:
goto closefs;
}
if (new_inode_size < EXT2_INODE_SIZE(fs->super)) {
- fprintf(stderr, _("Shrinking the inode size is "
- "not supported\n"));
+ fprintf(stderr, "%s",
+ _("Shrinking inode size is not supported\n"));
rc = 1;
goto closefs;
}
@@ -2188,7 +2188,8 @@ retry_open:
} else if (strcasecmp(new_UUID, "random") == 0) {
uuid_generate(sb->s_uuid);
} else if (uuid_parse(new_UUID, sb->s_uuid)) {
- com_err(program_name, 0, _("Invalid UUID format\n"));
+ com_err(program_name, 0, "%s",
+ _("Invalid UUID format\n"));
rc = 1;
goto closefs;
}
@@ -2225,7 +2226,7 @@ retry_open:
printf(_("Setting inode size %lu\n"),
new_inode_size);
} else {
- printf(_("Failed to change inode size\n"));
+ printf("%s", _("Failed to change inode size\n"));
rc = 1;
goto closefs;
}
diff --git a/misc/uuidd.c b/misc/uuidd.c
index 2e255ba1..5a531380 100644
--- a/misc/uuidd.c
+++ b/misc/uuidd.c
@@ -544,7 +544,7 @@ int main(int argc, char **argv)
"%s and subsequent %d UUIDs\n", num),
str, num);
} else {
- printf(_("List of UUID's:\n"));
+ printf("%s", _("List of UUID's:\n"));
cp = buf + 4;
if (ret != (int) (sizeof(num) + num*sizeof(uu)))
goto unexpected_size;
diff --git a/resize/main.c b/resize/main.c
index 1394ae1b..6f3954f9 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -151,10 +151,10 @@ static void bigalloc_check(ext2_filsys fs, int force)
{
if (!force && EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_BIGALLOC)) {
- fprintf(stderr, _("\nResizing bigalloc file systems has "
- "not been fully tested. Proceed\n"
- "at your own risk! Use the force option "
- "if you want to go ahead anyway.\n\n"));
+ fprintf(stderr, "%s", _("\nResizing bigalloc file systems has "
+ "not been fully tested. Proceed at\n"
+ "your own risk! Use the force option "
+ "if you want to go ahead anyway.\n\n"));
exit(1);
}
}
@@ -312,9 +312,9 @@ int main (int argc, char ** argv)
retval = ext2fs_open2(device_name, io_options, io_flags,
0, 0, io_ptr, &fs);
if (retval) {
- com_err (program_name, retval, _("while trying to open %s"),
- device_name);
- printf (_("Couldn't find valid filesystem superblock.\n"));
+ com_err(program_name, retval, _("while trying to open %s"),
+ device_name);
+ printf("%s", _("Couldn't find valid filesystem superblock.\n"));
exit (1);
}
@@ -363,7 +363,7 @@ int main (int argc, char ** argv)
retval = ext2fs_get_device_size2(device_name, fs->blocksize,
&max_size);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine filesystem size"));
exit(1);
}
@@ -389,7 +389,7 @@ int main (int argc, char ** argv)
if (new_size == (1ULL << 32))
new_size--;
else if (new_size > (1ULL << 32)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("New size too large to be "
"expressed in 32 bits\n"));
exit(1);
@@ -403,7 +403,7 @@ int main (int argc, char ** argv)
}
if (use_stride >= 0) {
if (use_stride >= (int) fs->super->s_blocks_per_group) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Invalid stride length"));
exit(1);
}
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index ec1594ef..80193deb 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -1869,7 +1869,7 @@ static errcode_t fix_resize_inode(ext2_filsys fs)
* should never happen anyway since the filesystem
* should be fsck'ed and we assume it is consistent.
*/
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Should never happen: resize inode corrupt!\n"));
exit(1);
}