#include "owncloudsetupwizard.h"
#include "creds/abstractcredentials.h"
#include "tooltipupdater.h"
+#include "filesystem.h"
#include <math.h>
tr("<p>Could not create local folder <i>%1</i>.")
.arg(QDir::toNativeSeparators(definition.localPath)));
return;
+ } else {
+ FileSystem::setFolderMinimumPermissions(definition.localPath);
}
-
}
}
#include "sslerrordialog.h"
#include "accountmanager.h"
#include "clientproxy.h"
+#include "filesystem.h"
#include "creds/credentialsfactory.h"
#include "creds/abstractcredentials.h"
} else {
QString res = tr("Creating local sync folder %1...").arg(localFolder);
if( fi.mkpath( localFolder ) ) {
+ FileSystem::setFolderMinimumPermissions(localFolder);
Utility::setupFavLink( localFolder );
- // FIXME: Create a local sync folder.
res += tr("ok");
} else {
res += tr("failed.");
file.setPermissions(permissions);
}
+void FileSystem::setFolderMinimumPermissions(const QString& filename)
+{
+#ifdef Q_OS_MAC
+ QFile::Permissions perm = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
+ QFile file(filename);
+ file.setPermissions(perm);
+#else
+ Q_UNUSED(filename);
+#endif
+}
+
void FileSystem::setFileReadOnlyWeak(const QString& filename, bool readonly)
{
*/
void OWNCLOUDSYNC_EXPORT setFileReadOnlyWeak(const QString& filename, bool readonly);
+/**
+ * @brief Try to set permissions so that other users on the local machine can not
+ * go into the folder.
+ */
+void OWNCLOUDSYNC_EXPORT setFolderMinimumPermissions(const QString& filename);
+
/** convert a "normal" windows path into a path that can be 32k chars long. */
QString OWNCLOUDSYNC_EXPORT longWinPath( const QString& inpath );