Comment 18 for bug 450645

Revision history for this message
Nathan Stratton Treadway (nathanst) wrote :

I didn't explain clearly in my earlier comments that it's only the olcDbDirectory grep that actually causes the "chown" error here. I added the ".ldif" extension to the grep in the get_suffix function only to keep the two consistent (figuring that if it's true we only care about files that end in ".ldif" then we should be restricting our searches to such file in both places).

However, the two "grep"s are actually different enough that making your changes to the first one won't do what you want.... In particular, the "-h" option given there means that the filenames are never printed; adding "/dev/null" doesn't change anything, and changing the "cut" command to use the third field just means that the pipeline always returns an empty list of suffixes. In your particular case, though, it ends up working out fine, since the result is that the postinst script completes without an error... but that is because it doesn't try to update the permissions on any of the database directories, rather than because it is now successfully determining the path of the directory that needs to be updated....

It certainly seems like a good idea, though, to make the get_directory function a bit more robust. But I'm not sure off hand if it makes more sense to just pick the first directory that is found for a given suffix, or to try to return all of those directories. (That is, by making the "grep" pipeline a bit smarter, it seems like one could just return a list of all the database directories, and run the "chown" on that list.)

(In your case, does the olcDatabase={3}ldap.ldif file really describe an active backend that has both the same suffix and database directory as the one described in the olcDatabase={1}hdb.ldif file?)