You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Discovery] Fix possible issue with retrieval of permissions from the server #4548
I have verified the code that reads remotePerm from the database. The csync_file_stat_t is nulled correctly and a NULL db value leads to an empty remotePerm, as expected.
@nickvergessen This is still confusing. It looks like step03 writes NULL, but step05 reads "RDNVW". Could you verify that this is what's going on by running the test only after step03 and then checking the database?
Use something like sqlitebrowser on .csync_journal.db in the sync directory and then look for the "dir" row in the metadata table. What's the value of the remotePerm column?
I think the problem is this code in SqlQuery::bindValue
// unbound value create a null entry.
res = SQLITE_OK;
i.e. we don't call sqlite3_bind_null() when we want to produce a null table entry. Since bindings are not cleared by sqlite3_reset() the previous file's bindings are inadvertantly written to the database.
I'll try to reproduce the problem and will then fix it.
Activity
ckamm commentedon Mar 14, 2016
I have verified the code that reads
remotePermfrom the database. Thecsync_file_stat_tis nulled correctly and aNULLdb value leads to an emptyremotePerm, as expected.ckamm commentedon Mar 14, 2016
Relevant lines from the logs at https://gist.github.com/nickvergessen/8f5b8ea746a32a7a934b:
ckamm commentedon Mar 14, 2016
@nickvergessen This is still confusing. It looks like step03 writes NULL, but step05 reads "RDNVW". Could you verify that this is what's going on by running the test only after step03 and then checking the database?
Use something like sqlitebrowser on .csync_journal.db in the sync directory and then look for the "dir" row in the metadata table. What's the value of the remotePerm column?
nickvergessen commentedon Mar 14, 2016
The permissions are saved as
RDNVWin the DB after step 3.Running
oc_synca second time would fix the faulty permissions.ckamm commentedon Mar 15, 2016
@nickvergessen Thanks!
ckamm commentedon Mar 15, 2016
I think the problem is this code in
SqlQuery::bindValuei.e. we don't call
sqlite3_bind_null()when we want to produce a null table entry. Since bindings are not cleared bysqlite3_reset()the previous file's bindings are inadvertantly written to the database.I'll try to reproduce the problem and will then fix it.
SqlQuery: Write NULL when intended owncloud#4548
nickvergessen commentedon Mar 15, 2016
I just built a new master client, so it includes 7bd4f95
Fixed the issue and my locking test finally passes in all cases 👍
SqlQuery: Write NULL when intended #4548
dragotin commentedon Mar 15, 2016
great finding @ckamm and @nickvergessen thanks!