Skip to content

Improve LDAP Plugin for Filedaemon#595

Merged
pstorz merged 8 commits intobareos:masterfrom
arogge:dev/arogge/master/TT4200674
Sep 16, 2020
Merged

Improve LDAP Plugin for Filedaemon#595
pstorz merged 8 commits intobareos:masterfrom
arogge:dev/arogge/master/TT4200674

Conversation

@arogge
Copy link
Member

@arogge arogge commented Sep 11, 2020

This PR adds a systemtest for the Filedaemon's LDAP-Plugin and fixes a few bugs:

  • you can now easily restore to a custom location using where/regexwhere
  • support for objects >64k
  • detect data that will not be restorable on backup (rather than reporting at restore-time)

Previously the destination dn when restoring an ldap object was
generated in a way that made it really hard to restore do a different
location.
This patch replaces the parser with a much more relaxed approach that
accepts different syntaxes. The new behaviour uses every path component
that contains an equals-sign (=) and builds a DN out of these.
When the LDAP plugin fails to back up an object, it will be recorded in
the catlog, but the data will be missing.
Previously these objects were silently ignored during restore, leading
to an incomplete set of restored objects.
This patch now adds a rudimentary detection of this case by checking if
plugin_io() is called with IO_READ, IO_WRITE or IO_SEEK between the
calls to IO_OPEN and IO_CLOSE. When there is no call we now emit a
warning that there was no data to restore the object.
Previously the plugin would not back up large objects (>64k ldif data).
This patch now adds support for these larger objects.
Bareos cannot handle objects with a slash in their name gracefully,
because it is the path delimiter.
This patch adds detection of DNs the contain a slash to the plugin. It
will now correctly raise an error and will no longer try to back up that
data.
@arogge arogge requested a review from pstorz September 11, 2020 15:20
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive. Please check my comments.

@arogge arogge force-pushed the dev/arogge/master/TT4200674 branch from 3bc1a8c to 4a77178 Compare September 16, 2020 08:23
@pstorz
Copy link
Member

pstorz commented Sep 16, 2020

I am happy with the current status and could run the tests locally with python-ldap 2.5.2 and 3.3.1

Good work!

@pstorz pstorz merged commit d90f438 into bareos:master Sep 16, 2020
arogge added a commit that referenced this pull request Sep 17, 2020
Improve LDAP Plugin for Filedaemon (Backport PR #595 to bareos-19.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants