diff options
author | 2006-09-02 00:20:34 -0700 | |
---|---|---|
committer | 2006-09-02 00:20:34 -0700 | |
commit | 38fd15d11765396ec95bb093dde0d46786a530bc (patch) | |
tree | 1389310325e20869a3f7b9f530940f88d6b8641a /sys-apps/shadow/files/login_defs.awk | |
parent | xsri: keyword ~ppc (diff) | |
download | dberkholz-38fd15d11765396ec95bb093dde0d46786a530bc.tar.gz dberkholz-38fd15d11765396ec95bb093dde0d46786a530bc.tar.bz2 dberkholz-38fd15d11765396ec95bb093dde0d46786a530bc.zip |
shadow: install /etc/default/useradd world-readable for libuser
Diffstat (limited to 'sys-apps/shadow/files/login_defs.awk')
-rw-r--r-- | sys-apps/shadow/files/login_defs.awk | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys-apps/shadow/files/login_defs.awk b/sys-apps/shadow/files/login_defs.awk new file mode 100644 index 0000000..56087c6 --- /dev/null +++ b/sys-apps/shadow/files/login_defs.awk @@ -0,0 +1,32 @@ +# Fixes up login defs for PAM by commenting all non-PAM options and adding a +# comment that it is not supported with PAM. +# +# Call with lib/getdef.c and etc/login.defs as args in the root source directory +# of shadow, ie: +# +# gawk -f login_defs.awk lib/getdef.c etc/login.defs > login.defs.new +# + +(FILENAME == "lib/getdef.c") { + if ($2 == "USE_PAM") + start_printing = 1 + else if ($1 == "#endif") + nextfile + else if (start_printing == 1) + VARS[count++] = substr($1, 3, length($1) - 4) +} + +(FILENAME != "lib/getdef.c") { + print_line = 1 + for (x in VARS) { + regex = "(^|#)" VARS[x] + if ($0 ~ regex) { + print_line = 0 + printf("%s%s\t(NOT SUPPORTED WITH PAM)\n", + ($0 ~ /^#/) ? "" : "#", $0) + } + } + if (print_line) + print $0 +} + |