Commit graph

330 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
bd68953705 Whitespace cleanup.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@231 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 19:34:16 +00:00
Dag-Erling Smørgrav
24e145dd10 Revert part of previous commit; openpam_log(3) doesn't really need
this hack.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@230 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 19:33:56 +00:00
Dag-Erling Smørgrav
4ec4c17dcd Reorganize. Document. Replace malloc() + sprintf() with asprintf().
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@229 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 19:32:38 +00:00
Dag-Erling Smørgrav
af75375820 Tweak the function-locating regexp to handle the slightly special
case of openpam_log(3) better.  Also work around a mysterious Perl
bug by using a loop to emulate the 'g' regexp flag.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@228 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 19:24:23 +00:00
Dag-Erling Smørgrav
151085d688 NOLIST doesn't actually do anything, and hasn't for quite a while.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@227 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 18:53:26 +00:00
Dag-Erling Smørgrav
3eeb089306 Allow libpam to build on Linux.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@226 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 18:51:33 +00:00
Dag-Erling Smørgrav
82eec0110d Make this build on glibc systems.
Submitted by:	Dmitry V. Levin <ldv@altlinux.org>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@225 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 18:33:26 +00:00
Dag-Erling Smørgrav
64d0536448 Add #include <grp.h> which I missed due to namespace pollution.
Submitted by:	Dmitry V. Levin <ldv@altlinux.org>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@224 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-24 18:32:33 +00:00
Dag-Erling Smørgrav
100e6e3f0e Add Dmitry Levin (patches and fruitful conversation)
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@223 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-23 23:48:51 +00:00
Dag-Erling Smørgrav
f013f77bff Correct old paste-o.
Submitted by:	Dmitry V. Levin <ldv@altlinux.org>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@222 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-23 23:47:31 +00:00
Dag-Erling Smørgrav
a59c768d3e Update copyright dates for files that have changed this year. Also
change the copyright date on generated man pages from 2002 to 2001-2003
since work on this part of OpenPAM started in late 2001.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@221 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:54:04 +00:00
Dag-Erling Smørgrav
9c7438a4b1 Update portability status.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@220 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:48:56 +00:00
Dag-Erling Smørgrav
e9a7e1640f OpenBSD doesn't create libpam.so at build time, and FreeBSD ignores the
minor number, so the only file we can safely depend on is libpam.a.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@219 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:48:36 +00:00
Dag-Erling Smørgrav
2b0eb75262 Build everything (rather than just the man pages) so the release
will fail if the code won't build.  Finish the release by showing
the MD5 checksum of the tarball.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@218 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:45:45 +00:00
Dag-Erling Smørgrav
9faa960d34 Credit Mike Petullo <mike@flyn.org> for his OpenBSD patches.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@217 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:42:26 +00:00
Dag-Erling Smørgrav
98f9303b57 Use RTLD_LAZY rather than RTLD_NOW (which apparently isn't supported
on all platforms, notably OpenBSD).

Submitted by:	Mike Petullo <mike@flyn.org>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@216 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:42:04 +00:00
Dag-Erling Smørgrav
d9906b5db1 Support su'ing to another user with arguments. Drop privs in the
child rather than in the parent so that pam_close_session(3) will be
called with privs.  Simplify some of the error handling.

Based on patches received from Mike Petullo <mike@flyn.org>.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@215 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:40:18 +00:00
Dag-Erling Smørgrav
5ad9bf2e77 Propagate version numbers and installation directories throughout
the tree using Makefile.inc.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@214 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-13 14:37:12 +00:00
Dag-Erling Smørgrav
df6d850a38 Roll OpenPAM Dianthus.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@213 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-02 16:59:28 +00:00
Dag-Erling Smørgrav
8b01e58103 Change the contact address to des@freebsd.org.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@212 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-02 16:57:28 +00:00
Dag-Erling Smørgrav
309a306cfd Constify the return value from pam_getenv(3). This violates XSSO,
but I consider that a bug in the spec.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@211 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 23:10:49 +00:00
Dag-Erling Smørgrav
ef2e6d8690 If compiled with -DDEBUG, enable debugging right before calling a
module which has the "debug" option, and disable it upon return.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@210 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 18:20:03 +00:00
Dag-Erling Smørgrav
8dcae81fe3 Add a global variable controlling the output of debugging messages.
This allows modules etc. to emit PAM_LOG_DEBUG messages independently
of whether libpam was compiled with -DDEBUG.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@209 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 18:18:06 +00:00
Dag-Erling Smørgrav
a57c4713cf Avoid dereferencing an unitialized dl handle. Also, add a cast to
avoid a warning about assigning void * to a function pointer.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@208 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 18:13:09 +00:00
Dag-Erling Smørgrav
13e7ee3988 Some compilers (gcc at least) promote the integer literal 0x80000000
to long, while enums are required to fit in an int.  To avoid the
warning this causes, use (-0x7fffffff - 1) instead of 0x80000000.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@207 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 18:11:15 +00:00
Dag-Erling Smørgrav
01c7951719 Variable initialization issues.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@206 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-05-01 17:57:17 +00:00
Dag-Erling Smørgrav
c85f7eef5b Avoid a NULL pointer dereference if PAM_CONV is non-NULL but its
conv member is NULL.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@205 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-16 12:09:51 +00:00
Dag-Erling Smørgrav
80c9bf5c74 Apparently, nobody ever uses pam_getenv(3), because nobody has ever
complained that it didn't work.  Make it return a pointer to the
actual value of the requested environment variable.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@204 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-08 21:13:00 +00:00
Dag-Erling Smørgrav
b34ff41a8c Nothing beats being an idiot! Avoid passing expressions with side
effects as arguments to macros.  Also impose some sort of consistency
in the naming of variables that hold error codes.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@203 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-08 16:41:53 +00:00
Dag-Erling Smørgrav
ace4e1987e If the saved effective uid is the same as the current effective uid,
just destroy the saved credentials and return.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@202 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-07 16:07:07 +00:00
Dag-Erling Smørgrav
4ad428dc12 If a set of saved credentials already exists when we are called, log
a debugging message and fail.

