Skip to content

Cross user backend sharing encryption key migration fails on update #13950

Closed

Description

@PVince81

Steps to reproduce:

  1. Setup OC 7.0.4 with LDAP and with "root" as the local admin user
  2. Enable encryption
  3. Login as LDAP user "ldapuser1" to init encryption keys
  4. As "root", share a folder "test" with a ldap user "ldapuser1"
  5. Upgrade to OC 8.0.0~RC2
  6. Run ./occ encryption:migrate to migrate the LDAP keys
  7. Login as "ldapuser1" and try downloading the files from the folder "test"

Expected result

Files can be downloaded. Share keys properly migrated

Actual result

Files cannot be downloaded.
It looks like only the keys from the user "root" have been migrated, not the ones from the LDAP users.

After talking to @schiesbn it seems it could be the same issue with app update order like #13865 where the LDAP app isn't loaded (or loaded too late) during an update, so the migration code (the part that runs during update) doesn't find the LDAP users.

A quickfix would be to remove the "userExists()" check that is done during key migration to make sure all keys are simply copied.

I guess this issue only happens when sharing between users from different backends.
I'll retest this when sharing between LDAP users and see whether it happens too.

@schiesbn @karlitschek @DeepDiver1975 @blizzz

Activity

  1. added this to the milestone on Feb 6, 2015
  2. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor

    To try:

  3. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor
  4. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor
  5. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor

    I can confirm that files shared between two LDAP users are properly migrated by the script (given that #13951 doesn't kick in).

    The error case is only when sharing cross-backend.

    Next step: test the fixes

  6. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor

    I can confirm that @blizzz's script with loading order works: #13865 (but is not ready for production)
    It also makes the migration script obsolete, the users seemed to be migrated properly (but might be useful if people ran into timeout when upgrading in the web UI)

    Next step: test @schiesbn's quickfix (which is more suited as a quick fix)

  7. karlitschek commented on Feb 6, 2015

    @karlitschek
    Contributor

    @jnfrmarks Can you help testing this? This is critical

  8. PVince81 commented on Feb 6, 2015

    @PVince81
    ContributorAuthor

    @schiesbn's patch worked for me: #13952
    With that one, I still need to run "sudo -uwww ./occ encryption:migrate-keys" which is fine short term.

  9. schiessle commented on Feb 6, 2015

    @schiessle
    Contributor

    With that one, I still need to run "sudo -uwww ./occ encryption:migrate-keys" which is fine short term.

    sure,nothing changes with respect to the occ script.

  10. jnfrmarks commented on Feb 6, 2015

    @jnfrmarks

    testing underway

  11. MorrisJobke commented on Feb 6, 2015

    @MorrisJobke
    Contributor

    Fixed with #13952

  12. locked as resolved and limited conversation to collaborators on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions