[Freeipa-devel] sssd on suse

Simo Sorce ssorce at redhat.com
Tue Mar 31 17:53:28 UTC 2009


On Tue, 2009-03-31 at 19:44 +0200, Sumit Bose wrote:
>  #include <security/pam_misc.h>
> 
> +/* for older suse versions */
> +#ifndef _pam_overwrite_n
> +#define _pam_overwrite_n(x,n)   \
> +do {                             \
> +     register char *__xx__;      \
> +     register unsigned int __i__ = 0;    \
> +     if ((__xx__=(x)))           \

Are you really ^^^ checking that x != 0 while at the same time assigning
it to __xx__ ? If so at least a comment is warrant. Attached how I'd
write it if checking x for NULL is the point with the same number of
lines but in a much cleaner way (IMO).

> +        for (;__i__<n; __i__++) \
> +            __xx__[__i__] = 0; \
> +} while (0)
> +#endif
> +
> +
>  #include "sss_cli.h"

#define _pam_overwrite_n(x,n)   \
do {                             \
     register char *__xx__;      \
     register unsigned int __i__ = 0;    \
     if (!(x)) break;           \
     for (__xx__=(x); __i__ < n; __i__++) \
          __xx__[__i__] = 0; \
} while (0)


Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list