summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-04-26 23:36:24 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-04-30 07:51:19 -0400
commitb830ab156f032e2a8823f1365da2ed6801427e8f (patch)
treea3a9bb5a7fcf31d45889199d1876f3025b5bdfc8 /src
parent0d72f05cc87f42a8c2856c96501c64d69541be00 (diff)
downloadsssd_unused-b830ab156f032e2a8823f1365da2ed6801427e8f.tar.gz
sssd_unused-b830ab156f032e2a8823f1365da2ed6801427e8f.tar.xz
sssd_unused-b830ab156f032e2a8823f1365da2ed6801427e8f.zip
Silence warnings with -O2
Diffstat (limited to 'src')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c6
-rw-r--r--src/providers/proxy.c24
-rw-r--r--src/tools/sss_sync_ops.c8
3 files changed, 26 insertions, 12 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index bdaa9e9e..f949e46a 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -56,10 +56,12 @@ static int sdap_save_user(TALLOC_CTX *memctx,
ret = sysdb_attrs_get_el(attrs,
opts->user_map[SDAP_AT_USER_NAME].sys_name, &el);
- if (ret) goto fail;
if (el->num_values == 0) {
ret = EINVAL;
- goto fail;
+ }
+ if (ret) {
+ DEBUG(1, ("Failed to save the user - entry has no name attribute\n"));
+ return ret;
}
name = (const char *)el->values[0].data;
diff --git a/src/providers/proxy.c b/src/providers/proxy.c
index 4da89ccc..c7aef308 100644
--- a/src/providers/proxy.c
+++ b/src/providers/proxy.c
@@ -430,14 +430,18 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx,
pwd = talloc_zero(tmpctx, struct passwd);
if (!pwd) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getpwuid_r failed for '%d': [%d] %s\n",
+ uid, ret, strerror(ret)));
+ return ret;
}
buflen = DEFAULT_BUFSIZE;
buffer = talloc_size(tmpctx, buflen);
if (!buffer) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getpwuid_r failed for '%d': [%d] %s\n",
+ uid, ret, strerror(ret)));
+ return ret;
}
status = ctx->ops.getpwuid_r(uid, pwd, buffer, buflen, &ret);
@@ -687,14 +691,18 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
grp = talloc(tmpctx, struct group);
if (!grp) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getgrnam_r failed for '%s': [%d] %s\n",
+ name, ret, strerror(ret)));
+ return ret;
}
buflen = DEFAULT_BUFSIZE;
buffer = talloc_size(tmpctx, buflen);
if (!buffer) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getgrnam_r failed for '%s': [%d] %s\n",
+ name, ret, strerror(ret)));
+ return ret;
}
/* FIXME: should we move this call outside the transaction to keep the
@@ -835,14 +843,18 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
grp = talloc(tmpctx, struct group);
if (!grp) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getgrgid_r failed for '%d': [%d] %s\n",
+ gid, ret, strerror(ret)));
+ return ret;
}
buflen = DEFAULT_BUFSIZE;
buffer = talloc_size(tmpctx, buflen);
if (!buffer) {
ret = ENOMEM;
- goto done;
+ DEBUG(1, ("proxy -> getgrgid_r failed for '%d': [%d] %s\n",
+ gid, ret, strerror(ret)));
+ return ret;
}
again:
diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c
index 45fd5731..a92f8caa 100644
--- a/src/tools/sss_sync_ops.c
+++ b/src/tools/sss_sync_ops.c
@@ -198,8 +198,8 @@ int usermod(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
struct ops_ctx *data)
{
- struct sysdb_attrs *attrs;
- struct ldb_dn *member_dn;
+ struct sysdb_attrs *attrs = NULL;
+ struct ldb_dn *member_dn = NULL;
int ret;
if (data->addgroups || data->rmgroups) {
@@ -258,8 +258,8 @@ int groupmod(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
struct ops_ctx *data)
{
- struct sysdb_attrs *attrs;
- struct ldb_dn *member_dn;
+ struct sysdb_attrs *attrs = NULL;
+ struct ldb_dn *member_dn = NULL;
int ret;
if (data->addgroups || data->rmgroups) {