#7010 ipa-backup fails silently
Closed: fixed 6 years ago Opened 6 years ago by pvoborni.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1457876

Description of problem:

When ipa-backup is called for the first time, the LDAP database is exported to
/var/lib/dirsrv/slapd-<instance>/ldif/<instance>-userRoot.ldif. db2ldif is
called for this. The tool runs under the dirsrv user context. When you call
ipa-restore, the same ldif file is mangled by RemoveRUVParser(). Since the tool
runs under root, also the mangled ldif file is now owned by root.

When you now call ipa-backup the next time, the db2ldif fails, because the tool
does not have permissions to write to the ldif file which is owned by root
(instead of dirsrv).


I think this is the problematic code in ldif2db():

  ipautil.backup_file(ldiffile)
        with open(ldiffile, 'wb') as out_file:
            ldif_writer = ldif.LDIFWriter(out_file)
            with open(srcldiffile, 'rb') as in_file:
                ldif_parser = RemoveRUVParser(in_file, ldif_writer, self.log)
                ldif_parser.parse()

Another problem is, that ipa-backup returns with "The ipa-backup command was
successful" although the db2ldif failed.

Version-Release number of selected component (if applicable):
ipa-4.4

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1457876

6 years ago

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1457876

6 years ago

master:

  • e8358ea Changed ownership of ldiffile to DS_USER

Metadata Update from @mbasti:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

ipa-4-5:

  • 58f3af3 Changed ownership of ldiffile to DS_USER

Metadata Update from @frenaud:
- Issue set to the milestone: FreeIPA 4.5.5 (was: FreeIPA 4.6)

6 years ago

Moving milestone to FreeIPA 4.5.5 as there was a backport to ipa-4-5 branch

master:

  • 80585f5 Before the fix, when ipa-backup was called for the first time, the LDAP database exported to /var/lib/dirsrv/slapd-<instance>/ldif/<instance>-userRoot.ldif. db2ldif is called for this and it runs under root, hence files were owned by root.

ipa-4-6:

  • 9b92e8f Before the fix, when ipa-backup was called for the first time, the LDAP database exported to /var/lib/dirsrv/slapd-<instance>/ldif/<instance>-userRoot.ldif. db2ldif is called for this and it runs under root, hence files were owned by root.

ipa-4-5:

  • de5f047 Before the fix, when ipa-backup was called for the first time, the LDAP database exported to /var/lib/dirsrv/slapd-<instance>/ldif/<instance>-userRoot.ldif. db2ldif is called for this and it runs under root, hence files were owned by root.

master:

  • 51240f3 Check if user permssions and umask 0022 is set when executing ipa-restore

ipa-4-6:

  • 6833242 Check if user permssions and umask 0022 is set when executing ipa-restore

ipa-4-7:

  • 9d5cc29 Check if user permssions and umask 0022 is set when executing ipa-restore

Login to comment on this ticket.

Metadata