[SSSD] [PATCH] Supress warnings with -O2

Sumit Bose sbose at redhat.com
Mon Feb 15 10:42:55 UTC 2010


On Fri, Feb 12, 2010 at 02:21:40PM +0100, Jakub Hrozek wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I noticed that there were some warnings about uninitialized variables
> when compiling with -O2, some of them legit (sysdb.c, krb5_auth.c,
> pamsrv_cmd.c) some of them a little spurious but I think the extra
> assignments are worth the clean compile.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkt1VeMACgkQHsardTLnvCWZJgCfcyj1iZfB4Hnp27V5k43vrEmg
> vXUAnA3YblUTP4YNOlPv1HWB7ygyAdCZ
> =8ow7
> -----END PGP SIGNATURE-----

Hi,

I would solve two issues differently:

> diff --git a/server/providers/krb5/krb5_auth.c b/server/providers/krb5/krb5_auth.c
> index 6adaab9..6b6554a 100644
> --- a/server/providers/krb5/krb5_auth.c
> +++ b/server/providers/krb5/krb5_auth.c
> @@ -761,7 +761,8 @@ static void get_user_attr_done(void *pvt, int err, struct ldb_result *res)
>      ret = krb5_setup(be_req, &kr);
>      if (ret != EOK) {
>          DEBUG(1, ("krb5_setup failed.\n"));
> -        goto failed;
> +        krb_reply(be_req, dp_err, pam_status);
> +        return;
>      }
>
>      pd = kr->pd;

I would prefer to say 'pd = talloc_get_type(be_req->req_data, struct pam_data);'
before krb5_setup() and remove the 'pd = kr->pd;'.

> diff --git a/server/responder/pam/pamsrv_cmd.c b/server/responder/pam/pamsrv_cmd.c
> index c204e0a..45049ff 100644
> --- a/server/responder/pam/pamsrv_cmd.c
> +++ b/server/responder/pam/pamsrv_cmd.c
> @@ -505,7 +505,8 @@ static void pam_reply(struct pam_auth_req *preq)
>                      if (ret != EOK) {
>                          DEBUG(0, ("Fatal: Sysdb CTX not found for "
>                                    "domain [%s]!\n", preq->domain->name));
> -                        goto done;
> +                        sss_cmd_done(preq->cctx, preq);
> +                        return;
>                      }
>  
>                      pctx = talloc_get_type(preq->cctx->rctx->pvt_ctx,

instead of calling sss_cmd_done() with preq->cctx I would prefer to move
the assignment 'cctx = preq->cctx;' up.

bye,
Sumit



More information about the sssd-devel mailing list