Commit Graph

33 Commits

Author SHA1 Message Date
Christian Göttsche
dc370deab4 conf/modules: constify read-only data arrays 2024-02-22 16:04:15 +00:00
Tobias Stoeckmann
2e375aad04 treewide: use asprintf to construct strings
The asprintf function is considered as given for current code already.
Use it instead of calling malloc + strcpy + strcat manually.

Reported-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-19 12:22:59 +00:00
Tobias Stoeckmann
e07917e98c conf/pam_conv1: use return instead of exit in main
Calling exit directly circumvents the stack protector of the main
function. Give it a chance to notice issues.

Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Tobias Stoeckmann
1edcc33af2 conf/pam_conv1: check strdup results
The strdup function my fail. Check its return value and handle the
failure accordingly.

Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Tobias Stoeckmann
5b6b264d4d conf/pam_conv1: fix memory leak
Free service name after processing, since it is not used anymore after
the filename has been created.

Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Tobias Stoeckmann
b6691ab457 conv/pam_conv1: use correct line number in output
The line number increments occur before the line is passed to
parsing logic due to NL token through lex. Start counting at 0
get this offset right.

Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Tobias Stoeckmann
e1fb4764cd conf/pam_conv1: Avoid signed line numbers
Very long input files could overflow the signed integer, which is
undefined behavior. Avoid it by using a large unsigned type.

Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Christian Göttsche
2770046cd8 conf: cast to unsigned char for character handling function
Character handling functions, like isspace(3), expect a value
representable as unsigned char or equal to EOF.  Otherwise the behavior
is undefined.

See https://wiki.sei.cmu.edu/confluence/display/c/STR37-C.+Arguments+to+character-handling+functions+must+be+representable+as+an+unsigned+char
2023-08-07 10:46:40 +00:00
Dmitry V. Levin
d702ff714c Remove deprecated pam_cracklib module
* ci/install-dependencies.sh: Remove libcrack2-dev.
* ci/run-build-and-tests.sh (DISTCHECK_CONFIGURE_FLAGS): Remove
--enable-cracklib=check.
* conf/pam.conf: Remove references to pam_cracklib.so.
* configure.ac: Remove --enable-cracklib option.
(AC_SUBST): Remove LIBCRACK.
(AM_CONDITIONAL): Remove COND_BUILD_PAM_CRACKLIB.
(AC_CONFIG_FILES): Remove modules/pam_cracklib/Makefile.
* doc/sag/pam_cracklib.xml: Remove.
* doc/sag/Linux-PAM_SAG.xml: Do not include pam_cracklib.xml.
* modules/Makefile.am (MAYBE_PAM_CRACKLIB): Remove.
(SUBDIRS): Remove MAYBE_PAM_CRACKLIB.
* modules/pam_cracklib/Makefile.am: Remove.
* modules/pam_cracklib/README.xml: Likewise.
* modules/pam_cracklib/pam_cracklib.8.xml: Likewise.
* modules/pam_cracklib/pam_cracklib.c: Likewise.
* modules/pam_cracklib/tst-pam_cracklib: Likewise.
* xtests/tst-pam_cracklib1.c: Likewise.
* xtests/tst-pam_cracklib1.pamd: Likewise.
* xtests/tst-pam_cracklib2.c: Likewise.
* xtests/tst-pam_cracklib2.pamd: Likewise.
* modules/pam_pwhistory/pam_pwhistory.8.xml: Replace pam_cracklib
in examples with pam_passwdqc.
* modules/pam_unix/pam_unix.8.xml: Likewise.
* po/POTFILES.in: Remove ./modules/pam_cracklib/pam_cracklib.c.
* xtests/.gitignore: Remove tst-pam_cracklib1 and tst-pam_cracklib2.
* xtests/Makefile.am (EXTRA_DIST): Remove tst-pam_cracklib1.pamd
and tst-pam_cracklib2.pamd.
(XTESTS): Remove tst-pam_cracklib1 and tst-pam_cracklib2.
* NEWS: Document this change.
2020-10-29 08:00:00 +00:00
Christian Göttsche
b303486bf1 Add missing format function attributes and enable -Wmissing-format-attribute
Exported functions already have these attributes, add them to other functions.
This enables compilers to find format specifier mismatches, like:

   foo_print("Hello %d", "world")

* m4/warn_lang_flags.m4 (gl_WARN_ADD): Add -Wmissing-format-attribute.
* conf/pam_conv1/Makefile.am (AM_CFLAGS): Add -I$(top_srcdir)/libpam/include.
* conf/pam_conv1/pam_conv_y.y: Include <security/_pam_types.h>.
(yyerror): Add printf format attribute.
* modules/pam_pwhistory/opasswd.c (helper_log_err): Likewise.
* modules/pam_rootok/pam_rootok.c (log_callback): Likewise.
* modules/pam_tally/pam_tally.c (tally_log): Likewise.
* modules/pam_tally2/pam_tally2.c (tally_log): Likewise.
* modules/pam_unix/passverify.c (helper_log_err): Likewise.
2020-10-25 08:00:00 +00:00
Dmitry V. Levin
897c7412b2 Fix various typos found using codespell tool 2020-03-28 18:19:41 +00:00
Dmitry V. Levin
a6c963b6f8 conf/pam_conv1: fix clang compilation warnings
Fix the following compilation warnings reported by clang:

  pam_conv_y.y:12:23: warning: unused variable 'bisonid' [-Wunused-const-variable]
      static const char bisonid[]=
                        ^
  pam_conv_l.l:12:23: warning: unused variable 'lexid' [-Wunused-const-variable]
      static const char lexid[]=
                        ^

These static variables lost their meaning after repository conversion
from cvs to git and can be safely removed.

* conf/pam_conv1/pam_conv_l.l (lexid): Remove.
* conf/pam_conv1/pam_conv_y.y (bisonid): Remove.
2020-03-19 18:40:16 +00:00
Tomas Mraz
1781f0165c Do not use CFLAGS for warning flags set from configure
To be able to set CFLAGS from make command-line but not to lose the
warning flags.

* configure.ac: Put warning flags to WARN_CFLAGS instead of CFLAGS.
* */Makefile.am: Apply WARN_CFLAGS to AM_CFLAGS.
2019-12-18 13:59:44 +01:00
Tomas Mraz
03f46bbe3f Fix or suppress various warnings when compiling with -Wall -Wextra
* conf/pam_conv1/Makefile.am: Add -Wno-unused-function -Wno-sign-compare to CFLAGS.
* doc/specs/Makefile.am: Likewise.

* libpamc/include/security/pam_client.h: Explicitly compare old_p with NULL.

* modules/pam_access/pam_access.c: Avoid double const.

* modules/pam_filter/pam_filter.c: Avoid arbitrary constants. Avoid strncpy()
without copying the NUL byte.

* modules/pam_group/pam_group.c: Mark switch fallthrough with comment.
* modules/pam_time/pam_time.c: Likewise.

* modules/pam_limits/pam_limits.c: Remove unused units variable.

* modules/pam_listfile/pam_listfile.c: Avoid unnecessary strncpy, use pointers.

* modules/pam_rootok/pam_rootok.c (log_callback): Mark unused parameter.

* modules/pam_selinux/pam_selinux.c: Use string_to_security_class() instead
of hardcoded value.

* modules/pam_sepermit/pam_sepermit.c: Properly cast when comparing.

* modules/pam_succeed_if/pam_succeed_if.c: Mark unused parameters.

* modules/pam_unix/pam_unix_passwd.c: Remove unused variables and properly
cast for comparison.

