This is to avoid issues on OSX, where the ._ prefix has special meaning.
Originally (before 2.3.2) ._ was necessary to guarantee exclusion. But
since then the .sync_ prefix is excluded as well.
This does not affect existing database files.
---------------------
If you see this error message stop your client, delete the
-``._sync_xxxxxxx.db`` file, and then restart your client.
-There is a hidden ``._sync_xxxxxxx.db`` file inside the folder of every account
+``.sync_xxxxxxx.db`` file, and then restart your client.
+There is a hidden ``.sync_xxxxxxx.db`` file inside the folder of every account
configured on your client.
.. NOTE::
const QString &remotePath,
const QString &user)
{
- QString journalPath = QLatin1String("._sync_");
+ QString journalPath = QLatin1String(".sync_");
QString key = QString::fromUtf8("%1@%2:%3").arg(user, remoteUrl.toString(), remotePath);
journalPath.append(ba.left(6).toHex());
journalPath.append(".db");
- // If the journal doesn't exist and we can't create a file
- // at that location, try again with a journal name that doesn't
- // have the ._ prefix.
- //
- // The disadvantage of that filename is that it will only be ignored
- // by client versions >2.3.2.
- //
- // See #5633: "._*" is often forbidden on samba shared folders.
-
// If it exists already, the path is clearly usable
QFile file(QDir(localPath).filePath(journalPath));
if (file.exists()) {
return journalPath;
}
- // Can we create it if we drop the underscore?
- QString alternateJournalPath = journalPath.mid(2).prepend(".");
- QFile file2(QDir(localPath).filePath(alternateJournalPath));
- if (file2.open(QIODevice::ReadWrite)) {
- // The alternative worked, use it
- qCInfo(lcDb) << "Using alternate database path" << alternateJournalPath;
- file2.close();
- file2.remove();
- return alternateJournalPath;
- }
-
- // Neither worked, just keep the original and throw errors later
- qCWarning(lcDb) << "Could not find a writable database path" << file.fileName();
+ // Error during creation, just keep the original and throw errors later
+ qCWarning(lcDb) << "Could not find a writable database path" << file.fileName() << file.errorString();
return journalPath;
}
// Delete files that have been partially downloaded.
slotDiscardDownloadProgress();
- //Unregister the socket API so it does not keep the ._sync_journal file open
+ //Unregister the socket API so it does not keep the .sync_journal file open
FolderMan::instance()->socketApi()->slotUnregisterPath(alias());
_journal.close(); // close the sync journal
continue;
}
- // Migration: ._ files sometimes don't work
- // So if the configured journalPath is the default one ("._sync_*.db")
+ // Migration: ._ files sometimes can't be created.
+ // So if the configured journalPath has a dot-underscore ("._sync_*.db")
// but the current default doesn't have the underscore, switch to the
- // new default. See SyncJournalDb::makeDbName().
+ // new default if no db exists yet.
if (folderDefinition.journalPath.startsWith("._sync_")
- && defaultJournalPath.startsWith(".sync_")) {
+ && defaultJournalPath.startsWith(".sync_")
+ && !QFile::exists(folderDefinition.absoluteJournalPath())) {
folderDefinition.journalPath = defaultJournalPath;
}
$isHere = 1 if( $acceptConflicts && !$isHere && $f =~ /conflicted copy/ );
$isHere = 1 if( $f =~ /\.csync/ );
- $isHere = 1 if( $f =~ /\._sync_/ );
+ $isHere = 1 if( $f =~ /\.sync_/ );
assert( $isHere, "Filename local, but not remote: $f" );
}
printInfo("simulate a owncloud 5 update by removing all the fileid");
## simulate a owncloud 5 update by removing all the fileid
-system( "sqlite3 " . localDir() . "._sync_*.db \"UPDATE metadata SET fileid='';\"");
+system( "sqlite3 " . localDir() . ".sync_*.db \"UPDATE metadata SET fileid='';\"");
#refresh the ids
csync();
assertLocalAndRemoteDir( 'remoteToLocal1', 1);
{
my ($name,$num) = @_;
- my $sql = "sqlite3 " . localDir() . "._sync_*.db \"SELECT md5 FROM metadata WHERE path='$name';\"";
+ my $sql = "sqlite3 " . localDir() . ".sync_*.db \"SELECT md5 FROM metadata WHERE path='$name';\"";
open(my $fh, '-|', $sql) or die $!;
my $etag = <$fh>;
close $fh;
_account->setDavDisplayName("fakename");
_account->setServerVersion("10.0.0");
- _journalDb = std::make_unique<OCC::SyncJournalDb>(localPath() + "._sync_test.db");
+ _journalDb = std::make_unique<OCC::SyncJournalDb>(localPath() + ".sync_test.db");
_syncEngine = std::make_unique<OCC::SyncEngine>(_account, localPath(), "", _journalDb.get());
// Ignore temporary files from the download. (This is in the default exclude list, but we don't load it)
_syncEngine->excludedFiles().addManualExclude("]*.~*");