diff --git a/en_US.ISO8859-1/articles/pam/Makefile b/en_US.ISO8859-1/articles/pam/Makefile index 27aeb7f607..059a7db3ed 100644 --- a/en_US.ISO8859-1/articles/pam/Makefile +++ b/en_US.ISO8859-1/articles/pam/Makefile @@ -9,7 +9,12 @@ INSTALL_ONLY_COMPRESSED?= JADEFLAGS+= -V %generate-article-toc% -SRCS= article.sgml +SRCS= article.sgml pam_app.c + +CLEANFILES+= pam_app.c + +pam_app.c: su.c + perl -ne 'print unless m|^[/ ]\*|' su.c >${.TARGET} DOC_PREFIX?= ${.CURDIR}/../../.. diff --git a/en_US.ISO8859-1/articles/pam/article.sgml b/en_US.ISO8859-1/articles/pam/article.sgml index 6e201c18cd..fb72382d8a 100644 --- a/en_US.ISO8859-1/articles/pam/article.sgml +++ b/en_US.ISO8859-1/articles/pam/article.sgml @@ -1,14 +1,6 @@ %man; - %freebsd; - %newsgroups; - -%authors; - %mailing-lists; - - ]> +/*- + * Copyright (c) 2002 Networks Associates Technologies, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by ThinkSec AS and + * NAI Labs, the Security Research Division of Network Associates, Inc. + * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ -#include <sys/param.h> -#include <sys/wait.h> +#include +#include -#include <err.h> -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <termios.h> -#include <unistd.h> +#include +#include +#include +#include -#include <security/pam_appl.h> - -extern int -converse(int n, - const struct pam_message **msg, - struct pam_response **resp, - void *data); +#include +#include static pam_handle_t *pamh; static struct pam_conv pamc; @@ -91,14 +83,14 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc > 0) + if (argc > 0) user = *argv; else user = "root"; /* initialize PAM */ - pamc.conv = &converse; - pam_start("su", user, &pamc, &pamh); + pamc.conv = &misc_conv; + pam_start("su", user, &pamc, &pamh); /* set some items */ gethostname(hostname, sizeof hostname); @@ -131,7 +123,7 @@ main(int argc, char *argv[]) err(1, "execvp()"); default: /* parent: wait for child to exit */ - waitpid(pid, &status, 0); + waitpid(pid, &status, 0); if (WIFEXITED(status)) status = WEXITSTATUS(status); else @@ -143,4 +135,4 @@ main(int argc, char *argv[]) check("pam_end", pam_end(pamh, 0)); exit(status); -} +}