Commit graph

829 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
d4b138c0e3 Add command-line options to disable module and policy checks.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@595 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-14 14:28:35 +00:00
Dag-Erling Smørgrav
312b5753a5 Add an experimental mechanism for enabling / disabling optional features.
Use it to control policy and module file checks.  The default settings
correspond to the current behavior: disallow path separators in policy
names, but allow them in module names; verify ownership and permissions
for both policy files and modules.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@594 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-14 14:18:41 +00:00
Dag-Erling Smørgrav
b28d2d21ed Reorder: feature, enhance, bugfix
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@593 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 13:21:06 +00:00
Dag-Erling Smørgrav
c23f34271d TODO list
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@592 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 13:19:51 +00:00
Dag-Erling Smørgrav
9b129a8850 ignore pamgdb
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@591 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 13:18:37 +00:00
Dag-Erling Smørgrav
2eb15b15cc Start preparing for the next release.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@590 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 12:57:57 +00:00
Dag-Erling Smørgrav
1f79315d9e Generate prettier wikitext.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@589 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 12:56:55 +00:00
Dag-Erling Smørgrav
4c8082f73d Markup nits
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@588 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 11:52:25 +00:00
Dag-Erling Smørgrav
f0d658d97d Jason tipped me off about a memory leak in the previous iteration of
openpam_parse_chain().


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@587 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 11:12:10 +00:00
Dag-Erling Smørgrav
d9ae0b5836 Consistently spell email addresses in lowercase.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@586 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-08 11:11:28 +00:00
Dag-Erling Smørgrav
8c5bc6cb91 An escaped newline within a single-quoted string is a literal newline,
but within a double-quoted string, it is a line continuation.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@585 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-07 22:49:12 +00:00
Dag-Erling Smørgrav
53544bd288 Add test cases for escaped whitespace within single- and double-quoted
strings.  This reveals a bug relating to line continuations within
double-quoted strings.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@584 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-07 22:47:16 +00:00
Dag-Erling Smørgrav
4c0e839be3 Add a gdb wrapper script that sets LD_LIBRARY_PATH and helps locate the
actual binary.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@583 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-07 18:56:13 +00:00
Dag-Erling Smørgrav
c02ad56e43 Check the return value from asprintf().
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@582 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 23:23:35 +00:00
Dag-Erling Smørgrav
5cb6cd19f3 I've decided that the code, not the test, is correct in this case;
this is adequately documented in openpam_readlinev(3).


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@581 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 01:08:37 +00:00
Dag-Erling Smørgrav
364f3b0753 Clean up the code a bit and start adding cases with actual words.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@580 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 01:07:55 +00:00
Dag-Erling Smørgrav
3fdf34619c doc nit
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@579 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 01:06:17 +00:00
Dag-Erling Smørgrav
1db36adb17 As previously mentioned, move from 2-clause BSD to 3-clause BSD.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@578 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 00:45:59 +00:00
Dag-Erling Smørgrav
cbfada51e9 Oops, re-add $(top_srcdir)/lib to VPATH, but under a less confusing
name.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@577 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-06 00:44:46 +00:00
Dag-Erling Smørgrav
aa04edbebb Useful little script that updates the release name and version number
wherever they occur and bumps the date in man page.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@576 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:46:19 +00:00
Dag-Erling Smørgrav
37f6b5bcc9 Authorship; OpenPAM is no longer developed specifically "for the
FreeBSD project".


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@575 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:43:48 +00:00
Dag-Erling Smørgrav
487cc6afcb authorship and mdoc nits
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@574 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:42:39 +00:00
Dag-Erling Smørgrav
8435fe3eca authorship
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@573 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:42:14 +00:00
Dag-Erling Smørgrav
519086d0cb Include t.h in distribution.
Get libt.a from pwd, not srcdir.  Technically, it's in builddir, but
builddir is always equal to pwd.

