More pam warning cleanups - test_pam.c

Clear up a few more warnings in the pam code.  The changes here
are very similar to the ones in the previous patch and use
the same configure test:
- use PAM_CONST to conditionally declare pam_message as const
- cast a few arguments to putenv, which expects a non-const pointer

Change-Id: I6c98623c35f4453f34c1d48b8b7d6ff1bfbc1e0c
Reviewed-on: http://gerrit.openafs.org/1116
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Marc Dionne 2010-01-16 17:40:52 -05:00 committed by Derrick Brashear
parent fdee40d8ea
commit 9f79dde2c8

View File

@ -18,7 +18,7 @@
#include <unistd.h> #include <unistd.h>
static int my_conv(int num_msg, struct pam_message **msg, static int my_conv(int num_msg, PAM_CONST struct pam_message **msg,
struct pam_response **response, void *appdata_ptr); struct pam_response **response, void *appdata_ptr);
@ -97,8 +97,8 @@ main(int argc, char *argv[])
} }
pam_end(pamh, PAM_SUCCESS); pam_end(pamh, PAM_SUCCESS);
putenv(new_envstring); putenv((char *)new_envstring);
putenv(new_homestring); putenv((char *)new_homestring);
chdir("/tmp"); chdir("/tmp");
printf("Type exit to back out.\n"); printf("Type exit to back out.\n");
execl("/bin/csh", "/bin/csh", NULL); execl("/bin/csh", "/bin/csh", NULL);
@ -106,10 +106,10 @@ main(int argc, char *argv[])
static int static int
my_conv(int num_msg, struct pam_message **msg, struct pam_response **response, my_conv(int num_msg, PAM_CONST struct pam_message **msg, struct pam_response **response,
void *appdata_ptr) void *appdata_ptr)
{ {
struct pam_message *m; PAM_CONST struct pam_message *m;
struct pam_response *r; struct pam_response *r;
char *p; char *p;