If the effective uid is non-zero but identical to the target uid,
save the current credentials and return without doing anything else.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@201 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-07 16:04:39 +00:00
Dag-Erling Smørgrav
a657d3746c More debugging macros: ENTERI() (item type), ENTERN() (int),
ENTERS() (string).  Rename RETURNI() to RETURNN() for consistency.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@200 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-02-02 13:10:00 +00:00
Dag-Erling Smørgrav
0dcf0274b0 #include <stddef.h> is sufficient to define size_t, and is far more
portable (and less polluting) than #include <sys/types.h>.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@199 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-23 22:29:40 +00:00
Dag-Erling Smørgrav
26767ae03c #include <sys/types.h> (for size_t) against my better judgement.
Solaris does it too, so at least I'm not the odd one out.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@198 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-22 17:44:40 +00:00
Dag-Erling Smørgrav
8315910546 Release OpenPAM Daffodil.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@197 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-06 10:15:01 +00:00
Dag-Erling Smørgrav
bd2bbf2542 Credit Juli Mallett for her many contributions.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@196 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-06 10:03:35 +00:00
Dag-Erling Smørgrav
a14b5e1ca6 Document dependency on <sys/types.h> (for size_t)
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@195 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-06 10:02:34 +00:00
Dag-Erling Smørgrav
8423c93aa2 On second thought, use RETURNS() since environment variables are
strings.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@194 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:49:21 +00:00
Dag-Erling Smørgrav
022f6ea6fd Use RETURNP() rather than RETURNC().
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@193 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:47:06 +00:00
Dag-Erling Smørgrav
e8818402d5 Have prompt() return NULL if EOF occurred on stdin, instead of acting
as if the user had just pressed enter.

Obtained from:	TrustedBSD


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@192 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:34:13 +00:00
Dag-Erling Smørgrav
82a6d21d8c Fix a typo in the active version of RETURNC(), and a cosmetic nit
in the active version of RETURNI().


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@191 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:30:52 +00:00
Dag-Erling Smørgrav
1a5f406a0b Credit Mikko Työläjärvi for his patch (see change 23072)
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@190 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:21:32 +00:00
Dag-Erling Smørgrav
fa370a5bde Fix typo in debugging macro.
Submitted by:	Mikko Tyolajarvi <mbsd@pacbell.net>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@189 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2003-01-03 03:17:16 +00:00
Dag-Erling Smørgrav
e2a27bd9bf OpenPAM Cyclamen is ready to roll.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@188 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 17:16:58 +00:00
Dag-Erling Smørgrav
20a7a7ae90 Instrument entry and exit points.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@187 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 17:06:29 +00:00
Dag-Erling Smørgrav
bf8598063a Record which primitive is currently executing before calling the
service module.  Use that information to generate a much better
error message when indirect recursion is detected.

Instrument openpam_dispatch()'s entry and exit points.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@186 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 17:04:04 +00:00
Dag-Erling Smørgrav
b0ba976453 Declare _pam_func_name and _pam_err_name.
Add a member to the pam_handle structure indicating which primitive
is currently executing.
Add a ton of debugging macros.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@185 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 17:01:39 +00:00
Dag-Erling Smørgrav
2fb80ca71d Add an array containing the API names for the PAM primitives.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@184 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 16:59:21 +00:00
Dag-Erling Smørgrav
7b3ff93221 Add an array of symbolic names for the PAM error codes.
Fix a minor style nit.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@183 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 16:58:28 +00:00
Dag-Erling Smørgrav
9435ecd893 Add a counter to the error code enumeration.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@182 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2002-12-12 16:56:34 +00:00