List libt.a before libpam.la, in case we start using surrogates and
want to share them between tests.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@572 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:41:44 +00:00
Dag-Erling Smørgrav
3a0280a4cb Fix srcdir != pwd case (exercised by make distcheck)
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@571 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:38:04 +00:00
Dag-Erling Smørgrav
03ef7cd64d include openpam_ctype.h in distribution
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@570 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 15:32:53 +00:00
Dag-Erling Smørgrav
eea3231ee1 A single space before the section title is OK.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@569 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 14:38:07 +00:00
Dag-Erling Smørgrav
89e4f8a9e7 Fix authorship
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@568 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 14:35:53 +00:00
Dag-Erling Smørgrav
3cba749dfe Fix backslashes within single-quoted strings (no escape function)
Fix line continuation (newline is stripped, not quoted)
Further improve the documentation


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@567 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 14:32:51 +00:00
Dag-Erling Smørgrav
1a3013376f #include <stdio.h> when appropriate.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@566 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 14:30:41 +00:00
Dag-Erling Smørgrav
03c07732a6 Fix bugs in two escaped-quote tests.
Add more complex line-continuation tests.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@565 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 14:25:45 +00:00
Dag-Erling Smørgrav
8e1af43b32 Split all doubled-up quote tests in two (one for single quotes, one
for double quotes).  Add several more.  Also add a test of line
continuations (backslash-newline).  Several of these tests fail due to
discrepancies between openpam_readword() and POSIX quoting rules.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@564 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 13:58:01 +00:00
Dag-Erling Smørgrav
4ee06f968e Don't use \a as a test case for escaped letters, because people might
expect it to generate a BEL character, and I might at some point
decide to implement that.  Instead, use \z, which has no special
meaning in any C-like language I know of.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@563 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-05 12:20:18 +00:00
Dag-Erling Smørgrav
4063fef039 Start writing unit tests for openpam_readlinev(). One of them fails,
but I can't quite decide whether the code or the test is incorrect.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@562 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-03 20:13:38 +00:00
Dag-Erling Smørgrav
ba1a5551d6 need config.h + missing printf() arguments + more tests
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@561 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 22:17:55 +00:00
Dag-Erling Smørgrav
73a3b34f32 Need config.h
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@560 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 22:06:24 +00:00
Dag-Erling Smørgrav
b99998da9c Annotate t_verbose()
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@559 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 22:06:05 +00:00
Dag-Erling Smørgrav
28f7487e06 This was actually a bad idea, because the test might produce warning
or error messages that are shorter than what we printed.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@558 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 21:43:59 +00:00
Dag-Erling Smørgrav
94876a3695 whitespace nit
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@557 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 10:00:08 +00:00
Dag-Erling Smørgrav
e9c697feb5 In verbose mode, output the number and name of each test to stderr
before running it.  End it with a carriage return so that any actual
output will overwrite it.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@556 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 09:59:53 +00:00
Dag-Erling Smørgrav
3a2fec89e2 Get rid of BSDisms
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@555 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 09:54:09 +00:00
Dag-Erling Smørgrav
31950458f5 Add strlcat() for non-BSD systems.
strlcpy() needs to be static.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@554 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-02 09:46:48 +00:00
Dag-Erling Smørgrav
3052dea7c0 Another bug uncovered by unit tests:
If the first character encountered is a quote, immediately allocate a
single byte.  This way, if the word we've started reading is actually
an empty quoted string ('' or ""), we correctly return an empty string
instead of NULL.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@553 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 21:04:44 +00:00
Dag-Erling Smørgrav
9a14604cd2 Start adding test cases involving quotes. The first two I could think of
both fail...


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@552 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 20:59:45 +00:00
Dag-Erling Smørgrav
81455d2603 Rename some tests, and test single and multiple whitespace separately.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@551 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 20:52:41 +00:00
Dag-Erling Smørgrav
49a4c1509e Fix a bug detected by the unit tests: to ensure consistent handling of
trailing whitespace, openpam_readword() should *always* push back the
last character read (which is a no-op in the EOF case).


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@550 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 20:45:19 +00:00
Dag-Erling Smørgrav
d7708b3ae5 Always build and run the tests last so the results are more easily visible
in the scrollback or build log.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@549 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 20:38:30 +00:00
Dag-Erling Smørgrav
2baadb71ee Add a handful of unit tests for openpam_readword(3).
Note that one of them currently fails...


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@548 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 20:34:59 +00:00
Dag-Erling Smørgrav
96357f3c52 Add an openpam_straddch() function that appends a character to a
string, reallocating the string if necessary.

Add an openpam_readword() function that reads a single word from a
file according to the usual shell quoting rules.

Add an openpam_readlinev() function that uses openpam_readword() to
read an entire line and return a list of the words it contained.

Rewrite openpam_parse_chain() using openpam_readlinev(), which greatly
simplifies the code and ensures correct parsing of module option.

Thanks to Maëlle Lesage for pointing out the issue and writing an
early version of what became the main loop in openpam_readword().


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@547 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-04-01 15:01:21 +00:00
Dag-Erling Smørgrav
54b6b546dd Update year
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@546 185d5e19-27fe-0310-9dcf-9bff6b9f3609
2012-03-31 23:13:20 +00:00