Commit graph

34 commits

Author SHA1 Message Date
Sergey Poznyakoff
3573fa1222 Update FSF address in copyleft headers 2024-09-04 12:31:05 +03:00
Sergey Poznyakoff
f3b7c048b8 Update copyright years 2022-02-04 09:38:17 +02:00
Sergey Poznyakoff
9f0391c84b transform: fix replacement of particular pattern instance
This fixes handling of expressions like 's/s/@/2'.

* lib/transform.c (_single_transform_name_to_slist): Avoid duplicating
initial prefix if replace is not needed.
2021-08-28 10:15:09 +03:00
Sergey Poznyakoff
da41d2aec4 Update copyright years 2021-01-06 18:15:52 +02:00
Sergey Poznyakoff
e158ebd00e Use wordsplit v1.1 2020-06-14 13:04:23 +03:00
Sergey Poznyakoff
b6c720096e Use wordsplit for keyword expansion.
* .gitmodules: Add wordsplit
* configure.ac: Likewise.
* lib/Makefile.am: Likewise.
* lib/graypam.h (gray_expand_argv): Remove.
(gray_expand_string): Change prototype.
* lib/vartab.c (gray_expand_argv): Remove.
(gray_expand_string): Rewrite using wordsplit.
* pam_ldaphome/pam_ldaphome.c (import_public_key): Assume
sshPublicKey as a default attribute.
* pam_log/pam_log.c (_pam_parse): Take two return arguments.
(echo): Use gray_expand_string.
* pam_sql/pam_mysql.c: Update gray_expand_string usage.
* pam_sql/pam_pgsql.c: Likewise.
* pam_sql/pam_sql.c: Likewise.
* pam_sql/pam_sql.h (gpam_sql_get_query): Change signature.
* pam_umotd/pam_umotd.c (pam_sm_open_session): Update
gray_expand_string usage.
2020-03-29 17:39:54 +03:00
Sergey Poznyakoff
96631a9a89 Bugfix
* lib/mem.c (gray_2nrealloc): Add missing multiplier.
2018-09-01 09:09:21 +03:00
Sergey Poznyakoff
84fcfeb07c Version 2.3.90 2018-08-16 14:22:13 +03:00
Sergey Poznyakoff
5f13fe76ab Minor changes 2018-08-16 09:32:59 +03:00
Sergey Poznyakoff
cd169165d8 Minor fix 2018-08-15 22:33:12 +03:00
Sergey Poznyakoff
7a40b7873b Major cleanup
* lib/graypam.h (gray_pam_init)
(gray_raise,gray_malloc,gray_zalloc,gray_calloc)
(gray_realloc,gray_strdup): Remove.
(gray_slist_err,gray_slist_clrerr): New functions.
(gray_slist_append,gray_slist_append_char): Return ssize_t.
(gray_slist_coalesce): Likewise.
(gray_slist_grow_backslash_num)
(gray_slist_grow_backslash): Return int.
(errno_to_pam): New function.
(gray_set_transform_expr): Return int.
* lib/mem.c (gray_raise,gray_malloc,gray_zalloc,gray_calloc)
(gray_realloc,gray_strdup): Remove.
(gray_2nrealloc): Rewrite.
* lib/base64.c: Check return from gray_slist_append_char
* lib/env.c: Check return values from gray_slist functions
* lib/ldappass.c: Likewise.
* lib/slist.c (gray_slist_bucket) <ec>: New member.
(gray_slist_err,gray_slist_clrerr): New functions.
(gray_slist_append,gray_slist_append_char): Return ssize_t.
(gray_slist_coalesce): Likewise.
(gray_slist_grow_backslash_num)
(gray_slist_grow_backslash): Return int.
* lib/transform.c: Use standard memory allocation functions.
* pam_ldaphome/pam_ldaphome.c: Likewise.
* pam_innetgr/pam_innetgr.c: Likewise.
* pam_log/pam_log.c: Likewise.
* pam_regex/pam_regex.c: Likewise.
* pam_sql/pam_mysql.c: Likewise.
* pam_sql/pam_pgsql.c: Likewise.
2018-08-15 22:22:31 +03:00
Sergey Poznyakoff
c20d0e4bf3 Happy GNU Year 2018-01-01 11:22:40 +02:00
Sergey Poznyakoff
946c85c169 Update copyright dates. 2015-01-28 16:54:21 +02:00
Sergey Poznyakoff
947e0c2f8a pam_ldaphome: run initrc command as user.
* examples/usergitconfig: Documentation formatting change.
* lib/graypam.h (gray_2nrealloc): New function.
* lib/mem.c (gray_2nrealloc): New function.
* pam_fshadow/pam_fshadow.c (fgetpwent): Skip malformed entries.
* pam_ldaphome/pam_ldaphome.c (runas): New finction.
(run_prog): Switch to user privileges unless initrc-root is true.

