- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Run tests / test-precommit (push) Successful in 1m48s
|
||
| .forgejo/workflows | ||
| .chglog.yml | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .pylintrc | ||
| .yamllint.yml | ||
| check_slapdd | ||
| nfpm.yaml | ||
| README.md | ||
| setup.cfg | ||
check_slapdd
An OpenLDAP administration tool to audit, sanitize and fix the slapd.d configuration directory.
This script ensures your OpenLDAP configuration files remain structurally valid, compliant with official specifications and perfectly indexed.
Features
- CRC32 Verification & Fixing: Validates the native OpenLDAP checksum headers (
# CRC32 ...) and recalculates them accurately. - Line Length Compliance: Detects physical lines exceeding a configurable maximum character limit (default: 78 characters). It automatically unfolds continuations for safe processing and refolds lines cleanly using the leading-space standard upon writing.
- ASCII Integrity Enforcement: Ensures files contain only pure ASCII characters. Malformed or non-ASCII content trigger an alert and normalize.
- RDN & Filename Alignment: Aligns internal RDN attribute values with the actual filename and its structural index.
- Re-indexing multi-valued attributes & numbered configuration files and directories:
- Fixes internal index gaps for multi-valued attributes (e.g.,
olcAccess). - Fixes sequence gaps and duplicates for numbered configuration files and directories (e.g., cn={1}cosine.ldif) with cascading DN updates.
- Fixes internal index gaps for multi-valued attributes (e.g.,
Requirements
This script only requires common python3 core modules (no additional packages to install on Debian-based systems).
Installation
git clone https://gitea.zionetrix.net/bn8/check_slapdd.git /usr/local/src/check_slapdd
ln -s /usr/local/src/check_slapdd/check_slapdd /usr/local/sbin/check_slapdd
Usage
usage: check_slapdd [-h] [-d] [-v] [-l LOG_FILE] [-C] [-f] [-p SLAPDD_PATH]
[-m MAX_LINE_LENGTH]
Tool to detect & fix errors in OpenLDAP slapd.d directory (version: dev)
options:
-h, --help show this help message and exit
-d, --debug Show debug messages
-v, --verbose Show verbose messages
-l, --log-file LOG_FILE
Log file path
-C, --console Also log on console (even if log file is provided)
-f, --fix Fix errors detected in LDIF files
-p, --path SLAPDD_PATH
Default slapd.d directory path or a unique file path
(default: /etc/ldap/slapd.d)
-m, --max-line-length MAX_LINE_LENGTH
Default line max length of LDIF files (default: 78)
Copyright
Copyright (c) 2014-2026 Benjamin Renard
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.