summaryrefslogtreecommitdiffstats
path: root/recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch')
-rw-r--r--recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch b/recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch
new file mode 100644
index 0000000..47fc88a
--- /dev/null
+++ b/recipes-support/openldap/openldap-2.4.39/index-files-created-as-root.patch
@@ -0,0 +1,37 @@
1Document in the man page that slapindex should be run as the same user
2as slapd, and print a warning if it's run as root (since Debian defaults
3to running slapd as openldap).
4
5Not suitable for upstream in this form. This patch needs to be reworked
6to check the BerkeleyDB database ownership and only warn if running as
7root with a database that's not owned by root.
8
9Upstream ITS #5356 filed requesting better handling of this. Current
10upstream discussion leans towards putting the check into the database
11backend and aborting if slapd is run as a different user than the database
12owner, which is an even better fix.
13
14--- a/doc/man/man8/slapindex.8
15+++ b/doc/man/man8/slapindex.8
16@@ -148,6 +148,10 @@
17 should not be running (at least, not in read-write
18 mode) when you do this to ensure consistency of the database.
19 .LP
20+slapindex ought to be run as the user specified for
21+.BR slapd (8)
22+to ensure correct database permissions.
23+.LP
24 This command provides ample opportunity for the user to obtain
25 and drink their favorite beverage.
26 .SH EXAMPLES
27--- a/servers/slapd/slapindex.c
28+++ b/servers/slapd/slapindex.c
29@@ -34,6 +34,8 @@
30 int
31 slapindex( int argc, char **argv )
32 {
33+ if (geteuid() == 0)
34+ fprintf( stderr, "\nWARNING!\nRunnig as root!\nThere's a fair chance slapd will fail to start.\nCheck file permissions!\n\n");
35 ID id;
36 int rc = EXIT_SUCCESS;
37 const char *progname = "slapindex";