* NEWS: Update.
* doc/pam-modules.texi: Update.
* doc/pam_ldaphome.8in: Update.
2015-01-28 16:42:52 +02:00
Sergey Poznyakoff
e094d80820 Implement audit option
Audit is equivalent to debug=100, i.e. it enables logging
maximum debugging output.
2014-12-04 17:25:44 +02:00
Sergey Poznyakoff
b4a27a9c7a pam_ldaphome: read /etc/ldap.conf file.
* lib/env.c (gray_env_read_tr): New function.
(gray_env_read): Rewrite using gray_env_read_tr.
(gray_env_merge): New function.
* lib/escape.c (gray_escape_string): Remove useless typecasts.
* lib/graypam.h (gray_env_read_tr)
(gray_env_merge): New protos.
* pam_ldaphome/pam_ldaphome.c (ldap_config_name): New variable.
(ldap_connect): Use 'ssl' keyword, if 'tls' is not defined.
(ldaphome_main): New keyword ldap-config

* doc/pam-modules.texi: Document reading system-wide ldap.conf
* doc/pam_ldaphome.8in: Likewise.
2014-07-25 15:37:28 +03:00
Sergey Poznyakoff
7636fa3e7b New utility "ldappubkey".
* NEWS: Document new features.
* doc/pam-modules.texi: Document usergitconfig.
* doc/pam_ldaphome.8in: Update.
* examples/ldappubkey: New file.
* examples/usergitconfig: Refer to perldoc on error.
* lib/env.c (gray_env_get_bool): New function.
* lib/graypam.h (gray_env_get_bool): New proto.
* pam_ldaphome/pam_ldaphome.c (import_public_key): Do nothing if
"import-public-keys" is set to "no".
(pam_sm_authenticate): New function.
2014-05-19 14:01:21 +03:00
Sergey Poznyakoff
0c37dfded3 New module: pam_groupmember
* Makefile.am: Add pam_groupmember.
* configure.ac: Likewise.
* NEWS: Update.

* pam_groupmember/Makefile.am: New file.
* pam_groupmember/pam_groupmember.c: New file,

* doc/Makefile.am: Add pam_groupmember.8
* doc/pam-modules.texi: Document pam_groupmember
* doc/pam_groupmember.8: New file.

* lib/graypam.h (gray_calloc, gray_strdup): New protos.
* lib/mem.c (gray_calloc, gray_strdup): New functions.
2014-05-06 17:24:58 +03:00
Sergey Poznyakoff
742795c4b6 Bugfix.
* lib/transform.c (gray_free_transform_expr): Fix the loop.
2014-03-28 00:12:26 +02:00
Sergey Poznyakoff
db866c50c4 Update copyright years, set version 1.7.92 2014-02-11 15:06:09 +02:00
Sergey Poznyakoff
dc43cd8ee7 Update copyright years. 2012-07-04 13:10:06 +03:00
Sergey Poznyakoff
cc64dd9eaf Add pam_umotd module.
* Makefile.am [PAM_COND_UMOTD] (UMOTD_DIR): New variable.
(SUBDIRS): Add $(UMOTD_DIR).
* configure.ac: Check for security/pam_ext.h.
Add pam_umotd module.
* lib/graypam.h (pam_opt_type)<pam_opt_rest>: New type.
* lib/parseopt.c (gray_parseopt): Upon encoutnering pam_opt_rest parameter,
stop further processing and return the index of the next argument.
* pam_umotd/Makefile.am: New file.
* pam_umotd/pam_umotd.c: New file.
2012-07-04 13:01:18 +03:00
Sergey Poznyakoff
1a80b647d6 Revamp build system. Add pam_ldaphome module.
* configure.ac: Test for ldap.
(AC_OUTPUT): Create pam_ldaphome/Makefile.
* acinclude.m4 (PM_ENABLE): Declare PAM_COND_<item>
conditional in addition to BUILD_PAM_<item> substitution
variable.
* Makefile.am (SUBDIRS): Include most modules via
conditionally defined Makefile variables.

