summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-09-04 16:52:34 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-11 19:44:56 +0200
commita4bf85ccc902490c3b75b44532010fbb32169801 (patch)
tree77321838168f69e052bb2e09ec2fba7024a3ae2a /src
parentf2c346eaa486431ffa2a3adc05356159de834e2e (diff)
downloadsssd-a4bf85ccc902490c3b75b44532010fbb32169801.tar.gz
sssd-a4bf85ccc902490c3b75b44532010fbb32169801.tar.bz2
sssd-a4bf85ccc902490c3b75b44532010fbb32169801.zip
Fix formating of variables with type: gid_t
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb_ops.c10
-rw-r--r--src/providers/krb5/krb5_become_user.c2
-rw-r--r--src/providers/krb5/krb5_utils.c4
-rw-r--r--src/providers/ldap/sdap_async_initgroups_ad.c3
-rw-r--r--src/providers/proxy/proxy_id.c21
-rw-r--r--src/providers/simple/simple_access_check.c8
-rw-r--r--src/responder/common/negcache.c4
7 files changed, 27 insertions, 25 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 4e5451e3..0197d8e0 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1206,8 +1206,9 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
if (domain->id_max != 0 && gid != 0 &&
(gid < domain->id_min || gid > domain->id_max)) {
- DEBUG(2, ("Supplied gid [%d] is not in the allowed range [%d-%d].\n",
- gid, domain->id_min, domain->id_max));
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Supplied gid [%"SPRIgid"] is not in the allowed range "
+ "[%d-%d].\n", gid, domain->id_min, domain->id_max));
return ERANGE;
}
@@ -1391,8 +1392,9 @@ int sysdb_add_group(struct sysdb_ctx *sysdb,
if (domain->id_max != 0 && gid != 0 &&
(gid < domain->id_min || gid > domain->id_max)) {
- DEBUG(2, ("Supplied gid [%d] is not in the allowed range [%d-%d].\n",
- gid, domain->id_min, domain->id_max));
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Supplied gid [%"SPRIgid"] is not in the allowed range "
+ "[%d-%d].\n", gid, domain->id_min, domain->id_max));
return ERANGE;
}
diff --git a/src/providers/krb5/krb5_become_user.c b/src/providers/krb5/krb5_become_user.c
index d549d838..8cbeb1ce 100644
--- a/src/providers/krb5/krb5_become_user.c
+++ b/src/providers/krb5/krb5_become_user.c
@@ -31,7 +31,7 @@ errno_t become_user(uid_t uid, gid_t gid)
int ret;
DEBUG(SSSDBG_FUNC_DATA,
- ("Trying to become user [%"SPRIuid"][%d].\n", uid, gid));
+ ("Trying to become user [%"SPRIuid"][%"SPRIgid"].\n", uid, gid));
/* skip call if we already are the requested user */
cuid = geteuid();
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 9dd9882d..e1daf6bf 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -386,8 +386,8 @@ 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 [%"SPRIuid"][%d].\n",
- uid, gid));
+ "directory belonging to root or to "
+ "[%"SPRIuid"][%"SPRIgid"].\n", uid, gid));
return EINVAL;
}
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
index efaa247d..f6d236de 100644
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
@@ -472,8 +472,7 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq)
}
DEBUG(SSSDBG_TRACE_LIBS,
- ("Processing membership GID [%lu]\n",
- gid));
+ ("Processing membership GID [%"SPRIgid"]\n", gid));
/* Check whether this GID already exists in the sysdb */
ret = sysdb_search_group_by_gid(tmp_ctx, state->sysdb, state->domain,
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index 4ac1c8dc..963aad2d 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -169,7 +169,7 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd,
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %"SPRIuid", %d)\n",
+ DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %"SPRIuid", %"SPRIgid")\n",
pwd->pw_name, pwd->pw_uid, pwd->pw_gid));
/* uid=0 or gid=0 are invalid values */
@@ -456,8 +456,9 @@ static int enum_users(TALLOC_CTX *mem_ctx,
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_TRACE_LIBS, ("User found (%s, %"SPRIuid", %d)\n",
- pwd->pw_name, pwd->pw_uid, pwd->pw_gid));
+ DEBUG(SSSDBG_TRACE_LIBS,
+ ("User found (%s, %"SPRIuid", %"SPRIgid")\n",
+ pwd->pw_name, pwd->pw_uid, pwd->pw_gid));
/* uid=0 or gid=0 are invalid values */
/* also check that the id is in the valid range for this domain
@@ -752,7 +753,7 @@ handle_getgr_result(enum nss_status status, struct group *grp,
break;
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_FUNC_DATA, ("Group found: (%s, %d)\n",
+ DEBUG(SSSDBG_FUNC_DATA, ("Group found: (%s, %"SPRIgid")\n",
grp->gr_name, grp->gr_gid));
/* gid=0 is an invalid value */
@@ -922,7 +923,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
bool delete_group = false;
int ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Searching group by gid (%d)\n", gid));
+ DEBUG(SSSDBG_TRACE_FUNC, ("Searching group by gid (%"SPRIgid")\n", gid));
tmpctx = talloc_new(mem_ctx);
if (!tmpctx) {
@@ -957,8 +958,8 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
if (delete_group) {
DEBUG(SSSDBG_TRACE_FUNC,
- ("Group %d does not exist (or is invalid) on remote server,"
- " deleting!\n", gid));
+ ("Group %"SPRIgid" does not exist (or is invalid) on remote "
+ "server, deleting!\n", gid));
ret = sysdb_delete_group(sysdb, dom, NULL, gid);
if (ret == ENOENT) {
@@ -978,7 +979,7 @@ done:
talloc_zfree(tmpctx);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE,
- ("proxy -> getgrgid_r failed for '%d' <%d>: %s\n",
+ ("proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n",
gid, ret, strerror(ret)));
}
return ret;
@@ -1077,7 +1078,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_OP_FAILURE, ("Group found (%s, %d)\n",
+ DEBUG(SSSDBG_OP_FAILURE, ("Group found (%s, %"SPRIgid")\n",
grp->gr_name, grp->gr_gid));
/* gid=0 is an invalid value */
@@ -1334,7 +1335,7 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx,
case NSS_STATUS_NOTFOUND:
DEBUG(SSSDBG_FUNC_DATA, ("The initgroups call returned 'NOTFOUND'. "
"Assume the user is only member of its "
- "primary group (%d)\n", pwd->pw_gid));
+ "primary group (%"SPRIgid")\n", pwd->pw_gid));
/* fall through */
case NSS_STATUS_SUCCESS:
DEBUG(SSSDBG_CONF_SETTINGS, ("User [%s] appears to be member of %lu"
diff --git a/src/providers/simple/simple_access_check.c b/src/providers/simple/simple_access_check.c
index 7335135e..5c2884ab 100644
--- a/src/providers/simple/simple_access_check.c
+++ b/src/providers/simple/simple_access_check.c
@@ -245,7 +245,7 @@ simple_resolve_group_check(struct simple_resolve_group_state *state)
group_attrs, &group);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("Could not look up group by gid [%lu]: [%d][%s]\n",
+ ("Could not look up group by gid [%"SPRIgid"]: [%d][%s]\n",
state->gid, ret, sss_strerror(ret)));
return ret;
}
@@ -470,7 +470,7 @@ static void simple_check_get_groups_next(struct tevent_req *subreq)
talloc_zfree(subreq);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("Could not resolve name of group with GID %llu\n",
+ ("Could not resolve name of group with GID %"SPRIgid"\n",
state->lookup_gids[state->giter]));
tevent_req_error(req, ret);
return;
@@ -545,7 +545,7 @@ simple_check_process_group(struct simple_check_groups_state *state,
/* Non-posix group with a GID. Needs resolving */
state->lookup_gids[state->num_gids] = gid;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding GID %llu\n", gid));
+ DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding GID %"SPRIgid"\n", gid));
state->num_gids++;
return EOK;
}
@@ -564,7 +564,7 @@ simple_check_get_groups_primary(struct simple_check_groups_state *state,
gid, group_attrs, &msg);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("Could not look up primary group [%lu]: [%d][%s]\n",
+ ("Could not look up primary group [%"SPRIgid"]: [%d][%s]\n",
gid, ret, sss_strerror(ret)));
/* We have to treat this as non-fatal, because the primary
* group may be local to the machine and not available in
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c
index a1f44789..1f95b1b6 100644
--- a/src/responder/common/negcache.c
+++ b/src/responder/common/negcache.c
@@ -393,7 +393,7 @@ int sss_ncache_check_gid(struct sss_nc_ctx *ctx, int ttl, gid_t gid)
char *str;
int ret;
- str = talloc_asprintf(ctx, "%s/%u", NC_GID_PREFIX, gid);
+ str = talloc_asprintf(ctx, "%s/%"SPRIgid, NC_GID_PREFIX, gid);
if (!str) return ENOMEM;
ret = sss_ncache_check_str(ctx, str, ttl);
@@ -524,7 +524,7 @@ int sss_ncache_set_gid(struct sss_nc_ctx *ctx, bool permanent, gid_t gid)
char *str;
int ret;
- str = talloc_asprintf(ctx, "%s/%u", NC_GID_PREFIX, gid);
+ str = talloc_asprintf(ctx, "%s/%"SPRIgid, NC_GID_PREFIX, gid);
if (!str) return ENOMEM;
ret = sss_ncache_set_str(ctx, str, permanent);