diff options
author | des <des@FreeBSD.org> | 2002-04-04 15:50:47 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-04-04 15:50:47 +0000 |
commit | 4532f219fa85b9c06b3f4caaa4dcbbdbf3bd32f5 (patch) | |
tree | 1dcc5978e4a3b724654b82d0e61f6dc3e94705ee /contrib/pam_modules/pam_passwdqc/pam_macros.h | |
download | FreeBSD-src-4532f219fa85b9c06b3f4caaa4dcbbdbf3bd32f5.zip FreeBSD-src-4532f219fa85b9c06b3f4caaa4dcbbdbf3bd32f5.tar.gz |
Vendor import of Solar Designer's pam_passwdqc module.
Diffstat (limited to 'contrib/pam_modules/pam_passwdqc/pam_macros.h')
-rw-r--r-- | contrib/pam_modules/pam_passwdqc/pam_macros.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/pam_modules/pam_passwdqc/pam_macros.h b/contrib/pam_modules/pam_passwdqc/pam_macros.h new file mode 100644 index 0000000..adc04bc --- /dev/null +++ b/contrib/pam_modules/pam_passwdqc/pam_macros.h @@ -0,0 +1,28 @@ +/* + * These macros are partially based on Linux-PAM's <security/_pam_macros.h>, + * which were organized by Cristian Gafton and I believe are in the public + * domain. + */ + +#if !defined(_PAM_MACROS_H) && !defined(_pam_overwrite) +#define _PAM_MACROS_H + +#include <string.h> +#include <stdlib.h> + +#define _pam_overwrite(x) \ + memset((x), 0, strlen((x))) + +#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \ +do { \ + int i; \ +\ + for (i = 0; i < (replies); i++) \ + if ((reply)[i].resp) { \ + _pam_overwrite((reply)[i].resp); \ + free((reply)[i].resp); \ + } \ + if ((reply)) free((reply)); \ +} while (0) + +#endif |