fsck, libblkid: fix printf format string issue [coverity scan]
According to coverirty a printf format string contains an unrecognized format specifier (CWE-628). Lets avoid glibc extension "%m" that is same as "%s", strerror(errno). CID: 360699 CID: 360718 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
12558a4c47
commit
7f9e76b4df
|
@ -931,8 +931,8 @@ static int fsck_device(struct libmnt_fs *fs, int interactive)
|
|||
}
|
||||
return 0;
|
||||
err:
|
||||
warnx(_("error %d (%m) while executing fsck.%s for %s"),
|
||||
retval, type, fs_get_device(fs));
|
||||
warnx(_("error %d (%s) while executing fsck.%s for %s"),
|
||||
retval, strerror(errno), type, fs_get_device(fs));
|
||||
return FSCK_EX_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
|||
diff = now - dev->bid_time;
|
||||
|
||||
if (stat(dev->bid_name, &st) < 0) {
|
||||
DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while "
|
||||
"trying to stat %s", errno,
|
||||
DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while "
|
||||
"trying to stat %s", strerror(errno), errno,
|
||||
dev->bid_name));
|
||||
open_err:
|
||||
if ((errno == EPERM) || (errno == EACCES) || (errno == ENOENT)) {
|
||||
|
@ -128,8 +128,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
|||
|
||||
fd = open(dev->bid_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||
if (fd < 0) {
|
||||
DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while "
|
||||
"opening %s", errno,
|
||||
DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while "
|
||||
"opening %s", strerror(errno), errno,
|
||||
dev->bid_name));
|
||||
goto open_err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue