Commit Graph

35 Commits

Author SHA1 Message Date
PavlNekrasov
63ba6e4aa1 examples/tty_conv: fix potential out of bound write in readline()
At the end of the loop the iterator `i` can be equal to
`PAM_MAX_RESP_SIZE`, which will cause an index call outside the array
in the `input[i] = '\0';`

Signed-off-by: Dmitry V. Levin <ldv@strace.io>
2024-09-13 08:00:00 +00:00
Dmitry V. Levin
7fb6beed01 meson: build Linux-PAM using meson
On my non-representative hardware, the full build using autotools
(./autogen.sh && CFLAGS=-O2 ./configure && make -j`nproc` && make -j`nproc` install)
takes about 45 seconds.

On the same hardware, the full build using meson
(meson setup -Doptimization=2 dir && meson compile -C dir && meson install -C dir)
takes just about 7.5 seconds.
2024-09-10 08:00:00 +00:00
Violet Purcell
5374f677e4 examples/tty_conv: fix build on musl
termio.h is the old System V version of the interface header, and is
only provided in glibc and dietlibc as far as I can tell.
This fixes it to use the POSIX termios.h instead.
2023-05-12 02:09:07 +00:00
Christian Göttsche
92a884a71c examples: ignore generated tty_conv 2023-01-25 18:19:10 +01:00
liaohanqin
082e014689 Update xsh.c
fix: typing error
2022-01-18 11:17:55 +01:00
planc
3102dd822d Add a conversation function example
* examples/Makefile.am: Add tty_conv to noinst_PROGRAMS
* examples/tty_conv.c: A new example of conversation function.
2022-01-14 17:23:33 +01: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
Dmitry V. Levin
dc8b23cf92 Use libpam.la/libpam_misc.la to link with -lpam/-lpam_misc
GNU automake documentation recommends to avoid using -l options in
LDADD or LIBADD when referring to libraries built by the package.
Instead, it recommends to write the file name of the library explicitly,
and use -l option only to list third-party libraries.  As result, the
default value of *_DEPENDENCIES will list all local libraries and omit
the other ones.
* modules/pam_access/Makefile.am (pam_access_la_LIBADD): Replace
"-L$(top_builddir)/libpam -lpam" with
"$(top_builddir)/libpam/libpam.la", to follow GNU automake
recommendations.
* modules/pam_cracklib/Makefile.am (pam_cracklib_la_LIBADD): Likewise.
* modules/pam_debug/Makefile.am (pam_debug_la_LIBADD): Likewise.
* modules/pam_deny/Makefile.am (pam_deny_la_LIBADD): Likewise.
* modules/pam_echo/Makefile.am (pam_echo_la_LIBADD): Likewise.
* modules/pam_env/Makefile.am (pam_env_la_LIBADD): Likewise.
* modules/pam_exec/Makefile.am (pam_exec_la_LIBADD): Likewise.
* modules/pam_faildelay/Makefile.am (pam_faildelay_la_LIBADD): Likewise.
* modules/pam_filter/Makefile.am (pam_filter_la_LIBADD): Likewise.
* modules/pam_filter/upperLOWER/Makefile.am (LDADD): Likewise.
* modules/pam_ftp/Makefile.am (pam_ftp_la_LIBADD): Likewise.
* modules/pam_group/Makefile.am (pam_group_la_LIBADD): Likewise.
* modules/pam_issue/Makefile.am (pam_issue_la_LIBADD): Likewise.
* modules/pam_keyinit/Makefile.am (pam_keyinit_la_LIBADD): Likewise.
* modules/pam_lastlog/Makefile.am (pam_lastlog_la_LIBADD): Likewise.
* modules/pam_limits/Makefile.am (pam_limits_la_LIBADD): Likewise.
* modules/pam_listfile/Makefile.am (pam_listfile_la_LIBADD): Likewise.
* modules/pam_localuser/Makefile.am (pam_localuser_la_LIBADD): Likewise.
* modules/pam_loginuid/Makefile.am (pam_loginuid_la_LIBADD): Likewise.
* modules/pam_mail/Makefile.am (pam_mail_la_LIBADD): Likewise.
* modules/pam_mkhomedir/Makefile.am (pam_mkhomedir_la_LIBADD,
mkhomedir_helper_LDADD): Likewise.
* modules/pam_motd/Makefile.am (pam_motd_la_LIBADD): Likewise.
* modules/pam_namespace/Makefile.am (pam_namespace_la_LIBADD): Likewise.
* modules/pam_nologin/Makefile.am (pam_nologin_la_LIBADD): Likewise.
* modules/pam_permit/Makefile.am (pam_permit_la_LIBADD): Likewise.
* modules/pam_pwhistory/Makefile.am (pam_pwhistory_la_LIBADD): Likewise.
* modules/pam_rhosts/Makefile.am (pam_rhosts_la_LIBADD): Likewise.
* modules/pam_rootok/Makefile.am (pam_rootok_la_LIBADD): Likewise.
* modules/pam_securetty/Makefile.am (pam_securetty_la_LIBADD): Likewise.
* modules/pam_sepermit/Makefile.am (pam_sepermit_la_LIBADD): Likewise.
* modules/pam_shells/Makefile.am (pam_shells_la_LIBADD): Likewise.
* modules/pam_stress/Makefile.am (pam_stress_la_LIBADD): Likewise.
* modules/pam_succeed_if/Makefile.am (pam_succeed_if_la_LIBADD):
Likewise.
* modules/pam_tally/Makefile.am (pam_tally_la_LIBADD): Likewise.
* modules/pam_tally2/Makefile.am (pam_tally2_la_LIBADD,
pam_tally2_LDADD): Likewise.
* modules/pam_time/Makefile.am (pam_time_la_LIBADD): Likewise.
* modules/pam_timestamp/Makefile.am (pam_timestamp_la_LIBADD,
pam_timestamp_check_LDADD, hmacfile_LDADD): Likewise.
* modules/pam_tty_audit/Makefile.am (pam_tty_audit_la_LIBADD): Likewise.
* modules/pam_umask/Makefile.am (pam_umask_la_LIBADD): Likewise.
* modules/pam_unix/Makefile.am (pam_unix_la_LIBADD): Likewise.
* modules/pam_userdb/Makefile.am (pam_userdb_la_LIBADD): Likewise.
* modules/pam_warn/Makefile.am (pam_warn_la_LIBADD): Likewise.
* modules/pam_wheel/Makefile.am (pam_wheel_la_LIBADD): Likewise.
* modules/pam_xauth/Makefile.am (pam_xauth_la_LIBADD): Likewise.
* tests/Makefile.am (LDADD): Likewise.
* examples/Makefile.am (LDADD): Replace "-L$(top_builddir)/libpam -lpam"
with "$(top_builddir)/libpam/libpam.la", and
"-L$(top_builddir)/libpam_misc -lpam_misc" with
"$(top_builddir)/libpam_misc/libpam_misc.la", to follow GNU automake
recommendations.
* xtests/Makefile.am (LDADD): Likewise.
* modules/pam_selinux/Makefile.am (pam_selinux_la_LIBADD): Likewise.
2011-10-28 02:28:38 +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
caab44a1dd Relevant BUGIDs:
Purpose of commit: bugfix

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

2007-09-02  Thorsten Kukuk  <kukuk@thkukuk.de>

        * examples/Makefile.am: Fix usage of LIBADD, LDADD and LDFLAGS.
        * libpam/Makefile.am: Likewise.
        * modules/pam_access/Makefile.am: Likewise.
        * modules/pam_cracklib/Makefile.am: Likewise.
        * modules/pam_debug/Makefile.am: Likewise.
        * modules/pam_deny/Makefile.am: Likewise.
        * modules/pam_echo/Makefile.am: Likewise.
        * modules/pam_env/Makefile.am: Likewise.
        * modules/pam_exec/Makefile.am: Likewise.
        * modules/pam_faildelay/Makefile.am: Likewise.
        * modules/pam_filter/Makefile.am: Likewise.
        * modules/pam_filter/upperLOWER/Makefile.am: Likewise.
        * modules/pam_ftp/Makefile.am: Likewise.
        * modules/pam_group/Makefile.am: Likewise.
        * modules/pam_issue/Makefile.am: Likewise.
        * modules/pam_keyinit/Makefile.am: Likewise.
        * modules/pam_lastlog/Makefile.am: Likewise.
        * modules/pam_limits/Makefile.am: Likewise.
        * modules/pam_listfile/Makefile.am: Likewise.
        * modules/pam_localuser/Makefile.am: Likewise.
        * modules/pam_loginuid/Makefile.am: Likewise.
        * modules/pam_mail/Makefile.am: Likewise.
        * modules/pam_mkhomedir/Makefile.am: Likewise.
        * modules/pam_motd/Makefile.am: Likewise.
        * modules/pam_namespace/Makefile.am: Likewise.
        * modules/pam_nologin/Makefile.am: Likewise.
        * modules/pam_permit/Makefile.am: Likewise.
        * modules/pam_rhosts/Makefile.am: Likewise.
        * modules/pam_rootok/Makefile.am: Likewise.
        * modules/pam_securetty/Makefile.am: Likewise.
        * modules/pam_selinux/Makefile.am: Likewise.
        * modules/pam_shells/Makefile.am: Likewise.
        * modules/pam_stress/Makefile.am: Likewise.
        * modules/pam_succeed_if/Makefile.am: Likewise.
        * modules/pam_tally/Makefile.am: Likewise.
        * modules/pam_time/Makefile.am: Likewise.
        * modules/pam_umask/Makefile.am: Likewise.
        * modules/pam_unix/Makefile.am: Likewise.
        * tests/Makefile.am: Likewise.
2007-09-02 17:02:53 +00:00
Thorsten Kukuk
89c393b73d Relevant BUGIDs:
Purpose of commit: bugfix

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

Fix some bugs on older distributions

2006-08-31  Thorsten Kukuk  <kukuk@thkukuk.de>

        * modules/pam_namespace/Makefile.am: Don't install
        manual page if we don't build module.

        * m4/ld-as-needed.m4: Don't set LDFLAGS if check failed.
        * m4/ld-O1: Likewise.
2006-08-31 11:06:15 +00:00
Thorsten Kukuk
97f5514b75 Relevant BUGIDs:
Purpose of commit: bugfix

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

2006-06-17  Thorsten Kukuk  <kukuk@thkukuk.de>

        * examples/vpass.c: UID is unsigned on Linux.
        * modules/pam_exec/pam_exec.c: Likewise.
        * modules/pam_unix/pam_unix_acct.c: Likewise.
        * modules/pam_unix/pam_unix_sess.c: Likewise.

        * modules/pam_succeed_if/pam_succeed_if.8.xml: Fix syntax error.
        * modules/pam_succeed_if/pam_succeed_if.8: Regenerated.
        * modules/pam_succeed_if/README: Regenerated.
2006-06-17 16:44:58 +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
8ec517a521 Relevant BUGIDs: none
Purpose of commit: cleanup

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

Fix compiler warnings
2005-09-18 10:43:51 +00:00
Thorsten Kukuk
aa5c193e8c Relevant BUGIDs: none
Purpose of commit: bugfix

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

Remove dead/unpackaged file
2005-08-18 14:33:13 +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
6db0f94602 Relevant BUGIDs: none
Purpose of commit: cleanup

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

Rename _pam_aconf.h to config.h.
2005-07-20 09:46:14 +00:00
Thorsten Kukuk
0a7fe016a0 Relevant BUGIDs: none
Purpose of commit: cleanup

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

Fix all occurrence of dereferencing type-punned pointer will break
strict-aliasing rules warnings
2005-06-09 17:29:18 +00:00
Thorsten Kukuk
128ded83a0 Relevant BUGIDs:
Purpose of commit:

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

bugfix: Fix lot of compiler warnings
new feature: add broken_shadow option to pam_unix (patch from Linux
             distributions)