* lib/graypam.h (gray_env): New struct.
(gray_env_get,gray_env_free,gray_env_read)
(gray_boolean_true_p): New protos.
* lib/env.c: New file.
* lib/Makefile.am (libgraypam_la_SOURCES): Add env.c

* pam_fshadow/Makefile.am: Remove BUILD_PAM_FSHADOW
substitution.
* pam_regex/Makefile.am: Remove BUILD_PAM_REGEX
substitution.
* pam_sql/pam_sql.c (free_config, boolean_true_p)
(read_config): Remove. Use gray_env_* functions
instead. All uses updated.
* pam_regex/pam_regex.c: Fix typo.

* pam_ldaphome/Makefile.am: New file.


git-svn-id: file:///svnroot/pam-modules/trunk@118 56984be4-0537-0410-a56c-fcb268c96130
2012-05-13 09:48:57 +00:00
Sergey Poznyakoff
9a1b32df22 Various bugfixes.
* pam_fshadow/pam_fshadow.c (pam_sm_authenticate): Fix
erroneous conditional, which allowed for logins with
arbitrary passwords if `nopasswd' option was given.
* lib/graypam.h (gray_free_transform_expr): New proto.
* lib/transform.c (transform) <has_regex>: New member.
(free_transform,free_segment): New statics.
(gray_free_transform_expr): New function.
* pam_regex/pam_regex.c (pam_sm_authenticate): Free slist and
transform expression.



git-svn-id: file:///svnroot/pam-modules/trunk@116 56984be4-0537-0410-a56c-fcb268c96130
2011-08-31 07:34:59 +00:00
Sergey Poznyakoff
a8eb15d394 Update copyright years
git-svn-id: file:///svnroot/pam-modules/trunk@113 56984be4-0537-0410-a56c-fcb268c96130
2011-04-08 08:54:48 +00:00
Sergey Poznyakoff
8e3f1518fc Update copyright years.
Happy GNU Year!


git-svn-id: file:///svnroot/pam-modules/trunk@110 56984be4-0537-0410-a56c-fcb268c96130
2010-01-02 15:12:34 +00:00
Sergey Poznyakoff
27cbbfe1b7 Avoid gcc warnings
git-svn-id: file:///svnroot/pam-modules/trunk@106 56984be4-0537-0410-a56c-fcb268c96130
2009-02-27 15:30:15 +00:00
Sergey Poznyakoff
aaf0e43331 Rewrite Makefile.am's in a clearer and simpler way
* configure.ac: Require libtool 2.2.5a
* Make.rules (.c.lo, .lo.la): Remove
(AM_LDFLAGS, INCLUDES, LIBS): New assignments.
* pam_sql/Makefile.am, pam_fshadow/Makefile.am,
pam_sql/Makefile.am, pam_regex/Makefile.am,
pam_log/Makefile.am: Rewrite.
* pam_sql/pam_sql.h, pam_sql/pam_mysql.c, pam_sql/pam_pgsql.c.
pam_sql/pam_sql.c: Rewrite.
* pam_sql/sha1.h, pam_sql/md5.c, pam_sql/md5.h, pam_sql/sha1.c
* pam_fshadow/pam_fshadow.c: New option [no]shadow
* doc/pam-modules.texi: Update.

* lib/graypam.h (gray_trim_ws): New proto
* lib/strutil.c: New file.
* lib/Makefile.am: Add strutil.c


git-svn-id: file:///svnroot/pam-modules/trunk@105 56984be4-0537-0410-a56c-fcb268c96130
2009-02-27 14:54:58 +00:00
Sergey Poznyakoff
f5f42d1c7b Add session management to pam_sql.
* NEWS, configure.ac: Updated. Set version to 1.3.90.

* lib/escape.c lib/vartab.c: New files.
* lib/graypam.h (gray_expand_argv)
(gray_expand_string, gray_escape_string): New functions.
(struct keyword): New declaration.
(gray_find_keyword): New function.
* lib/Makefile.am (libgraypam_la_SOURCES): Add vartab.c and
escape.c.

* pam_log/pam_log.c: Use gray_find_keyword and gray_expand_argv.

* pam_sql/pam_mysql.c, pam_sql/pam_pgsql.c (verify_user_pass):
Change signature.
(sql_acct): New function.
* pam_sql/pam_sql.c (verify_user_pass): Change signature.
(_pam_parse): Initialize globals.
(free_config): Reset config_env to NULL.
(read_config): Set config_env to NULL.
(get_query,get_query2): New functions.
(pam_sm_authenticate): Call gray_pam_init, update call to
verify_user_pass.
(sql_session_mgmt,pam_sm_open_session,pam_sm_close_session): New
functions. 


git-svn-id: file:///svnroot/pam-modules/trunk@86 56984be4-0537-0410-a56c-fcb268c96130
2008-03-16 22:02:25 +00:00
Sergey Poznyakoff
08e01fc11d Remove mailutils' traces
git-svn-id: file:///svnroot/pam-modules/trunk@78 56984be4-0537-0410-a56c-fcb268c96130
2008-03-15 07:57:01 +00:00
Sergey Poznyakoff
9e2dcb7eca Initial framework for LDAP-style password hashes.
* pam_sql/pam_mysql.c, pam_sql/pam_pgsql.c: Call
gray_check_ldap_pass if configuration variable allow-ldap-pass is
set.
* lib/graypam.h (gray_base64_decode, gray_check_ldap_pass): New
prototypes.
* lib/Makefile.am (libgraypam_la_SOURCES): Add new files.
* lib/sha1.h, lib/base64.c, lib/md5.c, lib/ldappass.c, lib/md5.h,
lib/sha1.c: New files.


git-svn-id: file:///svnroot/pam-modules/trunk@77 56984be4-0537-0410-a56c-fcb268c96130
2008-03-15 07:39:01 +00:00
Sergey Poznyakoff
0b547268bf * lib/graypam.h: Minor change.
* pam_sql/pam_pgsql.c (verify_user_pass): port is optional.
Fix erroneous argument to PQsetdbLogin.
* pam_sql/pam_sql.c (pam_opt): Bugfix.




git-svn-id: file:///svnroot/pam-modules/trunk@69 56984be4-0537-0410-a56c-fcb268c96130
2008-03-14 14:42:56 +00:00
Sergey Poznyakoff
1128870a98 * lib/parseopt.c: New file.
* lib/Makefile.am (libgraypam_la_SOURCES): Add parseopt.c
* lib/graypam.h (gray_parseopt, gray_wait_debug_fun): New
functions
(CNTL_DEBUG_LEV, CNTL_SET_DEBUG_LEV): Removed.
* lib/log.c (gray_wait_debug): New functions.
* pam_fshadow/pam_fshadow.c, pam_sql/pam_sql.c,
pam_regex/pam_regex.c, pam_log/pam_log.c: Use gray_parseopt for
command line parsing.



git-svn-id: file:///svnroot/pam-modules/trunk@67 56984be4-0537-0410-a56c-fcb268c96130
2008-03-14 12:50:10 +00:00
Sergey Poznyakoff
222d4ff807 * configure.ac (PAM_COMMON_INCLUDES): Add -I${top_srcdir}/lib.
(AC_OUTPUT): Add lib/Makefile.
* doc/pam-modules.texi: Document `transform' option.
* Make.rules: New file.

* lib/mem.c, lib/slist.c, lib/log.c, lib/converse.c,
lib/graypam.h, lib/Makefile.am, lib/transform.c.

* pam_regex/pam_regex.c: Implement user name transformations.

* pam_fshadow/Makefile.am, pam_sql/Makefile.am:
Add ../lib/libgraypam.la to LDADD
* pam_fshadow/pam_fshadow.c, pam_sql/pam_mysql.c,
pam_sql/pam_pgsql.c, pam_sql/pam_sql.c: Use functions from ../lib.


git-svn-id: file:///svnroot/pam-modules/trunk@63 56984be4-0537-0410-a56c-fcb268c96130
2008-03-13 13:53:32 +00:00