-
-#if 0
- free(s);
- close(pipefd[0]);
-
- retval=dopam(&pamh);
-
- if (retval == PAM_SUCCESS)
- retval=pam_open_session(pamh, 0);
-
- if (retval != PAM_SUCCESS)
- {
- if (pam_end(pamh, retval) != PAM_SUCCESS)
- perror("Unable to release PAM tokens");
-
- /* Wait for child to terminate */
-
- close(pipefd[1]); /* Tell the child to shut down */
- while (wait(&waitstat) != p)
- ;
- return (-1);
- }
-
- /* Tell child process to run in authenticated state */
-
- write(pipefd[1], "", 1);
- close(pipefd[1]);
-
- /* Wait for child process to finish */
-
- while (wait(&waitstat) != p)
- ;
-
- retval=pam_close_session(pamh, 0);
- if (retval != PAM_SUCCESS)
- perror("pam_close_session");
-
- if (pam_end(pamh, retval) != PAM_SUCCESS)
- perror("Unable to release PAM tokens");
-
- if (WIFEXITED(waitstat))
- exit(WEXITSTATUS(waitstat));
- exit(255);
- return (1);
-#endif