Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
butonic opened this issue Aug 28, 2014 · 0 comments
Closed

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

butonic opened this issue Aug 28, 2014 · 0 comments

Comments

@butonic
Copy link
Member

butonic commented Aug 28, 2014

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@dot.com'),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
Projects
None yet
Development

No branches or pull requests

4 participants