diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-09-04 16:28:06 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-09-11 19:44:55 +0200 |
commit | f2c346eaa486431ffa2a3adc05356159de834e2e (patch) | |
tree | 93b45f3b4bec2200b921be536baab59856bb0435 /src | |
parent | af58b15fa7f20e33736d79c6a4b3becb568517ca (diff) | |
download | sssd-f2c346eaa486431ffa2a3adc05356159de834e2e.tar.gz sssd-f2c346eaa486431ffa2a3adc05356159de834e2e.tar.bz2 sssd-f2c346eaa486431ffa2a3adc05356159de834e2e.zip |
Fix formating of variables with type: uid_t
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb_ops.c | 5 | ||||
-rw-r--r-- | src/monitor/monitor.c | 3 | ||||
-rw-r--r-- | src/monitor/monitor_netlink.c | 5 | ||||
-rw-r--r-- | src/providers/krb5/krb5_become_user.c | 5 | ||||
-rw-r--r-- | src/providers/krb5/krb5_utils.c | 4 | ||||
-rw-r--r-- | src/providers/proxy/proxy_id.c | 11 | ||||
-rw-r--r-- | src/responder/common/negcache.c | 4 | ||||
-rw-r--r-- | src/tools/sss_seed.c | 5 | ||||
-rw-r--r-- | src/tools/tools_util.c | 3 |
9 files changed, 27 insertions, 18 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 03f45de7..4e5451e3 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -1198,8 +1198,9 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, if (domain->id_max != 0 && uid != 0 && (uid < domain->id_min || uid > domain->id_max)) { - DEBUG(2, ("Supplied uid [%d] is not in the allowed range [%d-%d].\n", - uid, domain->id_min, domain->id_max)); + DEBUG(SSSDBG_OP_FAILURE, + ("Supplied uid [%"SPRIuid"] is not in the allowed range " + "[%d-%d].\n", uid, domain->id_min, domain->id_max)); return ERANGE; } diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index d8bbfbcb..3d8ba262 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2695,7 +2695,8 @@ int main(int argc, const char *argv[]) uid = getuid(); if (uid != 0) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Running under %d, must be root\n", uid)); + DEBUG(SSSDBG_FATAL_FAILURE, + ("Running under %"SPRIuid", must be root\n", uid)); sss_log(SSS_LOG_ALERT, "sssd must be run as root"); return 8; } diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c index 932a6bf3..c0134237 100644 --- a/src/monitor/monitor_netlink.c +++ b/src/monitor/monitor_netlink.c @@ -472,8 +472,9 @@ static int event_msg_recv(struct nl_msg *msg, void *arg) creds = nlmsg_get_creds(msg); if (!creds || creds->uid != 0) { - DEBUG(9, ("Ignoring netlink message from UID %d", - creds ? creds->uid : -1)); + DEBUG(SSSDBG_TRACE_ALL, + ("Ignoring netlink message from UID %"SPRIuid, + creds ? creds->uid : (uid_t)-1)); return NL_SKIP; } diff --git a/src/providers/krb5/krb5_become_user.c b/src/providers/krb5/krb5_become_user.c index 567cf237..d549d838 100644 --- a/src/providers/krb5/krb5_become_user.c +++ b/src/providers/krb5/krb5_become_user.c @@ -30,12 +30,13 @@ errno_t become_user(uid_t uid, gid_t gid) uid_t cuid; int ret; - DEBUG(SSSDBG_FUNC_DATA, ("Trying to become user [%d][%d].\n", uid, gid)); + DEBUG(SSSDBG_FUNC_DATA, + ("Trying to become user [%"SPRIuid"][%d].\n", uid, gid)); /* skip call if we already are the requested user */ cuid = geteuid(); if (uid == cuid) { - DEBUG(SSSDBG_FUNC_DATA, ("Already user [%d].\n", uid)); + DEBUG(SSSDBG_FUNC_DATA, ("Already user [%"SPRIuid"].\n", uid)); return EOK; } diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index d0968735..9dd9882d 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -242,7 +242,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, "because uid is invalid.\n")); goto done; } - result = talloc_asprintf_append(result, "%s%d", p, + result = talloc_asprintf_append(result, "%s%"SPRIuid, p, kr->uid); if (!file_mode) *private_path = true; break; @@ -386,7 +386,7 @@ static errno_t check_parent_stat(bool private_path, struct stat *parent_stat, if (!((parent_stat->st_uid == 0 && parent_stat->st_gid == 0) || parent_stat->st_uid == uid)) { DEBUG(1, ("Private directory can only be created below a " - "directory belonging to root or to [%d][%d].\n", + "directory belonging to root or to [%"SPRIuid"][%d].\n", uid, gid)); return EINVAL; } diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c index b5d63ecf..4ac1c8dc 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -22,6 +22,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" + +#include "util/sss_format.h" #include "util/strtonum.h" #include "providers/proxy/proxy.h" @@ -166,7 +169,7 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %d, %d)\n", + DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %"SPRIuid", %d)\n", pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); /* uid=0 or gid=0 are invalid values */ @@ -314,7 +317,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx, bool del_user = false; int ret; - DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by uid (%d)\n", uid)); + DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by uid (%"SPRIuid")\n", uid)); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -354,7 +357,7 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getpwuid_r failed for '%d' <%d>: %s\n", + ("proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n", uid, ret, strerror(ret))); } return ret; @@ -453,7 +456,7 @@ static int enum_users(TALLOC_CTX *mem_ctx, case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_TRACE_LIBS, ("User found (%s, %d, %d)\n", + DEBUG(SSSDBG_TRACE_LIBS, ("User found (%s, %"SPRIuid", %d)\n", pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); /* uid=0 or gid=0 are invalid values */ diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 76934637..a1f44789 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -379,7 +379,7 @@ int sss_ncache_check_uid(struct sss_nc_ctx *ctx, int ttl, uid_t uid) char *str; int ret; - str = talloc_asprintf(ctx, "%s/%u", NC_UID_PREFIX, uid); + str = talloc_asprintf(ctx, "%s/%"SPRIuid, NC_UID_PREFIX, uid); if (!str) return ENOMEM; ret = sss_ncache_check_str(ctx, str, ttl); @@ -510,7 +510,7 @@ int sss_ncache_set_uid(struct sss_nc_ctx *ctx, bool permanent, uid_t uid) char *str; int ret; - str = talloc_asprintf(ctx, "%s/%u", NC_UID_PREFIX, uid); + str = talloc_asprintf(ctx, "%s/%"SPRIuid, NC_UID_PREFIX, uid); if (!str) return ENOMEM; ret = sss_ncache_set_str(ctx, str, permanent); diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c index 75f7e8c5..78e02742 100644 --- a/src/tools/sss_seed.c +++ b/src/tools/sss_seed.c @@ -166,8 +166,9 @@ static int seed_id_input(const char *req, return ret; } if (*endptr != '\0') { - DEBUG(SSSDBG_MINOR_FAILURE, ("extra characters [%s] after " - "ID [%d]\n", endptr, *_id_input)); + DEBUG(SSSDBG_MINOR_FAILURE, + ("extra characters [%s] after ID [%"SPRIuid"]\n", + endptr, *_id_input)); } } else { ret = EINVAL; diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c index 6798b658..0e1b3b40 100644 --- a/src/tools/tools_util.c +++ b/src/tools/tools_util.c @@ -360,7 +360,8 @@ static int remove_mail_spool(TALLOC_CTX *mem_ctx, case 0: break; case -1: - DEBUG(3, ("%s not owned by %d, not removing\n", + DEBUG(SSSDBG_MINOR_FAILURE, + ("%s not owned by %"SPRIuid", not removing\n", spool_file, uid)); ret = EACCES; /* FALLTHROUGH */ |