Issue #315 has been updated by Jonathan Clarke.

Status changed from Assigned to Feedback
Assigned to changed from Clément OUDOT to Jonathan Clarke

Nick Milas wrote:
> Actually, I don't remember having done any configuration regarding backups. 
> 
> But even after I changed /etc/default/slapd as:
> 
> [...]
> 
> ...I get: 
> 
> <pre>[root@vdev etc]# /etc/init.d/slapd backup
slapd[24855]: [INFO] Using /etc/default/slapd for configuration
slapd[24860]: [INFO] Launching OpenLDAP database backup...
-20110504110348.ldifata saved in 
/var/backups/openldap/openldap-data/openldap-data
[root@vdev etc]# 
[root@vdev etc]# 
[root@vdev etc]# ls -la /var/backups/openldap/openldap-data/
total 1152
drwxr-xr-x 2 root root    4096 May  4 11:03 .
drwxr-xr-x 3 ldap ldap    4096 May  4 10:17 ..
-rw-r--r-- 1 root root 1163525 May  4 11:03 
openldap-data?-20110504110348.ldif</pre>

It looks like there's a special character hidden in this - the "?" in the file 
name in the ls output, and the way the output from the script wraps to the 
beginning of the line, and the "^M" in the output in the issue description all 
indicate that this is a "\r" character, probably a result of having edited 
slapd.conf on Windows.

This character likely comes from the conffile_get_values call to read the 
OpenLDAP database directory from slapd.conf.

I'm going to commit a fix for this, which filters any "\r" characters hidden in 
the slapd.conf file before reading values from it in the conffile_get_values 
function. I don't believe this fix needs to be applied when reading data from 
back-config, since we use slapcat for that, which should already escape those 
characters.
----------------------------------------
Bug #315: Bug in initscript when backup option is used
http://tools.lsc-project.org/issues/315

Author: Nick Milas
Status: Feedback
Priority: Normal
Assigned to: Jonathan Clarke
Category: OpenLDAP init script
Target version: openldap-initscript-?


In initscript (v1.2), the file is not created in the right directory and with 
the right name: 

First scenario (default): directory /var/backups/openldap/openldap-data does 
not exit:

<pre>
[root@vdev openldap-data]# /etc/init.d/slapd backup
slapd[24391]: [INFO] Using /etc/default/slapd for configuration
slapd[24396]: [INFO] Launching OpenLDAP database backup...
-20110504101402.ldifata saved in /var/backups/openldap/openldap-data
[root@vdev openldap-data]# 
[root@vdev openldap-data]# 
[root@vdev openldap-data]# 
[root@vdev openldap-data]# cd 
/var/backups/openldap/openldap-data^M-20110504101402.ldif 
-20110504101402.ldif: Not a directoryldap-data
[root@vdev openldap-data]# cd /var/backups/openldap/openldap-data
-bash: cd: /var/backups/openldap/openldap-data: No such file or directory
[root@vdev openldap-data]# cd /var/backups/openldap/
[root@vdev openldap]# ls -la
total 1152
drwxr-xr-x 2 ldap ldap    4096 May  4 10:14 .
drwxr-xr-x 3 root root    4096 Mar 28 12:11 ..
-rw-r--r-- 1 root root 1163525 May  4 10:14 openldap-data?-20110504101402.ldif
</pre>

If we manually create the directory openldap-data: 

<pre>
[root@vdev openldap]# mkdir openldap-data
[root@vdev openldap]# ls -la
total 1156
drwxr-xr-x 3 ldap ldap    4096 May  4 10:16 .
drwxr-xr-x 3 root root    4096 Mar 28 12:11 ..
-rw-r--r-- 1 root root 1163525 May  4 10:14 20110504101402.ldif
drwxr-xr-x 2 root root    4096 May  4 10:16 openldap-data
[root@vdev openldap]# 
[root@vdev openldap]# 
[root@vdev openldap]# /etc/init.d/slapd backup
slapd[24466]: [INFO] Using /etc/default/slapd for configuration
slapd[24471]: [INFO] Launching OpenLDAP database backup...
-20110504101705.ldifata saved in /var/backups/openldap/openldap-data
[root@vdev openldap]# cd openldap-data
[root@vdev openldap-data]# ls -la
total 8
drwxr-xr-x 2 root root 4096 May  4 10:16 .
drwxr-xr-x 3 ldap ldap 4096 May  4 10:17 ..
[root@vdev openldap-data]# cd ..
[root@vdev openldap]# ls -la
total 2300
drwxr-xr-x 3 ldap ldap    4096 May  4 10:17 .
drwxr-xr-x 3 root root    4096 Mar 28 12:11 ..
-rw-r--r-- 1 root root 1163525 May  4 10:14 20110504101402.ldif
drwxr-xr-x 2 root root    4096 May  4 10:16 openldap-data
-rw-r--r-- 1 root root 1163525 May  4 10:17 openldap-data?-20110504101705.ldif
</pre>

Nick


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://tools.lsc-project.org/my/account
_______________________________________________
ltb-dev mailing list
[email protected]
http://lists.ltb-project.org/listinfo/ltb-dev

Reply via email to