2004-09-24 09:18:21 +00:00
Andrew G. Morgan
09d18a79f0 Relevant BUGIDs: 565470
Purpose of commit: bugfix

Commit summary:
---------------
It seems that configure was barfing on some packages because libpam_misc
could not compile without also being linked to libpam.
2002-06-27 04:04:54 +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
b1a0e87831 Relevant BUGIDs: 490938, 409852
Purpose of commit: debugging

Commit summary:
---------------
Added a simple wrapper to make it easier to test xsh with the sandbox
libraries (no help with modules - besides editing your personal pam.d/xsh
file).
2002-05-29 04:51:07 +00:00
Andrew G. Morgan
97c9cd159d Relevant BUGIDs: 486361
Purpose of commit: bugfix

Commit summary:
---------------
pam_unix is too generic a module to override the PAM_USER_PROMPT item.
(More modifications to xsh to help me test this change.)
2001-12-09 22:39:03 +00:00
Andrew G. Morgan
da67a7d612 Relevant BUGIDs: 490938
Purpose of commit: new feature

Commit summary:
---------------
Added libpammodutil and link it with every module as its built.
The issue here is that there is a lot of code that the various modules
use in common, and this staic library can be used to help make this code
more maintainable. I do not intend to make this library dynamic. Especially
right now, as I want to be free to chop and change the API and don't want
to deal with revision control and third party modules.

This checkin makes the pam_rhost_auth module make some use of this new
library. I don't intend to add support for any other module prior to
releasing 0.76.
2001-12-09 22:15:11 +00:00
Andrew G. Morgan
6d8f508fe9 Relevant BUGIDs: 485454
Purpose of commit: revive feature

Commit summary:
---------------
malloc et al. debugging was not supported by the new autoconf setup,
this commit rectifies that. It also adds a couple of header file inclusions
that seem to be needed with recent glibc headers.
2001-11-26 03:04:46 +00:00
Andrew G. Morgan
345044121b Relevant BUGIDs: 463984
Purpose of commit: bugfix

Commit summary:
---------------
The last fix to the conversation function was less than marginal: it
didn't actually work! This second commit adds the all important 'return
the user's input' bit!

Also added some more D() stuff to pam_misc to help locate the problem
and finally cleaned up the Makefile in the examples/ directory. I used
xsh to do the testing.
2001-10-11 04:14:30 +00:00
Andrew G. Morgan
d66ecd8caf Relevant BUGIDs: 131783
Purpose of commit: bugfix

Commit summary:
---------------
static library and debugging library support fixed - post autoconf stuff.
2001-02-10 07:17:52 +00:00
Andrew G. Morgan
547e42fc5c Relevant BUGIDs: 129775
Purpose of commit: bugfix

Commit summary:
---------------
This bugfix leads to backwardly incompatable behavior with earlier
releases of Linux-PAM.

Note, this cleans up the setcred/session and chauthtok stacks in
such a way that it is no longer preferred that the setcred module
always return the same error code as the auth components of said
modules did.

This means behavior should be a great deal more sane. It also gives
meaning to the unique return codes that are available to pam_sm_setcred.
[I'm sure that when we add support for credential relevant events,
 this change will be critical.]
2001-02-05 06:50:41 +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
2b076a1766 Relevant BUGIDs: 124187
Purpose of commit: bugfix

Commit summary:
---------------
examples/Makefile contained a bogus include path.
2000-12-03 23:42:17 +00:00
Andrew G. Morgan
73346dba77 Relevant BUGIDs: task 15788, bugs 108297, 117476, 117474
Purpose of commit: autoconf support for Linux-PAM

Commit summary:
---------------
This is a merge of the autoconf support that was developed against
a 0-72 branch.

[Note, because CVS has some issues, this is actually only 95% of
 the actual commit. The other files were actually committed when
 the preparation branch Linux-PAM-0-73pre-autoconf was updated.
 Hopefully, this will complete the merge.]
2000-11-19 23:54:01 +00:00
Andrew G. Morgan
ea488580c4 Initial revision 2000-06-20 22:10:38 +00:00