Skip to content

Commit fc546b0

Browse files
committed
cleanup saslauthd
1 parent 14b2f72 commit fc546b0

4 files changed

Lines changed: 23 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Upon starting this image it will give you a ready to run server with many config
1414
* Supports Replication
1515
* Scheduled Backups of Data
1616
* Ability to choose NIS or rfc2307bis Schema
17+
* Abilty to authenticate against SASL2
1718
* Additional Password Modules (Argon, SHA2, PBKDF2)
1819
* Two Password Checking Modules - check_password.so and ppm.so
1920
* Zabbix Monitoring templates included
@@ -279,7 +280,7 @@ If you already have a check_password.conf or ppm.conf in /etc/openldap/ the foll
279280
| `SASLAUTHD_SLAPD_TYPE` | Type when writing `/etc/sasl/slapd.conf` | `pam` |
280281
| `SASLAUTHD_MECH_LIST` | Mech List when writing `/etc/sasl/slapd.conf` | `PLAIN LOGIN EXTERNAL` |
281282
| `SASLAUTHD_SLAPD_TYPE` | | `pam` |
282-
| `SASLAUTHD_PAM_CONFIG_PATH` | Pam Configuration path - If not default will symlink to this | `/etc/pam/` |
283+
| `SASLAUTHD_PAM_CONFIG_PATH` | Pam Configuration path - If not default will symlink to this | `/etc/pam.d/` |
283284
| `SASLAUTHD_SLAPD_PAM_FILE` | Pam Configuration file - If not default will symlink to this | `ldap` |
284285
| `SASLAUTHD_PAM_AUTO_CONFIGURE` | Auto configure ${SASLAUTHD_PAM_CONFIG_PATH}/${SASLAUTHD_PAM_SLAPD_CONFIG_FILE} | `TRUE` |
285286
| `SASLAUTHD_PAM_LDAP_AUTH_ENTRY` | Auth line entry | see second line |

container-openldap.code-workspace

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "container-openldap",
5+
"path": "."
6+
},
7+
{
8+
"name": "container-base",
9+
"path": "../container-base"
10+
},
11+
{
12+
"name": "gha",
13+
"path": "../gha"
14+
}
15+
],
16+
"settings": {}
17+
}

rootfs/container/defaults/30-saslauthd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ SASLAUTHD_PAM_LDAP_AUTH_ENTRY=${SASLAUTHD_PAM_LDAP_AUTH_ENTRY:-"required pam_exe
1818
SASLAUTHD_PROCESSES=${SASLAUTHD_PROCESSES:-"0"}
1919
SASLAUTHD_RUN_PATH=${SASLAUTHD_RUN_PATH:-"/run/saslauthd/"}
2020
SASLAUTHD_SLAPD_CONFIG_FILE=${SASLAUTHD_SLAPD_CONFIG_FILE:-"slapd.conf"}
21-
SASLAUTHD_PAM_CONFIG_PATH=${SASLAUTHD_PAM_CONFIG_PATH:-"/etc/pam/"}
21+
SASLAUTHD_PAM_CONFIG_PATH=${SASLAUTHD_PAM_CONFIG_PATH:-"/etc/pam.d/"}
2222
SASLAUTHD_SLAPD_PAM_FILE=${SASLAUTHD_SLAPD_PAM_FILE:-"ldap"}
2323
SASLAUTHD_SLAPD_TYPE=${SASLAUTHD_TYPE:-"pam"}

rootfs/container/functions/30-saslauthd

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ saslauthd_bootstrap_filesystem() {
2222

2323
saslauthd_configure_daemon() {
2424
if var_true "${SASLAUTHD_AUTO_CONFIGURE}" ; then
25-
write_file "${SASLAUTHD_CONFIG_PATH%/}"/"${SASLAUTHD_SLAPD_CONFIG_FILE}":640 <<EOF
25+
write_file root:ldap@"${SASLAUTHD_CONFIG_PATH%/}"/"${SASLAUTHD_SLAPD_CONFIG_FILE}":640 <<EOF
2626
pwcheck_method: saslauthd
2727
saslauthd_path: ${SASLAUTHD_RUN_PATH}/mux
2828
mech_list: ${SASLAUTHD_MECH_LIST}
@@ -37,16 +37,12 @@ EOF
3737
saslauthd_configure_pam() {
3838
if [ "${SASLAUTHD_SLAPD_TYPE,,}" = "pam" ] ; then
3939
print_notice "Configuring PAM for saslauthd/slapd"
40-
if [ -n "${SASLAUTHD_LDAP_PAM_CONFIG_FILE}" ] ; then
41-
ln -s "${SASLAUTHD_PAM_CONFIG_PATH%/}"/"${SASLAUTHD_PAM_LDAP_CONFIG_FILE}" /etc/pam.d/ldap
42-
fi
43-
44-
if [ "${SASLAUTHD_PAM_CONFIG_PATH%/}" != "/etc/pam" ] && [ "${SASLAUTHD_PAM_LDAP_CONFIG_FILE}" != "ldap" ] ; then
40+
if [ "${SASLAUTHD_PAM_CONFIG_PATH%/}" != "/etc/pam.d" ] && [ "${SASLAUTHD_PAM_LDAP_CONFIG_FILE}" != "ldap" ] ; then
4541
rm -rf /etc/pam/ldap
4642
ln -s "${SASLAUTHD_PAM_CONFIG_PATH%/}"/"${SASLAUTHD_PAM_LDAP_CONFIG_FILE}" /etc/pam.d/ldap
4743
fi
4844
if var_true "${SASLAUTHD_PAM_AUTO_CONFIGURE}" ; then
49-
write_file "${SASLAUTHD_PAM_CONFIG_PATH%/}"/"${SASLAUTHD_PAM_LDAP_CONFIG_FILE}":700 <<EOF
45+
write_file root:root@"${SASLAUTHD_PAM_CONFIG_PATH%/}"/"${SASLAUTHD_PAM_LDAP_CONFIG_FILE}":700 <<EOF
5046
auth ${SASLAUTHD_PAM_LDAP_AUTH_ENTRY}
5147
account ${SASLAUTHD_PAM_LDAP_ACCOUNT_ENTRY}
5248
EOF

0 commit comments

Comments
 (0)