From 087979183b94fd0b71393d4137cbdc7941a4223d Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 15 Oct 2015 17:01:34 -0400 Subject: [PATCH] Fix: Silence warnings when using uid_t and pid_t with printf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- src/common/runas.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/runas.c b/src/common/runas.c index 3d2abd438..21490ac4d 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -374,7 +374,7 @@ int run_as_cmd(struct run_as_worker *worker, recvret.ret = -1; recvret._errno = EPERM; ERR("Client (%d)/Server (%d) UID mismatch (and sessiond is not root)", - uid, geteuid()); + (int) uid, (int) geteuid()); goto end; } } @@ -466,7 +466,7 @@ int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid) struct run_as_data data; DBG3("mkdir() recursive %s with mode %d for uid %d and gid %d", - path, mode, uid, gid); + path, (int) mode, (int) uid, (int) gid); strncpy(data.u.mkdir.path, path, PATH_MAX - 1); data.u.mkdir.path[PATH_MAX - 1] = '\0'; data.u.mkdir.mode = mode; @@ -479,7 +479,7 @@ int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid) struct run_as_data data; DBG3("mkdir() %s with mode %d for uid %d and gid %d", - path, mode, uid, gid); + path, (int) mode, (int) uid, (int) gid); strncpy(data.u.mkdir.path, path, PATH_MAX - 1); data.u.mkdir.path[PATH_MAX - 1] = '\0'; data.u.mkdir.mode = mode; @@ -496,7 +496,7 @@ int run_as_open(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid) struct run_as_data data; DBG3("open() %s with flags %X mode %d for uid %d and gid %d", - path, flags, mode, uid, gid); + path, flags, (int) mode, (int) uid, (int) gid); strncpy(data.u.open.path, path, PATH_MAX - 1); data.u.open.path[PATH_MAX - 1] = '\0'; data.u.open.flags = flags; @@ -510,7 +510,7 @@ int run_as_unlink(const char *path, uid_t uid, gid_t gid) struct run_as_data data; DBG3("unlink() %s with for uid %d and gid %d", - path, uid, gid); + path, (int) uid, (int) gid); strncpy(data.u.unlink.path, path, PATH_MAX - 1); data.u.unlink.path[PATH_MAX - 1] = '\0'; return run_as(RUN_AS_UNLINK, &data, uid, gid); @@ -522,7 +522,7 @@ int run_as_rmdir_recursive(const char *path, uid_t uid, gid_t gid) struct run_as_data data; DBG3("rmdir_recursive() %s with for uid %d and gid %d", - path, uid, gid); + path, (int) uid, (int) gid); strncpy(data.u.rmdir_recursive.path, path, PATH_MAX - 1); data.u.rmdir_recursive.path[PATH_MAX - 1] = '\0'; return run_as(RUN_AS_RMDIR_RECURSIVE, &data, uid, gid); -- 2.34.1