summaryrefslogtreecommitdiff
path: root/conf/pam_conv1
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 12:44:11 -0800
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 12:44:11 -0800
commitefd31890b5ed496a5a00c08a262da240e66a4ddc (patch)
tree22a7aab22b3a491bb58df250d7d6409e0c160bcc /conf/pam_conv1
parent067affee9267fa0d1c21835182ba639ba33e820f (diff)
New upstream version 0.76
Diffstat (limited to 'conf/pam_conv1')
-rw-r--r--conf/pam_conv1/.cvsignore3
-rw-r--r--conf/pam_conv1/Makefile46
-rw-r--r--conf/pam_conv1/README10
-rw-r--r--conf/pam_conv1/pam_conv.lex42
-rw-r--r--conf/pam_conv1/pam_conv.y204
5 files changed, 0 insertions, 305 deletions
diff --git a/conf/pam_conv1/.cvsignore b/conf/pam_conv1/.cvsignore
deleted file mode 100644
index 200a991e..00000000
--- a/conf/pam_conv1/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-lex.yy.c
-pam_conv.tab.c
-pam_conv1
diff --git a/conf/pam_conv1/Makefile b/conf/pam_conv1/Makefile
deleted file mode 100644
index 2fda767e..00000000
--- a/conf/pam_conv1/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id$
-#
-
-include ../../Make.Rules
-
-#
-ifeq ($(OS),solaris)
-
-clean:
- @echo not available in Solaris
-
-all:
- @echo not available in Solaris
-
-install:
- @echo not available in Solaris
-
-else
-
-all: pam_conv1
-
-pam_conv1: pam_conv.tab.c lex.yy.c
- $(CC) -o pam_conv1 pam_conv.tab.c $(LINK_LIBLEX)
-
-pam_conv.tab.c: pam_conv.y lex.yy.c
- bison pam_conv.y
-
-lex.yy.c: pam_conv.lex
- flex pam_conv.lex
-
-lclean:
- rm -f core pam_conv1 lex.yy.c pam_conv.tab.c *.o *~
- rm -rf ./pam.d pam_conv.output
-
-clean: lclean
-
-install: pam_conv1
- cp -f ./pam_conv1 ../../bin
-
-endif
-
-remove:
- rm -f ../../bin/pam_conv1
-
-extraclean: remove clean
diff --git a/conf/pam_conv1/README b/conf/pam_conv1/README
deleted file mode 100644
index 8d420ce4..00000000
--- a/conf/pam_conv1/README
+++ /dev/null
@@ -1,10 +0,0 @@
-$Id$
-
-This directory contains a untility to convert pam.conf files to a pam.d/
-tree. The conversion program takes pam.conf from the standard input and
-creates the pam.d/ directory in the current directory.
-
-The program will fail if ./pam.d/ already exists.
-
-Andrew Morgan, February 1997
-
diff --git a/conf/pam_conv1/pam_conv.lex b/conf/pam_conv1/pam_conv.lex
deleted file mode 100644
index a7df2b06..00000000
--- a/conf/pam_conv1/pam_conv.lex
+++ /dev/null
@@ -1,42 +0,0 @@
-
-%{
-/*
- * $Id$
- *
- * Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
- *
- * This file is covered by the Linux-PAM License (which should be
- * distributed with this file.)
- */
-
- const static char lexid[]=
- "$Id$\n"
- "Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>\n";
-
- extern int current_line;
-%}
-
-%%
-
-"#"[^\n]* ; /* skip comments (sorry) */
-
-"\\\n" {
- ++current_line;
-}
-
-([^\n\t ]|[\\][^\n])+ {
- return TOK;
-}
-
-[ \t]+ ; /* Ignore */
-
-<<EOF>> {
- return EOFILE;
-}
-
-[\n] {
- ++current_line;
- return NL;
-}
-
-%%
diff --git a/conf/pam_conv1/pam_conv.y b/conf/pam_conv1/pam_conv.y
deleted file mode 100644
index f42b634e..00000000
--- a/conf/pam_conv1/pam_conv.y
+++ /dev/null
@@ -1,204 +0,0 @@
-%{
-
-/*
- * $Id$
- *
- * Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
- *
- * This file is covered by the Linux-PAM License (which should be
- * distributed with this file.)
- */
-
- const static char bisonid[]=
- "$Id$\n"
- "Copyright (c) Andrew G. Morgan 1997-8 <morgan@linux.kernel.org>\n";
-
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
- int current_line=1;
- extern char *yytext;
-
-/* XXX - later we'll change this to be the specific conf file(s) */
-#define newpamf stderr
-
-#define PAM_D "./pam.d"
-#define PAM_D_MODE 0755
-#define PAM_D_MAGIC_HEADER \
- "#%PAM-1.0\n" \
- "#[For version 1.0 syntax, the above header is optional]\n"
-
-#define PAM_D_FILE_FMT PAM_D "/%s"
-
- const char *old_to_new_ctrl_flag(const char *old);
- void yyerror(const char *format, ...);
-%}
-
-%union {
- int def;
- char *string;
-}
-
-%token NL EOFILE TOK
-
-%type <string> tok path tokenls
-
-%start complete
-
-%%
-
-complete
-:
-| complete NL
-| complete line
-| complete EOFILE {
- return 0;
-}
-;
-
-line
-: tok tok tok path tokenls NL {
- char *filename;
- FILE *conf;
- int i;
-
- /* make sure we have lower case */
- for (i=0; $1[i]; ++i) {
- $1[i] = tolower($1[i]);
- }
-
- /* $1 = service-name */
- yyerror("Appending to " PAM_D "/%s", $1);
-
- filename = malloc(strlen($1) + sizeof(PAM_D) + 6);
- sprintf(filename, PAM_D_FILE_FMT, $1);
- conf = fopen(filename, "r");
- if (conf == NULL) {
- /* new file */
- conf = fopen(filename, "w");
- if (conf != NULL) {
- fprintf(conf, PAM_D_MAGIC_HEADER);
- fprintf(conf,
- "#\n"
- "# The PAM configuration file for the `%s' service\n"
- "#\n", $1);
- }
- } else {
- fclose(conf);
- conf = fopen(filename, "a");
- }
- if (conf == NULL) {
- yyerror("trouble opening %s - aborting", filename);
- exit(1);
- }
- free(filename);
-
- /* $2 = module-type */
- fprintf(conf, "%-10s", $2);
- free($2);
-
- /* $3 = required etc. */
- {
- const char *trans;
-
- trans = old_to_new_ctrl_flag($3);
- free($3);
- fprintf(conf, " %-10s", trans);
- }
-
- /* $4 = module-path */
- fprintf(conf, " %s", $4);
- free($4);
-
- /* $5 = arguments */
- if ($5 != NULL) {
- fprintf(conf, " \\\n\t\t%s", $5);
- free($5);
- }
-
- /* end line */
- fprintf(conf, "\n");
-
- fclose(conf);
-}
-| error NL {
- yyerror("malformed line");
-}
-;
-
-tokenls
-: {
- $$=NULL;
-}
-| tokenls tok {
- int len;
-
- if ($1) {
- len = strlen($1) + strlen($2) + 2;
- $$ = malloc(len);
- sprintf($$,"%s %s",$1,$2);
- free($1);
- free($2);
- } else {
- $$ = $2;
- }
-}
-;
-
-path
-: TOK {
- /* XXX - this could be used to check if file present */
- $$ = strdup(yytext);
-}
-
-tok
-: TOK {
- $$ = strdup(yytext);
-}
-
-%%
-
-#include "lex.yy.c"
-
-const char *old_to_new_ctrl_flag(const char *old)
-{
- static const char *clist[] = {
- "requisite",
- "required",
- "sufficient",
- "optional",
- NULL,
- };
- int i;
-
- for (i=0; clist[i]; ++i) {
- if (strcasecmp(clist[i], old) == 0) {
- break;
- }
- }
-
- return clist[i];
-}
-
-void yyerror(const char *format, ...)
-{
- va_list args;
-
- fprintf(stderr, "line %d: ", current_line);
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- fprintf(stderr, "\n");
-}
-
-int main(int argc, char *argv[])
-{
- if (mkdir(PAM_D, PAM_D_MODE) != 0) {
- yyerror(PAM_D " already exists.. aborting");
- exit(1);
- }
- yyparse();
- exit(0);
-}