* modules/pam_unix/support.c: Remove unused function.
2019-12-16 10:49:03 +01:00
Dmitry V. Levin
8da3f3c38e Do not use yywrap (ticket #42)
Our scanners do not really use yywrap.  Explicitly disable yywrap
so that no references to yywrap will be generated and no LEXLIB
would be needed.

* conf/pam_conv1/Makefile.am (pam_conv1_LDADD): Remove.
* conf/pam_conv1/pam_conv_l.l: Enable noyywrap option.
* doc/specs/Makefile.am (padout_LDADD): Remove.
* doc/specs/parse_l.l: Enable noyywrap option.
2014-12-09 10:12:21 +00:00
Dmitry V. Levin
3e7fb3233e Update .gitignore files
* .gitignore: Add common ignore patterns.
* m4/.gitignore: Unignore local m4 files.
* dynamic/.gitignore: Unignore Makefile.
* libpamc/test/modules/.gitignore: Likewise.
* libpamc/test/regress/.gitignore: Likewise.
* po/.gitignore: Add Makevars.template.
* conf/.gitignore: Remove common ignore patterns.
* conf/pam_conv1/.gitignore: Likewise.
* doc/.gitignore: Likewise.
* doc/specs/.gitignore: Likewise.
* doc/specs/formatter/.gitignore: Likewise.
* examples/.gitignore: Likewise.
* modules/pam_filter/upperLOWER/.gitignore: Likewise.
* modules/pam_mkhomedir/.gitignore: Likewise.
* modules/pam_selinux/.gitignore: Likewise.
* modules/pam_stress/.gitignore: Likewise.
* modules/pam_tally/.gitignore: Likewise.
* modules/pam_tally2/.gitignore: Likewise.
* modules/pam_timestamp/.gitignore: Likewise.
* modules/pam_unix/.gitignore: Likewise.
* tests/.gitignore: Likewise.
* xtests/.gitignore: Likewise.
* doc/adg/.gitignore: Remove.
* doc/man/.gitignore: Remove.
* doc/mwg/.gitignore: Remove.
* doc/sag/.gitignore: Remove.
* libpamc/.gitignore: Remove.
* libpamc/test/.gitignore: Remove.
* libpam/.gitignore: Remove.
* libpam_misc/.gitignore: Remove.
* modules/.gitignore: Remove.
* modules/pam_access/.gitignore: Remove.
* modules/pam_cracklib/.gitignore: Remove.
* modules/pam_debug/.gitignore: Remove.
* modules/pam_deny/.gitignore: Remove.
* modules/pam_echo/.gitignore: Remove.
* modules/pam_env/.gitignore: Remove.
* modules/pam_exec/.gitignore: Remove.
* modules/pam_faildelay/.gitignore: Remove.
* modules/pam_filter/.gitignore: Remove.
* modules/pam_ftp/.gitignore: Remove.
* modules/pam_group/.gitignore: Remove.
* modules/pam_issue/.gitignore: Remove.
* modules/pam_keyinit/.gitignore: Remove.
* modules/pam_lastlog/.gitignore: Remove.
* modules/pam_limits/.gitignore: Remove.
* modules/pam_listfile/.gitignore: Remove.
* modules/pam_localuser/.gitignore: Remove.
* modules/pam_loginuid/.gitignore: Remove.
* modules/pam_mail/.gitignore: Remove.
* modules/pam_motd/.gitignore: Remove.
* modules/pam_namespace/.gitignore: Remove.
* modules/pam_nologin/.gitignore: Remove.
* modules/pam_permit/.gitignore: Remove.
* modules/pam_pwhistory/.gitignore: Remove.
* modules/pam_rhosts/.gitignore: Remove.
* modules/pam_rootok/.gitignore: Remove.
* modules/pam_securetty/.gitignore: Remove.
* modules/pam_sepermit/.gitignore: Remove.
* modules/pam_shells/.gitignore: Remove.
* modules/pam_succeed_if/.gitignore: Remove.
* modules/pam_time/.gitignore: Remove.
* modules/pam_tty_audit/.gitignore: Remove.
* modules/pam_umask/.gitignore: Remove.
* modules/pam_userdb/.gitignore: Remove.
* modules/pam_warn/.gitignore: Remove.
* modules/pam_wheel/.gitignore: Remove.
* modules/pam_xauth/.gitignore: Remove.
2011-10-27 14:55:55 +00:00
Dmitry V. Levin
c9c4faaf50 Rename all .cvsignore files to .gitignore 2011-10-27 14:55:55 +00:00
Dmitry V. Levin
1814aec611 Fix whitespace issues
Cleanup trailing whitespaces, indentation that uses spaces before tabs,
and blank lines at EOF.  Make the project free of warnings reported by
git diff --check 4b825dc642 HEAD
2011-10-26 23:56:54 +00:00
Thorsten Kukuk
05dbea9443 Relevant BUGIDs:
Purpose of commit: cleanup

Commit summary:
---------------

Remove wrongly added files.
2006-07-24 16:33:38 +00:00
Thorsten Kukuk
2d0b13cff8 Relevant BUGIDs:
Purpose of commit:

Commit summary:
---------------

Add missing renamed files
2006-07-24 16:14:40 +00:00
Thorsten Kukuk
65b0aeaecd Relevant BUGIDs:
Purpose of commit: bugfixes

Commit summary:
---------------

2006-07-24  Thorsten Kukuk  <kukuk@thkukuk.de>

        * doc/adg/Makefile.am: Add uninstall and distclean rules.
        * doc/mwg/Makefile.am: Likewise.
        * doc/sag/Makefile.am: Likewise.

2006-07-08  Daniel Richard G.  <skunk@iskunk.org>

        * conf/pam_conv1/Makefile.am: Fix rules for lex and yacc files.
        * conf/pam_conv1/pam_conv.lex: Rename to ...
        * conf/pam_conv1/pam_conv_l.l: ... this.
        * conf/pam_conv1/pam_conv.y: Rename to ...
        * conf/pam_conv1/pam_conv_y.y: ... this.
        * configure.in: Add AC_HELP_STRING()s to various AC_ARG_ENABLE()
        calls.
        * doc/Makefile.am: Fix rule to install index.html.
        * doc/adg/Makefile.am: Fix test usage.
        * doc/mwg/Makefile.am: Likewise.
        * doc/sag/Makefile.am: Likewise.
        * doc/specs/Makefile.am: Fix rules for lex and yacc files.
        * specs/parse.lex: Rename to ...
        * doc/specs/parse_l.l: ... this.
        * doc/specs/parse.y: Rename to ...
        * doc/specs/parse_y.y: ... this.
        * libpam/pam_account.c: Fix #if vs. #ifdef.
        * libpam/pam_audit.c: Likewise.
        * libpam/pam_auth.c: Likewise.
        * libpam/pam_password.c: Likewise.
        * libpam/pam_private.h: Likewise.
        * libpam/pam_session.c: Likewise.
        * libpam/pam_start.c: Likewise.
        * libpam/pam_static.c: Fix "empty sourcefile" warning.
        * modules/pam_limits/pam_limits.c: Check for __linux, too.
        * modules/pam_userdb/Makefile.am: Don't run test if no
        libdb available.
        * tests/tst-dlopen.c: Include config.h.
2006-07-24 15:47:40 +00:00
Thorsten Kukuk
6c22ab1b70 Relevant BUGIDs:
Purpose of commit: bugfix

Commit summary:
---------------

2005-11-07  Thorsten Kukuk  <kukuk@thkukuk.de>

        * modules/pam_unix/pam_unix_passwd.c (_unix_verify_shadow): Use
        correct variable names.


And adjust .cvsignore files for libtool generated files.
2005-11-07 20:09:42 +00:00
Thorsten Kukuk
a19c5ff65d Relevant BUGIDs: none
Purpose of commit: bugfix/cleanup

Commit summary:
---------------

Some cleanups for building out of tree and docu.

2005-09-27  Thorsten Kukuk  <kukuk@suse.de>

        * NEWS: Document removal of pam_radius.
        * autogen.sh: Make configure script executeable.

        * conv/pam_conv1/Makefile (EXTRA_DIST): Removed lex.yy.c
        (lex.yy.c): Fixed out of tree build.

        * conv/pam_conv1/pam_conv.y: Fix main prototype.

        * README: Adjust.
2005-09-27 06:16:10 +00:00
Thorsten Kukuk
61453cd289 Relevant BUGIDs: none
Purpose of commit: bugfix

Commit summary:
---------------

Fix creating of lex.yy.c file, fix syntax errors in pam_conv.y
2005-08-18 11:11:46 +00:00
Thorsten Kukuk
35daff80ad Relevant BUGIDs: none
Purpose of commit: new feature

Commit summary:
---------------

2. round of automake/autoconf/libtool changes
2005-08-16 14:02:15 +00:00
Thorsten Kukuk
23624ea6f7 Relevant BUGIDs: none
Purpose of commit: new feature

Commit summary:
---------------

Big "automake/autoconf/libtool" commit
2005-08-16 12:27:38 +00:00
Thorsten Kukuk
5b3099193a Relevant BUGIDs: none
Purpose of commit: cleanup

Commit summary:
---------------

Remove obsolete, not used files
2005-07-22 11:06:16 +00:00
Thorsten Kukuk
c485b54636 Relevant BUGIDs:
Purpose of commit:

Commit summary:
---------------

bugfix:
- Add targets for installing man pages for modules
- Fix check for libcrypt (Bug 417704)
2004-09-23 15:52:55 +00:00
Andrew G. Morgan
e509c5af6f Relevant BUGIDs: 491466
Purpose of commit: cleanup

Commit summary:
---------------
These were all suggestions from the OS X patch provided by Luke Howard.
There is another proposed patch for OS X support which promises to be
a little cleaner with the heavy stuff, so I am committing these simple
changes now, with the intention of moving to the other patch for the
big stuff (see 534205).
2002-05-29 06:35:46 +00:00
Andrew G. Morgan
1ffe510887 Relevant BUGIDs: 416229
Purpose of commit: cleanup

Commit summary:
---------------
A little closer to supporting AIX. These changes are not all of the
suggested changes in the bug report that I will close as a result
of this checkin, but they are all the changes that I feel happy making
right now. I've avoided some of the more gratutitous changes, hoping
that the submitter will reevaluate what they need in the light of what
I have committed here.
2001-05-08 05:02:50 +00:00
Andrew G. Morgan
4c5574a459 Relevant BUGIDs: 227565
Purpose of commit: cleanup

Commit summary:
---------------
I've removed pam_pwdb from the suggested pam.conf template.
2001-04-08 06:02:33 +00:00
Jan Rekorajski
77b11e3dfd Relevant BUGIDs: 124391
Purpose of commit: cleanup

Commit summary:
---------------
* removed unnecessary CVS Log tags from all over the source
2000-12-04 19:02:33 +00:00
Andrew G. Morgan
ea488580c4 Initial revision 2000-06-20 22:10:38 +00:00