util: Fix printf format for uid_t|gid_t
The uid_t|gid_t values are explicitly casted to "unsigned long", but the printf() still used "%d", which is for signed values. Change the format to "%u". Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
parent
e8b70ab743
commit
7b4b59fa4a
@ -2691,7 +2691,7 @@ virSetUIDGID(uid_t uid, gid_t gid)
|
|||||||
if (gid != (gid_t)-1) {
|
if (gid != (gid_t)-1) {
|
||||||
if (setregid(gid, gid) < 0) {
|
if (setregid(gid, gid) < 0) {
|
||||||
virReportSystemError(err = errno,
|
virReportSystemError(err = errno,
|
||||||
_("cannot change to '%d' group"),
|
_("cannot change to '%u' group"),
|
||||||
(unsigned int) gid);
|
(unsigned int) gid);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -2722,7 +2722,7 @@ virSetUIDGID(uid_t uid, gid_t gid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
virReportSystemError(err = rc, _("cannot getpwuid_r(%d)"),
|
virReportSystemError(err = rc, _("cannot getpwuid_r(%u)"),
|
||||||
(unsigned int) uid);
|
(unsigned int) uid);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -2730,7 +2730,7 @@ virSetUIDGID(uid_t uid, gid_t gid)
|
|||||||
if (!pwd_result) {
|
if (!pwd_result) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("getpwuid_r failed to retrieve data "
|
_("getpwuid_r failed to retrieve data "
|
||||||
"for uid '%d'"),
|
"for uid '%u'"),
|
||||||
(unsigned int) uid);
|
(unsigned int) uid);
|
||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
goto error;
|
goto error;
|
||||||
@ -2745,7 +2745,7 @@ virSetUIDGID(uid_t uid, gid_t gid)
|
|||||||
# endif
|
# endif
|
||||||
if (setreuid(uid, uid) < 0) {
|
if (setreuid(uid, uid) < 0) {
|
||||||
virReportSystemError(err = errno,
|
virReportSystemError(err = errno,
|
||||||
_("cannot change to uid to '%d'"),
|
_("cannot change to uid to '%u'"),
|
||||||
(unsigned int) uid);
|
(unsigned int) uid);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user