Skip to content

add a repair script for path_hash mismatching md5(path)  #10705

Closed

Description

@butonic

If path_hash mismatches md5(path) the file cannot be deleted. On mysql a fix would be

UPDATE oc_filecache SET path_hash = md5(path) WHERE path_hash != md5(path);

postgresql also seems to have md5(). oracle is of course weird:

select rawtohex(
    DBMS_CRYPTO.Hash (
        UTL_I18N.STRING_TO_RAW ('foo', 'AL32UTF8'),
        2)
    ) from dual;
-- output:
ACBD18DB4CC2F85CEDEF654FCCC4A4D8

mssql:

SELECT CONVERT(NVARCHAR(32),HashBytes('MD5', '[email protected]'),2)

sqlite does not have a md5() but we can add it as a callback in php:

$pdo = $args->getConnection()->getWrappedConnection();
$pdo->sqliteCreateFunction('md5', 'md5', 1);

see https://github.com/owncloud/core/pull/13956/files#diff-59f4e514d8f6ff0c90fd80dfafaf6f53R62

cc @PVince81 @icewind1991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions