Merge remote-tracking branch 'origin/2.1'

Conflicts:
	doc/building.rst
This commit is contained in:
Olivier Goffart 2016-02-08 14:28:25 +01:00
commit 93308faeb9
22 changed files with 187 additions and 98 deletions

1
.gitignore vendored
View File

@ -7,7 +7,6 @@ CMakeLists.txt.user*
doc/_build/*
*.kate-swp
*.kdev4
win/
admin/win/nsi/l10n/pofiles/*.po
*.swp
*~$

View File

@ -1,6 +1,6 @@
ChangeLog
=========
version 2.1.1 (release 2016-01-2x)
version 2.1.1 (release 2016-02-0x)
* UI improvements for HiDPI screens, error messages, RTL languages
* Fix occurences of "Connection Closed" when a new unauthenticated TCP socket is used
* Fix undeliberate WiFi scanning done by Qt Network classes
@ -14,6 +14,7 @@ version 2.1.1 (release 2016-01-2x)
* Allow changeable upload chunk size in owncloud.cfg
* Crash fixes on account deletion
* Forget password on explicit sign-out
* Windows Installer: Update to NSIS 2.50, fixes possible DLL injection
* Sync Engine: .lnk files
* Sync Engine: symlinked syn directories
* Sync Engine: Windows: Fix deleting and replacing of read-only files (#4308 #4277)

View File

@ -262,8 +262,8 @@ def CopyFramework(source_dylib):
dest_dylib_path = os.path.join(frameworks_dir, *parts[i:-1])
break
if os.path.exists(dest_path):
print dest_path, "already exists, skipping..."
return
print dest_path, "already exists, skipping copy..."
return os.path.join(dest_dylib_path, dylib_name)
args = ['mkdir', '-p', dest_dylib_path]
commands.append(args)

View File

@ -0,0 +1,37 @@
FROM opensuse:42.1
MAINTAINER Daniel Molkentin <danimo@owncloud.com>
ENV TERM ansi
ENV HOME /root
ENV REFRESHED_AT 20160202
RUN zypper --non-interactive --gpg-auto-import-keys refresh
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_42.1/windows:mingw.repo
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/isv:ownCloud:toolchains:mingw:win32:2.1/openSUSE_Leap_42.1/isv:ownCloud:toolchains:mingw:win32:2.1.repo
RUN zypper --non-interactive --gpg-auto-import-keys install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
mingw32-headers mingw32-runtime site-config mingw32-libwebp \
mingw32-cross-libqt5-qmake mingw32-cross-libqt5-qttools mingw32-libqt5* \
mingw32-qt5keychain* mingw32-angleproject* \
mingw32-cross-nsis mingw32-libopenssl* \
mingw32-sqlite* kdewin-png2ico \
osslsigncode wget
# RPM depends on curl for installs from HTTP
RUN zypper --non-interactive --gpg-auto-import-keys install curl
# sudo needed for building as user
RUN zypper --non-interactive --gpg-auto-import-keys install sudo
# Use packaged UAC dependencies
RUN zypper --non-interactive --gpg-auto-import-keys install mingw32-cross-nsis-plugin-uac mingw32-cross-nsis-plugin-nsprocess
# Required for checksumming
RUN zypper --non-interactive --gpg-auto-import-keys install mingw32-zlib-devel
# Required for windres not to crash
RUN zypper --non-interactive --gpg-auto-import-keys install glibc-locale
CMD /bin/bash

View File

@ -7,13 +7,13 @@ fi
useradd user -u ${2:-1000}
su - user << EOF
cd /home/user/$1
rm -rf build-win32
mkdir build-win32
cd build-win32
../admin/win/download_runtimes.sh
cmake .. -DCMAKE_TOOLCHAIN_FILE=../admin/win/Toolchain-mingw32-openSUSE.cmake -DWITH_CRASHREPORTER=ON
make -j4
make package
ctest .
cd /home/user/$1
rm -rf build-win32
mkdir build-win32
cd build-win32
../admin/win/download_runtimes.sh
cmake .. -DCMAKE_TOOLCHAIN_FILE=../admin/win/Toolchain-mingw32-openSUSE.cmake -DWITH_CRASHREPORTER=ON
make -j4
make package
ctest .
EOF

View File

@ -120,7 +120,7 @@ translationCache = {}
for root,dirs,files in os.walk(options.podir):
for file in files:
filename,ext = os.path.splitext(file)
if ext == ".po":
if ext == ".po" or ext == ".nsh":
# Valid locale filename (fr.po, de.po etc)?
if filename in localeToName:
language = localeToName[filename]

View File

@ -106,6 +106,42 @@ static bool _last_db_return_error(CSYNC* ctx) {
return ctx->statedb.lastReturnValue != SQLITE_OK && ctx->statedb.lastReturnValue != SQLITE_DONE && ctx->statedb.lastReturnValue != SQLITE_ROW;
}
/*
* This static method is needed because the type members of the two structs use
* different enum values. A direct comparion is not neccessarily correct.
*
* tmp is csync_file_stat_t
* fs is csync_vio_file_stat_t with this vio type:
* enum csync_vio_file_type_e {
* CSYNC_VIO_FILE_TYPE_UNKNOWN,
* CSYNC_VIO_FILE_TYPE_REGULAR,
* CSYNC_VIO_FILE_TYPE_DIRECTORY,
* CSYNC_VIO_FILE_TYPE_FIFO,
* CSYNC_VIO_FILE_TYPE_SOCKET,
* CSYNC_VIO_FILE_TYPE_CHARACTER_DEVICE,
* CSYNC_VIO_FILE_TYPE_BLOCK_DEVICE,
* CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK
* };
*
* csync_file_stat_t can be:
* CSYNC_FTW_TYPE_SKIP, CSYNC_FTW_TYPE_FILE
* CSYNC_FTW_TYPE_DIR, CSYNC_FTW_TYPE_SLINK
*/
static bool _csync_filetype_different( const csync_file_stat_t *tmp, const csync_vio_file_stat_t *fs)
{
if( !(tmp && fs)) return false;
if( tmp->type == CSYNC_FTW_TYPE_SKIP ) return true;
if( tmp->type == CSYNC_FTW_TYPE_DIR && fs->type != CSYNC_VIO_FILE_TYPE_DIRECTORY )
return true;
if( tmp->type == CSYNC_FTW_TYPE_FILE && fs->type != CSYNC_VIO_FILE_TYPE_REGULAR )
return true;
if( tmp->type == CSYNC_FTW_TYPE_SLINK && fs->type != CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK )
return true;
return false; // both are NOT different.
}
/* Return true if two mtime are considered equal
* We consider mtime that are one hour difference to be equal if they are one hour appart
@ -274,8 +310,9 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
st->instruction = CSYNC_INSTRUCTION_EVAL;
// Preserve the EVAL flag later on if the type has changed.
if (tmp->type != fs->type)
if (_csync_filetype_different(tmp, fs)) {
st->child_modified = 1;
}
goto out;
}
@ -303,8 +340,9 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
}
// Preserve the EVAL flag later on if the type has changed.
if (tmp->type != fs->type)
if (_csync_filetype_different(tmp, fs)) {
st->child_modified = 1;
}
st->instruction = CSYNC_INSTRUCTION_EVAL;
goto out;
@ -353,10 +391,12 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
}
/* translate the file type between the two stat types csync has. */
if( tmp && tmp->type == 0 ) {
if( tmp && tmp->type == CSYNC_FTW_TYPE_FILE ) {
tmp_vio_type = CSYNC_VIO_FILE_TYPE_REGULAR;
} else if( tmp && tmp->type == 2 ) {
} else if( tmp && tmp->type == CSYNC_FTW_TYPE_DIR) {
tmp_vio_type = CSYNC_VIO_FILE_TYPE_DIRECTORY;
} else if( tmp && tmp->type == CSYNC_FTW_TYPE_SLINK ) {
tmp_vio_type = CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK;
} else {
tmp_vio_type = CSYNC_VIO_FILE_TYPE_UNKNOWN;
}
@ -406,8 +446,7 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
return -1;
}
if(tmp ) { /* tmp existing at all */
if ((tmp->type == CSYNC_FTW_TYPE_DIR && fs->type != CSYNC_VIO_FILE_TYPE_DIRECTORY) ||
(tmp->type == CSYNC_FTW_TYPE_FILE && fs->type != CSYNC_VIO_FILE_TYPE_REGULAR)) {
if ( _csync_filetype_different(tmp, fs)) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "WARN: file types different is not!");
st->instruction = CSYNC_INSTRUCTION_NEW;
goto out;
@ -798,7 +837,9 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
* local stat function.
*/
if( d_name[0] == '.' ) {
dirent->flags |= CSYNC_VIO_FILE_FLAGS_HIDDEN;
if (strcmp(".sys.admin#recall#", d_name) != 0) { /* recall file shall not be ignored (#4420) */
dirent->flags |= CSYNC_VIO_FILE_FLAGS_HIDDEN;
}
}
if( res == 0) {

View File

@ -28,9 +28,6 @@ Linux
4. (Optional) Call ``make install`` to install the client to the ``/usr/local/bin`` directory.
.. note:: This step requires the ``mingw32-cross-nsis`` packages be installed on
Windows.
Mac OS X
--------
@ -63,15 +60,17 @@ To set up your build environment for development using HomeBrew_:
5. For compilation of the client, follow the :ref:`generic-build-instructions`.
6. In the build directory, run ``admin/osx/create_mac.sh <build_dir>
6. Install the Packages_ package creation tool.
7. In the build directory, run ``admin/osx/create_mac.sh <build_dir>
<install_dir>``. If you have a developer signing certificate, you can specify
its Common Name as a third parameter (use quotes) to have the package
signed automatically.
.. note:: Contrary to earlier versions, ownCloud 1.7 and later are packaged
as a ``pkg`` installer. Do not call "make package" at any time when
compiling for OS X, as this will build a disk image, and will not
work correctly.
.. note:: Contrary to earlier versions, ownCloud 1.7 and later are packaged
as a ``pkg`` installer. Do not call "make package" at any time when
compiling for OS X, as this will build a disk image, and will not
work correctly.
Windows Development Build
-----------------------
@ -111,64 +110,62 @@ follow `Windows Installer Build (Cross-Compile)`_ instead.
6. Create the build directory::
mkdir client-build
cd client-build
mkdir client-build
cd client-build
7. Build the client::
cmake -G "MinGW Makefiles" ../client
mingw32-make
cmake -G "MinGW Makefiles" ../client
mingw32-make
.. note:: You can try using ninja to build in parallel using
``cmake -G Ninja ../client`` and ``ninja`` instead.
.. note:: Refer to the :ref:`generic-build-instructions` section for additional options.
.. note:: You can try using ninja to build in parallel using
``cmake -G Ninja ../client`` and ``ninja`` instead.
.. note:: Refer to the :ref:`generic-build-instructions` section for additional options.
The ownCloud binary will appear in the ``bin`` directory.
The ownCloud binary will appear in the ``bin`` directory.
Windows Installer Build (Cross-Compile)
---------------------------------------
Due to the large number of dependencies, building the client installer for Windows
is **currently only officially supported on openSUSE**, by using the MinGW cross compiler.
You can set up openSUSE 13.1, 13.2 or openSUSE Factory in a virtual machine if you do not
You can set up any currently supported version of openSUSE in a virtual machine if you do not
have it installed already.
To cross-compile:
In order to make setup simple, you can use the provided Dockerfile to build your own image.
1. Add the following repository using YaST or ``zypper ar`` (adjust when using another openSUSE version)::
1. Assuming you are in the root of the ownCloud Client's source tree, you can
build an image from this Dockerfile like this::
zypper ar https://build.opensuse.org/project/show/isv:ownCloud:toolchains:mingw:win32:stable
cd admin/win32/docker
docker build . -t ownCloud-client-win32:<version>
2. Install the cross-compiler packages and the cross-compiled dependencies::
Replace ``<version>`` by the version of the client you are building, e.g.
|version| for the release of the client that this document describes.
If you do not wish to use docker, you can run the commands in ``RUN`` manually
in a shell, e.g. to create your own build environment in a virtual machine.
zypper install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
mingw32-headers mingw32-runtime site-config mingw32-libwebp \
mingw32-cross-libqt5-qmake mingw32-cross-libqt5-qttools mingw32-libqt5*
.. note:: Docker images are specific to releases. This one refers to |version|.
Newer releases may have different dependencies, and thus require a later
version of the docker image! Always pick the docker image fitting your release
of ownCloud client!
3. For the installer, install the NSIS installer package::
2. From within the source tree Run the docker instance::
zypper install mingw32-cross-nsis mingw32-cross-nsis-plugin-uac mingw32-cross-nsis-plugin-nsprocess
docker run ownCloud-client-win32:<version> -v "$PWD:/home/jenkins/client" \
admin/win32/docker/build.sh $(id -u)
4. Follow the :ref:`generic-build-instructions`
It will run the build, create an NSIS based installer, as well as run tests.
You will find the resulting binary in an newly created ``build-win32`` subfolder.
.. note:: When building for Windows platforms, you must specify a special
toolchain file that enables cmake to locate the platform-specific tools. To add
this parameter to the call to cmake, enter
``-DCMAKE_TOOLCHAIN_FILE=../client/admin/win/Toolchain-mingw32-openSUSE.cmake``.
If you do not wish to use docker, and ran the ``RUN`` commands above in a virtual machine,
you can run the indented commands in the lower section of ``build.sh`` manually in your
source tree.
5. Build by running ``make``.
4. Finally, you should sign the installer to avoid warnings upon installation.
This requires a `Microsoft Authenticode`_ Certificate ``osslsigncode`` to sign the installer::
.. note:: Using ``make package`` produces an NSIS-based installer, provided
the NSIS mingw32 packages are installed.
6. If you want to sign the installer, acquire a `Microsoft Authenticode`_ Certificate and install ``osslsigncode`` to sign the installer::
zypper install osslsigncode
7. Sign the package::
osslsigncode -pkcs12 $HOME/.codesign/packages.pfx -h sha1 \
osslsigncode -pkcs12 $HOME/.codesign/packages.pfx -h sha256 \
-pass yourpass \
-n "ACME Client" \
-i "http://acme.com" \
@ -179,6 +176,7 @@ To cross-compile:
for ``-in``, use the URL to the time stamping server provided by your CA along with the Authenticode certificate. Alternatively,
you may use the official Microsoft ``signtool`` utility on Microsoft Windows.
If you're familiar with docker, you can use the version of ``osslsigncode`` that is part of the docker image.
.. _generic-build-instructions:
@ -195,30 +193,30 @@ To build the most up to date version of the client:
1. Clone the latest versions of the client from Git_ as follows::
git clone git://github.com/owncloud/client.git
cd client
git submodule init
git submodule update
git clone git://github.com/owncloud/client.git
cd client
git submodule init
git submodule update
2. Create the build directory::
mkdir client-build
cd client-build
mkdir client-build
cd client-build
3. Configure the client build::
cmake -DCMAKE_BUILD_TYPE="Debug" ..
.. note:: You must use absolute paths for the ``include`` and ``library``
directories.
.. note:: You must use absolute paths for the ``include`` and ``library``
directories.
.. note:: On Mac OS X, you need to specify ``-DCMAKE_INSTALL_PREFIX=target``,
where ``target`` is a private location, i.e. in parallel to your build
dir by specifying ``../install``.
.. note:: On Mac OS X, you need to specify ``-DCMAKE_INSTALL_PREFIX=target``,
where ``target`` is a private location, i.e. in parallel to your build
dir by specifying ``../install``.
4. Call ``make``.
The owncloud binary will appear in the ``bin`` directory.
The owncloud binary will appear in the ``bin`` directory.
The following are known cmake parameters:
@ -242,3 +240,4 @@ The following are known cmake parameters:
.. _Qt: http://www.qt.io/download
.. _`Microsoft Authenticode`: https://msdn.microsoft.com/en-us/library/ie/ms537361%28v=vs.85%29.aspx
.. _QtKeychain: https://github.com/frankosterfeld/qtkeychain
.. _Packages: http://s.sudre.free.fr/Software/Packages/about.html

View File

@ -288,3 +288,5 @@ epub_copyright = u'2013, The ownCloud developers'
# Include todos?
todo_include_todos = True
rst_epilog = '.. |version| replace:: %s' % version

@ -1 +1 @@
Subproject commit a8fc638c26dd47925e66f05fb87cface5dbbbd81
Subproject commit 2fdd8b2833ea1db7da08a61afda665eb6ecaa017

View File

@ -0,0 +1,6 @@
#!/bin/sh
# this script creates a plugin for nemo, just be replacing
# all occurences of Nautilus with Nemo.
/usr/bin/sed -i.org -e 's/autilus/emo/g' syncstate_nemo.py

View File

@ -63,7 +63,7 @@ static void callback(
qstring.resize(pathLength);
CFStringGetCharacters(path, CFRangeMake(0, pathLength), reinterpret_cast<UniChar *>(qstring.data()));
paths.append(qstring);
paths.append(qstring.normalized(QString::NormalizationForm_C));
}
reinterpret_cast<FolderWatcherPrivate*>(clientCallBackInfo)->doNotifyParent(paths);

View File

@ -67,11 +67,16 @@ set(libsync_SRCS
creds/dummycredentials.cpp
creds/abstractcredentials.cpp
creds/credentialscommon.cpp
creds/httpcredentials.cpp
../3rdparty/qjson/json.cpp
../3rdparty/certificates/p12topem.cpp
)
if(TOKEN_AUTH_ONLY)
set (libsync_SRCS ${libsync_SRCS} creds/tokencredentials.cpp)
else()
set (libsync_SRCS ${libsync_SRCS} creds/httpcredentials.cpp)
endif()
# These headers are installed for libowncloudsync to be used by 3rd party apps
set(owncloudsync_HEADERS
account.h

View File

@ -24,10 +24,6 @@
#include "accessmanager.h"
#include "utility.h"
#include <QInputDialog>
#include <QMutexLocker>
#include <QApplication>
namespace OCC
{

View File

@ -17,7 +17,6 @@
#include <QDebug>
#include <QNetworkReply>
#include <QSettings>
#include <QInputDialog>
#include <keychain.h>

View File

@ -121,11 +121,17 @@ bool TokenCredentials::ready() const
return _ready;
}
void TokenCredentials::fetch()
void TokenCredentials::fetchFromKeychain()
{
Q_EMIT fetched();
}
void TokenCredentials::askFromUser()
{
emit asked();
}
bool TokenCredentials::stillValid(QNetworkReply *reply)
{
return ((reply->error() != QNetworkReply::AuthenticationRequiredError)

View File

@ -44,7 +44,8 @@ public:
QString authType() const Q_DECL_OVERRIDE;
QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE;
bool ready() const Q_DECL_OVERRIDE;
void fetch() Q_DECL_OVERRIDE;
void askFromUser() Q_DECL_OVERRIDE;
void fetchFromKeychain() Q_DECL_OVERRIDE;
bool stillValid(QNetworkReply *reply) Q_DECL_OVERRIDE;
void persist() Q_DECL_OVERRIDE;
QString user() const Q_DECL_OVERRIDE;

View File

@ -325,9 +325,6 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, con
if( slashPos > -1 ) {
fileRef = file.midRef(slashPos+1);
}
if( fileRef.startsWith(QChar('.')) ) {
file_stat->flags = CSYNC_VIO_FILE_FLAGS_HIDDEN;
}
//qDebug() << "!!!!" << file_stat << file_stat->name << file_stat->file_id << map.count();
_results.append(file_stat);
}

View File

@ -2368,7 +2368,7 @@ Es ist nicht ratsam, diese zu benutzen.</translation>
<message>
<location filename="../src/gui/shareusergroupwidget.cpp" line="217"/>
<source>No results for &apos;%1&apos;</source>
<translation type="unfinished"/>
<translation>Keine Ergebnisse für &apos;%1&apos;</translation>
</message>
</context>
<context>

View File

@ -340,7 +340,7 @@
<message>
<location filename="../src/gui/activitywidget.cpp" line="419"/>
<source>List of ignored or erroneous files</source>
<translation>Liste de fichiers ignorés ou erronés</translation>
<translation>Liste des fichiers ignorés ou en erreur</translation>
</message>
<message>
<location filename="../src/gui/activitywidget.cpp" line="423"/>
@ -355,7 +355,7 @@
<message>
<location filename="../src/gui/activitywidget.cpp" line="429"/>
<source>Not Synced</source>
<translation>Non Synchronisé</translation>
<translation>Fichiers non synchronisés</translation>
</message>
<message>
<location filename="../src/gui/activitywidget.cpp" line="450"/>
@ -1457,7 +1457,7 @@ Les éléments dont la suppression automatique est permise seront supprimés s&a
<message>
<location filename="../src/gui/networksettings.cpp" line="128"/>
<source>Qt &gt;= 5.4 is required in order to use the bandwidth limit</source>
<translation>Qt &gt;= 5.4 est requis pour pouvoir utiliser la limite de bande passante</translation>
<translation>Qt &gt;= 5.4 est requis pour utiliser la limite de bande passante</translation>
</message>
</context>
<context>
@ -1492,7 +1492,7 @@ L&apos;assistant peut demander des privilèges additionnels durant le processus.
<message>
<location filename="../src/gui/updater/ocupdater.cpp" line="143"/>
<source>%1 version %2 available. Restart application to start the update.</source>
<translation>%1 version %2 disponible. Redémarrez l&apos;application pour démarrer la mise à jour.</translation>
<translation>%1 version %2 disponible. Redémarrez l&apos;application pour commencer la mise à jour.</translation>
</message>
<message>
<location filename="../src/gui/updater/ocupdater.cpp" line="149"/>
@ -2352,7 +2352,7 @@ Il est déconseillé de l&apos;utiliser.</translation>
<location filename="../src/gui/sharelinkwidget.cpp" line="505"/>
<location filename="../src/gui/sharelinkwidget.cpp" line="506"/>
<source>&amp;Share link</source>
<translation>&amp;Partager par lien public</translation>
<translation>Partager par &amp;lien public</translation>
</message>
</context>
<context>

View File

@ -322,7 +322,7 @@
<message>
<location filename="../src/gui/activityitemdelegate.cpp" line="147"/>
<source>%1 on %2 (disconnected)</source>
<translation type="unfinished"/>
<translation>%2 %1 ()</translation>
</message>
</context>
<context>
@ -3329,7 +3329,7 @@ It is not advisable to use it.</source>
<message>
<location filename="../src/gui/application.cpp" line="571"/>
<source>QT_LAYOUT_DIRECTION</source>
<translation type="unfinished"/>
<translation>QT_LAYOUT_DIRECTION</translation>
</message>
</context>
<context>

View File

@ -3336,7 +3336,7 @@ It is not advisable to use it.</source>
<message>
<location filename="../src/gui/application.cpp" line="571"/>
<source>QT_LAYOUT_DIRECTION</source>
<translation type="unfinished"/>
<translation>QT_LAYOUT_DIRECTION</translation>
</message>
</context>
<context>