conf.c: Cast st_uid and st_gid to int

In eglibc st_uid and st_gid are defined as unsigned integers, in bionic those
are defined as unsigned long (which is inconsistent with the kernel's
defintion that's uint_32).

To workaround this problem, simply cast those two to int.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Stéphane Graber 2013-01-15 12:44:50 -05:00
parent b3ef6e1678
commit 2008796233

View File

@ -2617,7 +2617,7 @@ static int uid_shift_file(char *path, struct lxc_conf *c)
newuid = shiftid(c, statbuf.st_uid, ID_TYPE_UID); newuid = shiftid(c, statbuf.st_uid, ID_TYPE_UID);
newgid = shiftid(c, statbuf.st_gid, ID_TYPE_GID); newgid = shiftid(c, statbuf.st_gid, ID_TYPE_GID);
if (newuid != statbuf.st_uid || newgid != statbuf.st_gid) { if (newuid != statbuf.st_uid || newgid != statbuf.st_gid) {
DEBUG("chowning %s from %d:%d to %d:%d\n", path, statbuf.st_uid, statbuf.st_gid, newuid, newgid); DEBUG("chowning %s from %d:%d to %d:%d\n", path, (int)statbuf.st_uid, (int)statbuf.st_gid, newuid, newgid);
if (chown(path, newuid, newgid)) { if (chown(path, newuid, newgid)) {
SYSERROR("chown(%s)", path); SYSERROR("chown(%s)", path);
return -1; return -1;