Control: tags -1 moreinfo Control: retitle -1 unblock: owncloud/7.0.4+dfsg-2 Hi Niels, Le 10/12/2014 00:46, Niels Thykier a écrit : > Feel free to add those changes on top of the original upload. Thanks, it’s in. Updated (and filtered) debdiff from the version currently in testing attached. debdiff ../owncloud_7.0.3+dfsg-1.dsc ../owncloud_7.0.4+dfsg-2.dsc | \ filterdiff -x '*/core/doc/*' -x '*/apps/*/tests/*' \ -x '*/apps/*/l10n/fr.php' > I probably won't have time to do the second review / add unblocks before > tomorrow or maybe Saturday. No hurry from my side, thanks for giving the opportunity to update directly to this upstream point release. Regards David
diff -Nru owncloud-7.0.3+dfsg/apps/activity/l10n/fr.php owncloud-7.0.4+dfsg/apps/activity/l10n/fr.php diff -Nru owncloud-7.0.3+dfsg/apps/bookmarks/l10n/fr.php owncloud-7.0.4+dfsg/apps/bookmarks/l10n/fr.php diff -Nru owncloud-7.0.3+dfsg/apps/calendar/js/calendar.js owncloud-7.0.4+dfsg/apps/calendar/js/calendar.js --- owncloud-7.0.3+dfsg/apps/calendar/js/calendar.js 2014-11-10 12:18:35.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/calendar/js/calendar.js 2014-12-08 14:34:16.000000000 -0400 @@ -133,10 +133,14 @@ $('#fullcalendar').fullCalendar('unselect'); Calendar.UI.lockTime(); $( "#from" ).datepicker({ + minDate: null, + maxDate: null, dateFormat : 'dd-mm-yy', onSelect: function(){ Calendar.Util.adjustDate(); } }); $( "#to" ).datepicker({ + minDate: null, + maxDate: null, dateFormat : 'dd-mm-yy' }); $('#fromtime').timepicker({ diff -Nru owncloud-7.0.3+dfsg/apps/calendar/l10n/fr.php owncloud-7.0.4+dfsg/apps/calendar/l10n/fr.php diff -Nru owncloud-7.0.3+dfsg/apps/documents/js/viewer/viewer.js owncloud-7.0.4+dfsg/apps/documents/js/viewer/viewer.js --- owncloud-7.0.3+dfsg/apps/documents/js/viewer/viewer.js 2014-11-10 12:18:36.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/documents/js/viewer/viewer.js 2014-12-08 14:34:18.000000000 -0400 @@ -63,7 +63,9 @@ } else { //Public page, files app, etc var dirName = $('#dir').val()!='/' ? $('#dir').val() + '/' : '/'; - var location = OC.filePath('documents', 'ajax', 'download.php') + '?path=' + dirName + encodeURIComponent(filename); + var location = OC.filePath('documents', 'ajax', 'download.php') + '?path=' + encodeURIComponent(dirName) + encodeURIComponent(filename) + + '&requesttoken=' + oc_requesttoken; + OC.addStyle('documents', '3rdparty/webodf/editor'); } diff -Nru owncloud-7.0.3+dfsg/apps/documents/lib/db/session.php owncloud-7.0.4+dfsg/apps/documents/lib/db/session.php --- owncloud-7.0.3+dfsg/apps/documents/lib/db/session.php 2014-11-10 12:18:09.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/documents/lib/db/session.php 2014-12-08 14:34:18.000000000 -0400 @@ -122,7 +122,7 @@ public function insert(){ $esId = $this->getUniqueSessionId(); array_unshift($this->data, $esId); - return parent::insert($this->data); + return parent::insert(); } public function updateGenesisHash($esId, $genesisHash){ diff -Nru owncloud-7.0.3+dfsg/apps/files/appinfo/remote.php owncloud-7.0.4+dfsg/apps/files/appinfo/remote.php --- owncloud-7.0.3+dfsg/apps/files/appinfo/remote.php 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files/appinfo/remote.php 2014-12-08 14:32:57.000000000 -0400 @@ -38,7 +38,7 @@ $defaults = new OC_Defaults(); $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, $defaults->getName())); $server->addPlugin(new \Sabre\DAV\Locks\Plugin($lockBackend)); -$server->addPlugin(new \Sabre\DAV\Browser\Plugin(false)); // Show something in the Browser, but no upload +$server->addPlugin(new \Sabre\DAV\Browser\Plugin(false, false)); // Show something in the Browser, but no upload $server->addPlugin(new OC_Connector_Sabre_FilesPlugin()); $server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin()); $server->addPlugin(new OC_Connector_Sabre_ExceptionLoggerPlugin('webdav')); diff -Nru owncloud-7.0.3+dfsg/apps/files/tests/ajax_rename.php owncloud-7.0.4+dfsg/apps/files/tests/ajax_rename.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php owncloud-7.0.4+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php --- owncloud-7.0.3+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php 2014-12-08 14:34:14.000000000 -0400 @@ -26,9 +26,10 @@ $view = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($view); $user = \OCP\User::getUser(); +$loginName = \OC::$server->getUserSession()->getLoginName(); // check new password -$passwordCorrect = \OCP\User::checkPassword($user, $newPassword); +$passwordCorrect = \OCP\User::checkPassword($loginName, $newPassword); if ($passwordCorrect !== false) { diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/lib/stream.php owncloud-7.0.4+dfsg/apps/files_encryption/lib/stream.php --- owncloud-7.0.3+dfsg/apps/files_encryption/lib/stream.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_encryption/lib/stream.php 2014-12-08 14:34:14.000000000 -0400 @@ -573,6 +573,7 @@ \OC_FileProxy::$enabled = false; if ($this->rootView->file_exists($this->rawPath) && $this->size === 0) { + fclose($this->handle); $this->rootView->unlink($this->rawPath); } diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/lib/util.php owncloud-7.0.4+dfsg/apps/files_encryption/lib/util.php --- owncloud-7.0.3+dfsg/apps/files_encryption/lib/util.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_encryption/lib/util.php 2014-12-08 14:34:14.000000000 -0400 @@ -889,6 +889,25 @@ } /** + * Returns whether the given user is ready for encryption. + * Also returns true if the given user is the public user + * or the recovery key user. + * + * @param string $user user to check + * + * @return boolean true if the user is ready, false otherwise + */ + private function isUserReady($user) { + if ($user === $this->publicShareKeyId + || $user === $this->recoveryKeyId + ) { + return true; + } + $util = new Util($this->view, $user); + return $util->ready(); + } + + /** * Filter an array of UIDs to return only ones ready for sharing * @param array $unfilteredUsers users to be checked for sharing readiness * @return array as multi-dimensional array. keys: ready, unready @@ -900,16 +919,9 @@ // Loop through users and create array of UIDs that need new keyfiles foreach ($unfilteredUsers as $user) { - - $util = new Util($this->view, $user); - // Check that the user is encryption capable, or is the - // public system user 'ownCloud' (for public shares) - if ( - $user === $this->publicShareKeyId - or $user === $this->recoveryKeyId - or $util->ready() - ) { + // public system user (for public shares) + if ($this->isUserReady($user)) { // Construct array of ready UIDs for Keymanager{} $readyIds[] = $user; diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/crypt.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/crypt.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/helper.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/helper.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/hooks.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/hooks.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/keymanager.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/keymanager.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/proxy.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/proxy.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/share.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/share.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/stream.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/stream.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/testcase.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/testcase.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/trashbin.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/trashbin.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/util.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/util.php diff -Nru owncloud-7.0.3+dfsg/apps/files_encryption/tests/webdav.php owncloud-7.0.4+dfsg/apps/files_encryption/tests/webdav.php diff -Nru owncloud-7.0.3+dfsg/apps/files_external/lib/config.php owncloud-7.0.4+dfsg/apps/files_external/lib/config.php --- owncloud-7.0.3+dfsg/apps/files_external/lib/config.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_external/lib/config.php 2014-12-08 14:34:15.000000000 -0400 @@ -121,6 +121,14 @@ if ($data['user']) { $user = \OC::$server->getUserManager()->get($data['user']); + if (!$user) { + \OC_Log::write( + 'files_external', + 'Cannot init external mount points for non-existant user "' . $data['user'] . '".', + \OC_Log::WARN + ); + return; + } $userView = new \OC\Files\View('/' . $user->getUID() . '/files'); $changePropagator = new \OC\Files\Cache\ChangePropagator($userView); $etagPropagator = new \OCA\Files_External\EtagPropagator($user, $changePropagator, \OC::$server->getConfig()); diff -Nru owncloud-7.0.3+dfsg/apps/files_external/lib/smb_oc.php owncloud-7.0.4+dfsg/apps/files_external/lib/smb_oc.php --- owncloud-7.0.3+dfsg/apps/files_external/lib/smb_oc.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_external/lib/smb_oc.php 2014-12-08 14:34:15.000000000 -0400 @@ -13,12 +13,16 @@ class SMB_OC extends \OC\Files\Storage\SMB { private $username_as_share; + /** + * @param array $params + * @throws \Exception + */ public function __construct($params) { if (isset($params['host']) && \OC::$session->exists('smb-credentials')) { $host=$params['host']; $this->username_as_share = ($params['username_as_share'] === 'true'); - $params_auth = \OC::$session->get('smb-credentials'); + $params_auth = json_decode(\OC::$server->getCrypto()->decrypt(\OC::$session->get('smb-credentials')), true); $user = \OC::$session->get('loginname'); $password = $params_auth['password']; @@ -44,14 +48,34 @@ } } - public static function login( $params ) { - \OC::$session->set('smb-credentials', $params); + /** + * Intercepts the user credentials on login and stores them + * encrypted inside the session if SMB_OC storage is enabled. + * @param array $params + */ + public static function login($params) { + $mountpoints = \OC_Mount_Config::getAbsoluteMountPoints($params['uid']); + $mountpointClasses = array(); + foreach($mountpoints as $mountpoint) { + $mountpointClasses[$mountpoint['class']] = true; + } + if(isset($mountpointClasses['\OC\Files\Storage\SMB_OC'])) { + \OC::$session->set('smb-credentials', \OC::$server->getCrypto()->encrypt(json_encode($params))); + } } + /** + * @param string $path + * @return boolean + */ public function isSharable($path) { return false; } + /** + * @param bool $isPersonal + * @return bool + */ public function test($isPersonal = true) { if ($isPersonal) { if ($this->stat('')) { diff -Nru owncloud-7.0.3+dfsg/apps/files_sharing/appinfo/database.xml owncloud-7.0.4+dfsg/apps/files_sharing/appinfo/database.xml --- owncloud-7.0.3+dfsg/apps/files_sharing/appinfo/database.xml 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_sharing/appinfo/database.xml 2014-12-08 14:34:15.000000000 -0400 @@ -32,7 +32,7 @@ <field> <name>password</name> <type>text</type> - <notnull>true</notnull> + <notnull>false</notnull> <length>64</length> <comments>Optional password for the public share</comments> </field> diff -Nru owncloud-7.0.3+dfsg/apps/files_sharing/public.php owncloud-7.0.4+dfsg/apps/files_sharing/public.php --- owncloud-7.0.3+dfsg/apps/files_sharing/public.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_sharing/public.php 2014-12-08 14:34:15.000000000 -0400 @@ -1,5 +1,7 @@ <?php // Load other apps for file previews +use OCA\Files_Sharing\Helper; + OC_App::loadApps(); $appConfig = \OC::$server->getAppConfig(); @@ -132,6 +134,7 @@ $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path)); $tmpl->assign('dirToken', $linkItem['token']); $tmpl->assign('sharingToken', $token); + $tmpl->assign('server2serversharing', Helper::isOutgoingServer2serverShareEnabled()); $tmpl->assign('protected', isset($linkItem['share_with']) ? 'true' : 'false'); $urlLinkIdentifiers= (isset($token)?'&t='.$token:'') @@ -171,7 +174,7 @@ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); } else { - $tmpl->assign('dir', $dir); + $tmpl->assign('dir', ''); // Show file preview if viewer is available if ($type == 'file') { diff -Nru owncloud-7.0.3+dfsg/apps/files_sharing/templates/public.php owncloud-7.0.4+dfsg/apps/files_sharing/templates/public.php --- owncloud-7.0.3+dfsg/apps/files_sharing/templates/public.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/files_sharing/templates/public.php 2014-12-08 14:34:15.000000000 -0400 @@ -30,13 +30,18 @@ <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div class="header-right"> <span id="details"> - <span id="save" data-protected="<?php p($_['protected'])?>" data-owner="<?php p($_['displayName'])?>" data-name="<?php p($_['filename'])?>"> + <?php + if ($_['server2serversharing']) { + ?> + <span id="save" data-protected="<?php p($_['protected']) ?>" + data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>"> <button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button> <form class="save-form hidden" action="#"> <input type="text" id="remote_address" placeholder="example.com/owncloud"/> <button id="save-button-confirm" class="icon-confirm svg"></button> </form> </span> + <?php } ?> <a href="<?php p($_['downloadURL']); ?>" id="download" class="button"> <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/> <span id="download-text"><?php p($l->t('Download'))?></span> diff -Nru owncloud-7.0.3+dfsg/apps/files_sharing/tests/cache.php owncloud-7.0.4+dfsg/apps/files_sharing/tests/cache.php diff -Nru owncloud-7.0.3+dfsg/apps/firstrunwizard/l10n/fr.php owncloud-7.0.4+dfsg/apps/firstrunwizard/l10n/fr.php diff -Nru owncloud-7.0.3+dfsg/apps/gallery/js/slideshow.js owncloud-7.0.4+dfsg/apps/gallery/js/slideshow.js --- owncloud-7.0.3+dfsg/apps/gallery/js/slideshow.js 2014-11-10 12:18:36.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/gallery/js/slideshow.js 2014-12-08 14:34:18.000000000 -0400 @@ -141,7 +141,7 @@ } if (preloadUrl) { jQuery.fn.slideShow.loadImage( - fallBack, + preloadUrl, preloadFallBack ); } @@ -371,6 +371,9 @@ for (var i = 0; i < files.length; i++) { var file = files[i]; if (file.mimetype && file.mimetype.indexOf('image') >= 0) { + if (file.mimetype === 'image/tiff') { + continue; + } if (file.mimetype === 'image/svg+xml') { imageUrl = OCA.Files.Files.getDownloadUrl(file.name, dir); } else { @@ -406,5 +409,6 @@ jQuery.fn.slideShow.call(images, $('#slideshow'), start, {fallBacks: fallBacks}); }); OCA.Files.fileActions.setDefault('image', 'View'); + OCA.Files.fileActions.setDefault('image/tiff', 'Download'); } }); diff -Nru owncloud-7.0.3+dfsg/apps/updater/templates/update.php owncloud-7.0.4+dfsg/apps/updater/templates/update.php --- owncloud-7.0.3+dfsg/apps/updater/templates/update.php 2014-11-10 12:18:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/updater/templates/update.php 2014-12-08 14:34:03.000000000 -0400 @@ -19,7 +19,7 @@ <?php p($l->t('A new version is available: %s', array($_['version']))) ?> </p> <p ng-show="<?php p(!$isNewVersionAvailable) ?>"> - <?php p($l->t('Up to date. Checked on %s', array('checkedAt' => $_['checkedAt']))) ?> + <?php p($l->t('Up to date. Checked on %s', array($_['checkedAt']))) ?> </p> <div id="upd-step-title" style="display:none;"> <ul class="track-progress" data-steps="3"> diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/appinfo/register_command.php owncloud-7.0.4+dfsg/apps/user_ldap/appinfo/register_command.php --- owncloud-7.0.3+dfsg/apps/user_ldap/appinfo/register_command.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/user_ldap/appinfo/register_command.php 2014-12-08 14:34:15.000000000 -0400 @@ -9,3 +9,4 @@ $application->add(new OCA\user_ldap\Command\ShowConfig()); $application->add(new OCA\user_ldap\Command\SetConfig()); $application->add(new OCA\user_ldap\Command\TestConfig()); +$application->add(new OCA\user_ldap\Command\Search()); diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/command/search.php owncloud-7.0.4+dfsg/apps/user_ldap/command/search.php --- owncloud-7.0.3+dfsg/apps/user_ldap/command/search.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/user_ldap/command/search.php 2014-12-08 14:32:57.000000000 -0400 @@ -0,0 +1,100 @@ +<?php +/** + * Copyright (c) 2014 Arthur Schiwon <blizzz@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\user_ldap\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +use OCA\user_ldap\User_Proxy; +use OCA\user_ldap\Group_Proxy; +use OCA\user_ldap\lib\Helper; +use OCA\user_ldap\lib\LDAP; + +class Search extends Command { + protected function configure() { + $this + ->setName('ldap:search') + ->setDescription('executes a user or group search') + ->addArgument( + 'search', + InputArgument::REQUIRED, + 'the search string (can be empty)' + ) + ->addOption( + 'group', + null, + InputOption::VALUE_NONE, + 'searches groups instead of users' + ) + ->addOption( + 'offset', + null, + InputOption::VALUE_REQUIRED, + 'The offset of the result set. Needs to be a multiple of limit. defaults to 0.', + 0 + ) + ->addOption( + 'limit', + null, + InputOption::VALUE_REQUIRED, + 'limit the results. 0 means no limit, defaults to 15', + 15 + ) + ; + } + + /** + * Tests whether the offset and limit options are valid + * @param int $offset + * @param int $limit + * @throws \InvalidArgumentException + */ + protected function validateOffsetAndLimit($offset, $limit) { + if($limit < 0) { + throw new \InvalidArgumentException('limit must be 0 or greater'); + } + if($offset < 0) { + throw new \InvalidArgumentException('offset must be 0 or greater'); + } + if($limit === 0 && $offset !== 0) { + throw new \InvalidArgumentException('offset must be 0 if limit is also set to 0'); + } + if($offset > 0 && ($offset % $limit !== 0)) { + throw new \InvalidArgumentException('offset must be a multiple of limit'); + } + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $configPrefixes = Helper::getServerConfigurationPrefixes(true); + $ldapWrapper = new LDAP(); + + $offset = intval($input->getOption('offset')); + $limit = intval($input->getOption('limit')); + $this->validateOffsetAndLimit($offset, $limit); + + if($input->getOption('group')) { + $proxy = new Group_Proxy($configPrefixes, $ldapWrapper); + $getMethod = 'getGroups'; + $printID = false; + } else { + $proxy = new User_Proxy($configPrefixes, $ldapWrapper); + $getMethod = 'getDisplayNames'; + $printID = true; + } + + $result = $proxy->$getMethod($input->getArgument('search'), $limit, $offset); + foreach($result as $id => $name) { + $line = $name . ($printID ? ' ('.$id.')' : ''); + $output->writeln($line); + } + } +} diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/lib/access.php owncloud-7.0.4+dfsg/apps/user_ldap/lib/access.php --- owncloud-7.0.3+dfsg/apps/user_ldap/lib/access.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/user_ldap/lib/access.php 2014-12-08 14:34:15.000000000 -0400 @@ -403,6 +403,8 @@ //a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups //disabling Cache is required to avoid that the new user is cached as not-existing in fooExists check + //NOTE: mind, disabling cache affects only this instance! Using it + // outside of core user management will still cache the user as non-existing. $originalTTL = $this->connection->ldapCacheTTL; $this->connection->setConfiguration(array('ldapCacheTTL' => 0)); if(($isUser && !\OCP\User::userExists($intName)) @@ -507,6 +509,7 @@ if($isUsers) { //cache the user names so it does not need to be retrieved //again later (e.g. sharing dialogue). + $this->cacheUserExists($ocName); $this->cacheUserDisplayName($ocName, $nameByLDAP); } } @@ -516,6 +519,14 @@ } /** + * caches a user as existing + * @param string $ocName the internal ownCloud username + */ + public function cacheUserExists($ocName) { + $this->connection->writeToCache('userExists'.$ocName, true); + } + + /** * caches the user display name * @param string $ocName the internal ownCloud username * @param string $displayName the display name @@ -928,7 +939,7 @@ foreach($searchResults as $res) { $count = intval($this->ldap->countEntries($cr, $res)); $counter += $count; - if($count === $limit) { + if($count > 0 && $count === $limit) { $hasHitLimit = true; } } @@ -1073,12 +1084,18 @@ /** * escapes (user provided) parts for LDAP filter * @param string $input, the provided value + * @param bool $allowAsterisk wether in * at the beginning should be preserved * @return string the escaped string */ - public function escapeFilterPart($input) { + public function escapeFilterPart($input, $allowAsterisk = false) { + $asterisk = ''; + if($allowAsterisk && strlen($input) > 0 && $input[0] === '*') { + $asterisk = '*'; + $input = mb_substr($input, 1, null, 'UTF-8'); + } $search = array('*', '\\', '(', ')'); $replace = array('\\*', '\\\\', '\\(', '\\)'); - return str_replace($search, $replace, $input); + return $asterisk . str_replace($search, $replace, $input); } /** @@ -1141,6 +1158,33 @@ } /** + * creates a filter part for searches by splitting up the given search + * string into single words + * @param string $search the search term + * @param string[] $searchAttributes needs to have at least two attributes, + * otherwise it does not make sense :) + * @return string the final filter part to use in LDAP searches + * @throws \Exception + */ + private function getAdvancedFilterPartForSearch($search, $searchAttributes) { + if(!is_array($searchAttributes) || count($searchAttributes) < 2) { + throw new \Exception('searchAttributes must be an array with at least two string'); + } + $searchWords = explode(' ', trim($search)); + $wordFilters = array(); + foreach($searchWords as $word) { + $word .= '*'; + //every word needs to appear at least once + $wordMatchOneAttrFilters = array(); + foreach($searchAttributes as $attr) { + $wordMatchOneAttrFilters[] = $attr . '=' . $word; + } + $wordFilters[] = $this->combineFilterWithOr($wordMatchOneAttrFilters); + } + return $this->combineFilterWithAnd($wordFilters); + } + + /** * creates a filter part for searches * @param string $search the search term * @param string[]|null $searchAttributes @@ -1150,7 +1194,19 @@ */ private function getFilterPartForSearch($search, $searchAttributes, $fallbackAttribute) { $filter = array(); - $search = empty($search) ? '*' : '*'.$search.'*'; + $haveMultiSearchAttributes = (is_array($searchAttributes) && count($searchAttributes) > 0); + if($haveMultiSearchAttributes && strpos(trim($search), ' ') !== false) { + try { + return $this->getAdvancedFilterPartForSearch($search, $searchAttributes); + } catch(\Exception $e) { + \OCP\Util::writeLog( + 'user_ldap', + 'Creating advanced filter for search failed, falling back to simple method.', + \OCP\Util::INFO + ); + } + } + $search = empty($search) ? '*' : $search.'*'; if(!is_array($searchAttributes) || count($searchAttributes) === 0) { if(empty($fallbackAttribute)) { return ''; @@ -1316,32 +1372,38 @@ * converts a binary SID into a string representation * @param string $sid * @return string - * @link http://blogs.freebsdish.org/tmclaugh/2010/07/21/finding-a-users-primary-group-in-ad/#comment-2855 */ public function convertSID2Str($sid) { - try { - if(!function_exists('bcadd')) { - \OCP\Util::writeLog('user_ldap', - 'You need to install bcmath module for PHP to have support ' . - 'for AD primary groups', \OCP\Util::WARN); - throw new \Exception('missing bcmath module'); - } - $srl = ord($sid[0]); - $numberSubID = ord($sid[1]); - $x = substr($sid, 2, 6); - $h = unpack('N', "\x0\x0" . substr($x,0,2)); - $l = unpack('N', substr($x,2,6)); - $iav = bcadd(bcmul($h[1], bcpow(2,32)), $l[1]); - $subIDs = array(); - for ($i=0; $i<$numberSubID; $i++) { - $subID = unpack('V', substr($sid, 8+4*$i, 4)); - $subIDs[] = $subID[1]; - } - } catch (\Exception $e) { + // The format of a SID binary string is as follows: + // 1 byte for the revision level + // 1 byte for the number n of variable sub-ids + // 6 bytes for identifier authority value + // n*4 bytes for n sub-ids + // + // Example: 010400000000000515000000a681e50e4d6c6c2bca32055f + // Legend: RRNNAAAAAAAAAAAA11111111222222223333333344444444 + $revision = ord($sid[0]); + $numberSubID = ord($sid[1]); + + $subIdStart = 8; // 1 + 1 + 6 + $subIdLength = 4; + if (strlen($sid) !== $subIdStart + $subIdLength * $numberSubID) { + // Incorrect number of bytes present. return ''; } - return sprintf('S-%d-%d-%s', $srl, $iav, implode('-', $subIDs)); + // 6 bytes = 48 bits can be represented using floats without loss of + // precision (see https://gist.github.com/bantu/886ac680b0aef5812f71) + $iav = number_format(hexdec(bin2hex(substr($sid, 2, 6))), 0, '', ''); + + $subIDs = array(); + for ($i = 0; $i < $numberSubID; $i++) { + $subID = unpack('V', substr($sid, $subIdStart + $subIdLength * $i, $subIdLength)); + $subIDs[] = sprintf('%u', $subID[1]); + } + + // Result for example above: S-1-5-21-249921958-728525901-1594176202 + return sprintf('S-%d-%s-%s', $revision, $iav, implode('-', $subIDs)); } /** diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/tests/access.php owncloud-7.0.4+dfsg/apps/user_ldap/tests/access.php Les fichiers binaires /tmp/zV6oAxSKjw/owncloud-7.0.3+dfsg/apps/user_ldap/tests/data/sid.dat et /tmp/yL6vpOzOmz/owncloud-7.0.4+dfsg/apps/user_ldap/tests/data/sid.dat sont différents diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/tests/user_ldap.php owncloud-7.0.4+dfsg/apps/user_ldap/tests/user_ldap.php diff -Nru owncloud-7.0.3+dfsg/apps/user_ldap/user_ldap.php owncloud-7.0.4+dfsg/apps/user_ldap/user_ldap.php --- owncloud-7.0.3+dfsg/apps/user_ldap/user_ldap.php 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/apps/user_ldap/user_ldap.php 2014-12-08 14:34:15.000000000 -0400 @@ -64,8 +64,14 @@ return false; } $dn = $ldap_users[0]; - $user = $this->access->userManager->get($dn); + if(is_null($user)) { + \OCP\Util::writeLog('user_ldap', + 'LDAP Login: Could not get user object for DN ' . $dn . + '. Maybe the LDAP entry has no set display name attribute?', + \OCP\Util::WARN); + return false; + } if($user->getUsername() !== false) { //are the credentials OK? if(!$this->access->areCredentialsValid($dn, $password)) { @@ -87,7 +93,7 @@ * Get a list of all users. */ public function getUsers($search = '', $limit = 10, $offset = 0) { - $search = $this->access->escapeFilterPart($search); + $search = $this->access->escapeFilterPart($search, true); $cachekey = 'getUsers-'.$search.'-'.$limit.'-'.$offset; //check if users are cached, if so return @@ -286,7 +292,12 @@ public function countUsers() { $filter = \OCP\Util::mb_str_replace( '%uid', '*', $this->access->connection->ldapLoginFilter, 'UTF-8'); + $cacheKey = 'countUsers-'.$filter; + if(!is_null($entries = $this->access->connection->getFromCache($cacheKey))) { + return $entries; + } $entries = $this->access->countUsers($filter); + $this->access->connection->writeToCache($cacheKey, $entries); return $entries; } } diff -Nru owncloud-7.0.3+dfsg/config/config.sample.php owncloud-7.0.4+dfsg/config/config.sample.php --- owncloud-7.0.3+dfsg/config/config.sample.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/config/config.sample.php 2014-12-08 14:34:15.000000000 -0400 @@ -65,13 +65,14 @@ 'trusted_domains' => array ( 'demo.example.org', - 'otherdomain.example.org:8080', + 'otherdomain.example.org', ), /** * Where user files are stored; this defaults to ``data/`` in the ownCloud - * directory. The SQLite database is also stored here, when you use SQLite. + * directory. The SQLite database is also stored here, when you use SQLite. (SQLite is + * available only in ownCloud Community Edition) */ 'datadirectory' => '/var/www/owncloud/data', @@ -82,8 +83,15 @@ 'version' => '', /** - * Identifies the database used with this installation: ``sqlite``, ``mysql``, - * ``pgsql``, ``oci``, or ``mssql``. + * Identifies the database used with this installation. See also config option + * ``supportedDatabases`` + * + * Available: + * - sqlite (SQLite3 - Community Edition Only) + * - mysql (MySQL) + * - pgsql (PostgreSQL) + * - oci (Oracle - Enterprise Edition Only) + * - mssql (Microsoft SQL Server - Enterprise Edition Only) */ 'dbtype' => 'sqlite', @@ -428,6 +436,15 @@ */ 'check_for_working_htaccess' => true, +/** + * In certain environments it is desired to have a read-only config file. + * When this switch is set to ``true`` ownCloud will not verify whether the + * configuration is writable. However, it will not be possible to configure + * all options via the web-interface. Furthermore, when updating ownCloud + * it is required to make the config file writable again for the update + * process. + */ +'config_is_read_only' => false, /** * Logging @@ -521,6 +538,7 @@ /** * When enabled, admins may install apps from the ownCloud app store. + * The app store is disabled by default for ownCloud Enterprise Edition */ 'appstoreenabled' => true, @@ -809,11 +827,11 @@ * Database types that are supported for installation. * * Available: - * - sqlite (SQLite3) + * - sqlite (SQLite3 - Community Edition Only) * - mysql (MySQL) * - pgsql (PostgreSQL) - * - oci (Oracle) - * - mssql (Microsoft SQL Server) + * - oci (Oracle - Enterprise Edition Only) + * - mssql (Microsoft SQL Server - Enterprise Edition Only) */ 'supportedDatabases' => array( 'sqlite', @@ -831,4 +849,10 @@ "style-src 'self' 'unsafe-inline'; frame-src *; img-src *; ". "font-src 'self' data:; media-src *", +/** + * Secret used by ownCloud for various purposes, e.g. to encrypt data. If you + * lose this string there will be data corruption. + */ +'secret' => 'ICertainlyShouldHaveChangedTheDefaultSecret', + ); diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/antivirus_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/antivirus_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/auth_ldap.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/auth_ldap.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/automatic_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/automatic_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/background_jobs_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/background_jobs_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/background_jobs.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/background_jobs.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/big_file_upload_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/big_file_upload_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/collaborative_documents_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/collaborative_documents_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/config_sample_php_parameters.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/config_sample_php_parameters.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_3rdparty.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_3rdparty.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration-antivirus.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration-antivirus.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_apps.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_apps.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_assets.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_assets.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_automation.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_automation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_config_sample_php.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_config_sample_php.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_custom_clients.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_custom_clients.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_database.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_database.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_encryption.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_encryption.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_file_sharing.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_file_sharing.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_files_locking.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_files_locking.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_knowledgebase.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_knowledgebase.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_language.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_language.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_logging.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_logging.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_mail.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_mail.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_preview.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_preview.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_reverseproxy.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_reverseproxy.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_users.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuration_users.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_big_file_upload.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuring_big_file_upload.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_documents.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuring_documents.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_search.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/configuring_search.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_client_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/custom_client_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_mount_config_gui.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/custom_mount_config_gui.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_mount_config.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/custom_mount_config.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_user_backend.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/custom_user_backend.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/database_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/database_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/email_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/email_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/encryption_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/encryption_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/external_storage_configuration_gui.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/external_storage_configuration_gui.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/external_storage_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/external_storage_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/file_sharing_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/file_sharing_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/files_locking_enabling.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/files_locking_enabling.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/index.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/index.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/js_css_asset_management_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/js_css_asset_management_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/knowledgebase_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/knowledgebase_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/language_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/language_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/logging_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/logging_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/previews_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/previews_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/reverse_proxy_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/reverse_proxy_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/search_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/search_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/server_to_server_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/server_to_server_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/server_to_server_managing.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/server_to_server_managing.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/serving_static_files_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/serving_static_files_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/thirdparty_php_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/thirdparty_php_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_auth_ftp_smb_imap.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/user_auth_ftp_smb_imap.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_auth_ldap.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/user_auth_ldap.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/user_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/configuration/xsendfile.html owncloud-7.0.4+dfsg/core/doc/admin/configuration/xsendfile.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/contents.html owncloud-7.0.4+dfsg/core/doc/admin/contents.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/index.html owncloud-7.0.4+dfsg/core/doc/admin/index.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/appliance_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/appliance_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/apps_management_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/apps_management_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_hiawatha.html owncloud-7.0.4+dfsg/core/doc/admin/installation/configuration_hiawatha.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_lighttpd.html owncloud-7.0.4+dfsg/core/doc/admin/installation/configuration_lighttpd.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_nginx.html owncloud-7.0.4+dfsg/core/doc/admin/installation/configuration_nginx.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_yaws.html owncloud-7.0.4+dfsg/core/doc/admin/installation/configuration_yaws.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/hiawatha_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/installation/hiawatha_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/index.html owncloud-7.0.4+dfsg/core/doc/admin/installation/index.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_appliance.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_appliance.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_linux.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_linux.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_macos.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_macos.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_others.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_others.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_source.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_source.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_ucs.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_ucs.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_windows.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_windows.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_wizard.html owncloud-7.0.4+dfsg/core/doc/admin/installation/installation_wizard.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/lighttpd_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/installation/lighttpd_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/linux_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/linux_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/macos_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/macos_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/nginx_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/installation/nginx_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/others_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/others_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/selinux_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/installation/selinux_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/source_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/source_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/ucs_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/ucs_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/windows_installation.html owncloud-7.0.4+dfsg/core/doc/admin/installation/windows_installation.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/installation/yaws_configuration.html owncloud-7.0.4+dfsg/core/doc/admin/installation/yaws_configuration.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/issues/index.html owncloud-7.0.4+dfsg/core/doc/admin/issues/index.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/maintenance/convert_db.html owncloud-7.0.4+dfsg/core/doc/admin/maintenance/convert_db.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/maintenance/index.html owncloud-7.0.4+dfsg/core/doc/admin/maintenance/index.html diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/maintenance/upgrade.html owncloud-7.0.4+dfsg/core/doc/admin/maintenance/upgrade.html Les fichiers binaires /tmp/zV6oAxSKjw/owncloud-7.0.3+dfsg/core/doc/admin/objects.inv et /tmp/yL6vpOzOmz/owncloud-7.0.4+dfsg/core/doc/admin/objects.inv sont différents diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/antivirus_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/antivirus_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/auth_ldap.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/auth_ldap.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/automatic_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/automatic_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/background_jobs_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/background_jobs_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/background_jobs.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/background_jobs.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/big_file_upload_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/big_file_upload_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/collaborative_documents_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/collaborative_documents_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/config_sample_php_parameters.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/config_sample_php_parameters.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_3rdparty.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_3rdparty.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration-antivirus.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration-antivirus.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_apps.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_apps.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_assets.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_assets.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_automation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_automation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_custom_clients.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_custom_clients.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_database.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_database.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_encryption.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_encryption.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_file_sharing.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_file_sharing.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_files_locking.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_files_locking.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_language.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_language.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_logging.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_logging.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_mail.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_mail.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_preview.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_preview.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_users.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuration_users.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_documents.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuring_documents.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_search.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/configuring_search.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_client_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/custom_client_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_mount_config.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/custom_mount_config.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_user_backend.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/custom_user_backend.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/database_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/database_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/email_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/email_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/encryption_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/encryption_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration_gui.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration_gui.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/file_sharing_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/file_sharing_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/files_locking_enabling.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/files_locking_enabling.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/index.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/index.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/js_css_asset_management_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/js_css_asset_management_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/knowledgebase_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/knowledgebase_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/language_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/language_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/logging_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/logging_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/previews_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/previews_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/reverse_proxy_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/reverse_proxy_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/search_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/search_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/server_to_server_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/server_to_server_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/server_to_server_managing.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/server_to_server_managing.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/serving_static_files_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/serving_static_files_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/thirdparty_php_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/thirdparty_php_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_auth_ftp_smb_imap.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/user_auth_ftp_smb_imap.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_auth_ldap.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/user_auth_ldap.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/user_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/xsendfile.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/configuration/xsendfile.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/contents.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/contents.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/index.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/index.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/appliance_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/appliance_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/apps_management_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/apps_management_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_hiawatha.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/configuration_hiawatha.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_lighttpd.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/configuration_lighttpd.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_nginx.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/configuration_nginx.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_yaws.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/configuration_yaws.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/hiawatha_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/hiawatha_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/index.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/index.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_appliance.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_appliance.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_linux.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_linux.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_macos.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_macos.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_others.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_others.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_source.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_source.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_ucs.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_ucs.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_windows.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_windows.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_wizard.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/installation_wizard.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/lighttpd_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/lighttpd_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/linux_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/linux_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/macos_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/macos_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/nginx_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/nginx_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/others_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/others_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/selinux_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/selinux_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/source_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/source_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/ucs_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/ucs_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/windows_installation.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/windows_installation.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/yaws_configuration.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/installation/yaws_configuration.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/issues/index.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/issues/index.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/maintenance/convert_db.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/maintenance/convert_db.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/maintenance/index.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/maintenance/index.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/admin/_sources/maintenance/upgrade.txt owncloud-7.0.4+dfsg/core/doc/admin/_sources/maintenance/upgrade.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/user/contents.html owncloud-7.0.4+dfsg/core/doc/user/contents.html diff -Nru owncloud-7.0.3+dfsg/core/doc/user/documents.html owncloud-7.0.4+dfsg/core/doc/user/documents.html diff -Nru owncloud-7.0.3+dfsg/core/doc/user/files/filesweb.html owncloud-7.0.4+dfsg/core/doc/user/files/filesweb.html diff -Nru owncloud-7.0.3+dfsg/core/doc/user/_sources/documents.txt owncloud-7.0.4+dfsg/core/doc/user/_sources/documents.txt diff -Nru owncloud-7.0.3+dfsg/core/doc/user/_sources/files/filesweb.txt owncloud-7.0.4+dfsg/core/doc/user/_sources/files/filesweb.txt diff -Nru owncloud-7.0.3+dfsg/core/js/lostpassword.js owncloud-7.0.4+dfsg/core/js/lostpassword.js --- owncloud-7.0.3+dfsg/core/js/lostpassword.js 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/core/js/lostpassword.js 2014-12-08 14:34:15.000000000 -0400 @@ -115,7 +115,11 @@ }, redirect : function(msg){ - window.location = OC.webroot; + if(OC.webroot !== '') { + window.location = OC.webroot; + } else { + window.location = '/'; + } }, resetError : function(msg){ diff -Nru owncloud-7.0.3+dfsg/core/js/share.js owncloud-7.0.4+dfsg/core/js/share.js --- owncloud-7.0.3+dfsg/core/js/share.js 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/core/js/share.js 2014-12-08 14:34:15.000000000 -0400 @@ -444,10 +444,10 @@ } }); } - $('#shareWith').autocomplete({minLength: 1, source: function(search, response) { + $('#shareWith').autocomplete({minLength: 2, delay: 750, source: function(search, response) { var $loading = $('#dropdown .shareWithLoading'); $loading.removeClass('hidden'); - $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term, itemShares: OC.Share.itemShares }, function(result) { + $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term.trim(), itemShares: OC.Share.itemShares }, function(result) { $loading.addClass('hidden'); if (result.status == 'success' && result.data.length > 0) { $( "#shareWith" ).autocomplete( "option", "autoFocus", true ); diff -Nru owncloud-7.0.3+dfsg/debian/changelog owncloud-7.0.4+dfsg/debian/changelog --- owncloud-7.0.3+dfsg/debian/changelog 2014-11-13 13:50:08.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/changelog 2014-12-10 12:15:07.000000000 -0400 @@ -1,3 +1,107 @@ +owncloud (7.0.4+dfsg-2) unstable; urgency=medium + + * Upload to unstable as agreed with the release team + + -- David Prévot <taffit@debian.org> Wed, 10 Dec 2014 12:15:07 -0400 + +owncloud (7.0.4+dfsg-1) experimental; urgency=medium + + [ Lukas Reschke ] + * Trim port from domain + * Create config if it does not exists + + [ Arthur Schiwon ] + * preserve an asterisk at the start when escaping a search term + + [ Frank Karlitschek ] + * 7.0.4 + + [ David Prévot ] + * Refresh patches + * Update upstream changelog + + -- David Prévot <taffit@debian.org> Tue, 09 Dec 2014 18:32:21 -0400 + +owncloud (7.0.4~rc2+dfsg-1) experimental; urgency=medium + + * Upload RC to experimental + + [ Arthur Schiwon ] + * add ldap-search command to occ + * LDAP search filter creation changes + + [ Lukas Reschke ] + * Allow read-only configuration + + [ Frank Karlitschek ] + * 7.0.4 RC2 + + [ David Prévot ] + * Refresh patches + + -- David Prévot <taffit@debian.org> Sat, 06 Dec 2014 01:51:30 -0400 + +owncloud (7.0.4~rc1+dfsg-2) unstable; urgency=medium + + * Upload to unstable as agreed with the release team + + -- David Prévot <taffit@debian.org> Sat, 06 Dec 2014 17:38:10 -0400 + +owncloud (7.0.4~rc1+dfsg-1) experimental; urgency=medium + + * Upload RC to experimental + + [ Morris Jobke ] + * Fix infinite loop if count and limit is 0 + + [ Lukas Reschke ] + * Run preupdate before an update + * Add repair steps for legacy config files + * Fix mapping of relative paths + * Backport \OC\Security\Crypto to ownCloud 7 + * Only store user credentials when SMB_OC storage is enabled + * Use `/` as redirect location if webroot is set to an empty value + * Try to read the file only instead of trying to touch + * Don't show favicon to prevent iteration through subfolders + * Check for XMLWriter class + + [ Vincent Petry ] + * Fix root path handling for WebDAV ext storage + * Fix file upload to ext storage when recovery key is enabled + * Show warning when invalid user was passed + + [ Andreas Fischer ] + * user_ldap: Reimplement convertSID2Str() without BCMath dependency. + + [ michag86 ] + * removal of wrong/double implemented check + * cleanup group admin(s) on deleteGroup + + [ Clark Tomlinson ] + * Hiding add to your own cloud if server2server sharing is not enabled + + [ Michael Roitzsch ] + * file size on non-(Linux/BSD/Windows)-installations + + [ Bjoern Schiessle ] + * use login name to verify password + + [ Craig Morrissey ] + * adjust autocomplete behavior for sharing menu + + [ Georg Ehrke ] + * delete all children's previews when deleting a folder + * delete old previews + + [ Frank Karlitschek ] + * 7.0.4 RC1 + + [ David Prévot ] + * Refresh patches + * Update upstream changelog + + -- David Prévot <taffit@debian.org> Mon, 01 Dec 2014 19:10:39 -0400 + owncloud (7.0.3+dfsg-1) unstable; urgency=medium [ David Prévot ] diff -Nru owncloud-7.0.3+dfsg/debian/patches/0001-Disable-the-appstore.patch owncloud-7.0.4+dfsg/debian/patches/0001-Disable-the-appstore.patch --- owncloud-7.0.3+dfsg/debian/patches/0001-Disable-the-appstore.patch 2014-11-11 10:17:42.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/patches/0001-Disable-the-appstore.patch 2014-12-08 21:49:10.000000000 -0400 @@ -23,21 +23,21 @@ 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php -index a7f92d9..fb48959 100644 +index 6da3a68..fa627c5 100644 --- a/config/config.sample.php +++ b/config/config.sample.php -@@ -521,8 +521,9 @@ $CONFIG = array( - +@@ -539,8 +539,9 @@ $CONFIG = array( /** * When enabled, admins may install apps from the ownCloud app store. -+ * Debian: disabled by default, see /usr/share/doc/owncloud/README.Debian + * The app store is disabled by default for ownCloud Enterprise Edition ++ * and for Debian, see /usr/share/doc/owncloud/README.Debian */ -'appstoreenabled' => true, +'appstoreenabled' => false, /** * The URL of the appstore to use. -@@ -536,12 +537,13 @@ $CONFIG = array( +@@ -554,12 +555,13 @@ $CONFIG = array( * file system path to the app folder. The key ``url`` defines the HTTP web path * to that folder, starting from the ownCloud web root. The key ``writable`` * indicates if a web server can write files to that folder. @@ -54,7 +54,7 @@ ), diff --git a/lib/base.php b/lib/base.php -index 4cd9203..d39432a 100644 +index d653e06..f6684e0 100644 --- a/lib/base.php +++ b/lib/base.php @@ -157,7 +157,7 @@ class OC { @@ -67,7 +67,7 @@ OC::$APPSROOTS[] = array( 'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps', diff --git a/lib/private/app.php b/lib/private/app.php -index 20c0f5f..ecfe180 100644 +index 9712775..f1984a9 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -487,7 +487,7 @@ class OC_App { @@ -93,10 +93,10 @@ } diff --git a/lib/private/setup.php b/lib/private/setup.php -index 2d6cede..b4b9f0d 100644 +index a958aba..216d313 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php -@@ -186,6 +186,8 @@ class OC_Setup { +@@ -189,6 +189,8 @@ class OC_Setup { OC_Config::setValue('overwrite.cli.url', \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . OC::$WEBROOT); OC_Config::setValue('dbtype', $dbtype); OC_Config::setValue('version', implode('.', OC_Util::getVersion())); @@ -106,7 +106,7 @@ $dbSetup->initialize($options); $dbSetup->setupDatabase($username); diff --git a/lib/private/util.php b/lib/private/util.php -index 08de46b..484b84c 100644 +index 2642a71..fa6c12d 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -442,7 +442,7 @@ class OC_Util { diff -Nru owncloud-7.0.3+dfsg/debian/patches/0002-Fix-displayed-version.patch owncloud-7.0.4+dfsg/debian/patches/0002-Fix-displayed-version.patch --- owncloud-7.0.3+dfsg/debian/patches/0002-Fix-displayed-version.patch 2014-11-11 10:17:42.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/patches/0002-Fix-displayed-version.patch 2014-12-08 21:49:10.000000000 -0400 @@ -18,10 +18,10 @@ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php -index fb48959..df81faa 100644 +index fa627c5..7e91a2e 100644 --- a/config/config.sample.php +++ b/config/config.sample.php -@@ -406,7 +406,7 @@ $CONFIG = array( +@@ -414,7 +414,7 @@ $CONFIG = array( * Check if ownCloud is up-to-date and shows a notification if a new version is * available. */ @@ -44,10 +44,10 @@ if(isset($data['version']) && $data['version'] != '' and $data['version'] !== Array() && OC_User::isAdminUser(OC_User::getUser())) { $this->assign('updateAvailable', true); diff --git a/lib/private/util.php b/lib/private/util.php -index 484b84c..360b170 100644 +index fa6c12d..b87449c 100644 --- a/lib/private/util.php +++ b/lib/private/util.php -@@ -1309,7 +1309,7 @@ class OC_Util { +@@ -1316,7 +1316,7 @@ class OC_Util { * @return string */ public static function getHumanVersion() { diff -Nru owncloud-7.0.3+dfsg/debian/patches/0003-Improve-logfile-handling.patch owncloud-7.0.4+dfsg/debian/patches/0003-Improve-logfile-handling.patch --- owncloud-7.0.3+dfsg/debian/patches/0003-Improve-logfile-handling.patch 2014-11-11 10:17:42.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/patches/0003-Improve-logfile-handling.patch 2014-12-08 21:49:11.000000000 -0400 @@ -14,10 +14,10 @@ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php -index df81faa..dfb774a 100644 +index 7e91a2e..2508e2e 100644 --- a/config/config.sample.php +++ b/config/config.sample.php -@@ -442,8 +442,9 @@ $CONFIG = array( +@@ -459,8 +459,9 @@ $CONFIG = array( /** * Change the ownCloud logfile name from ``owncloud.log`` to something else. @@ -29,10 +29,10 @@ /** * Loglevel to start logging at. Valid values are: 0 = Debug, 1 = Info, 2 = diff --git a/lib/base.php b/lib/base.php -index d39432a..25992b2 100644 +index f6684e0..d7a9b0e 100644 --- a/lib/base.php +++ b/lib/base.php -@@ -615,7 +615,7 @@ class OC { +@@ -617,7 +617,7 @@ class OC { if (OC_Config::getValue('installed', false) && OC_Config::getValue('log_rotate_size', false) && !\OCP\Util::needUpgrade()) { //don't try to do this before we are properly setup //use custom logfile path if defined, otherwise use default of owncloud.log in data directory diff -Nru owncloud-7.0.3+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch owncloud-7.0.4+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch --- owncloud-7.0.3+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch 2014-11-11 10:17:43.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch 2014-12-08 21:49:11.000000000 -0400 @@ -14,10 +14,10 @@ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/base.php b/lib/base.php -index 25992b2..93eb6a6 100644 +index d7a9b0e..1f82058 100644 --- a/lib/base.php +++ b/lib/base.php -@@ -431,12 +431,12 @@ class OC { +@@ -439,12 +439,12 @@ class OC { // register autoloader require_once __DIR__ . '/autoloader.php'; self::$loader = new \OC\Autoloader(); diff -Nru owncloud-7.0.3+dfsg/debian/upstream/changelog owncloud-7.0.4+dfsg/debian/upstream/changelog --- owncloud-7.0.3+dfsg/debian/upstream/changelog 2014-11-13 13:49:45.000000000 -0400 +++ owncloud-7.0.4+dfsg/debian/upstream/changelog 2014-12-09 18:32:19.000000000 -0400 @@ -1,3 +1,19 @@ +Version 7.0.4 December 9th 2014 + + Added XMLWriter check + Better deleted outdated previews + Store storage credential in session only if needed + Don't disclose relative directory path for single shared files of user + Password reset fixes + Fix enable app only for a specific group + fixing port configuration in trusted domains + LDAP fixes + Make group search case sensitive + Allow admin to change users display name + ldap performance improvements + config.php can now be read only + Several smaller fixes + Version 7.0.3 November 13th 2014 Some OS X server fixes diff -Nru owncloud-7.0.3+dfsg/lib/base.php owncloud-7.0.4+dfsg/lib/base.php --- owncloud-7.0.3+dfsg/lib/base.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/base.php 2014-12-08 14:34:15.000000000 -0400 @@ -188,9 +188,17 @@ public static function checkConfig() { $l = OC_L10N::get('lib'); - if (file_exists(self::$configDir . "/config.php") - and !is_writable(self::$configDir . "/config.php") - ) { + + // Create config in case it does not already exists + $configFilePath = self::$configDir .'/config.php'; + if(!file_exists($configFilePath)) { + @touch($configFilePath); + } + + // Check if config is writable + $configFileWritable = is_writable($configFilePath); + if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled() + || !$configFileWritable && \OCP\Util::needUpgrade()) { if (self::$CLI) { echo $l->t('Cannot write into "config" directory!')."\n"; echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n"; @@ -573,14 +581,8 @@ header('HTTP/1.1 400 Bad Request'); header('Status: 400 Bad Request'); - $domain = $_SERVER['SERVER_NAME']; - // Append port to domain in case it is not - if($_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443') { - $domain .= ':'.$_SERVER['SERVER_PORT']; - } - $tmpl = new OCP\Template('core', 'untrustedDomain', 'guest'); - $tmpl->assign('domain', $domain); + $tmpl->assign('domain', $_SERVER['SERVER_NAME']); $tmpl->printPage(); exit(); diff -Nru owncloud-7.0.3+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php owncloud-7.0.4+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php --- owncloud-7.0.3+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php 2014-12-08 14:34:15.000000000 -0400 @@ -34,6 +34,7 @@ use OCP\IURLGenerator; use OCP\IRequest; use OCP\ILogger; +use OCP\AppFramework\Controller; /** @@ -116,6 +117,16 @@ } } + /** + * FIXME: Use DI once available + * Checks if app is enabled (also inclues a check whether user is allowed to access the resource) + * The getAppPath() check is here since components such as settings also use the AppFramework and + * therefore won't pass this check. + */ + if(\OC_App::getAppPath($this->appName) !== false && !\OC_App::isEnabled($this->appName)) { + throw new SecurityException('App is not enabled', Http::STATUS_PRECONDITION_FAILED); + } + } diff -Nru owncloud-7.0.3+dfsg/lib/private/app.php owncloud-7.0.4+dfsg/lib/private/app.php --- owncloud-7.0.3+dfsg/lib/private/app.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/app.php 2014-12-08 14:34:15.000000000 -0400 @@ -1186,10 +1186,6 @@ * @return bool */ public static function updateApp($appId) { - if (file_exists(self::getAppPath($appId) . '/appinfo/preupdate.php')) { - self::loadApp($appId, false); - include self::getAppPath($appId) . '/appinfo/preupdate.php'; - } if (file_exists(self::getAppPath($appId) . '/appinfo/database.xml')) { OC_DB::updateDbFromStructure(self::getAppPath($appId) . '/appinfo/database.xml'); } diff -Nru owncloud-7.0.3+dfsg/lib/private/config.php owncloud-7.0.4+dfsg/lib/private/config.php --- owncloud-7.0.3+dfsg/lib/private/config.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/config.php 2014-12-08 14:32:58.000000000 -0400 @@ -138,12 +138,12 @@ // Include file and merge config foreach ($configFiles as $file) { - if(!@touch($file) && $file === $this->configFilePath) { - // Writing to the main config might not be possible, e.g. if the wrong + $filePointer = @fopen($file, 'r'); + if($file === $this->configFilePath && $filePointer === false) { + // Opening the main config might not be possible, e.g. if the wrong // permissions are set (likely on a new installation) continue; } - $filePointer = fopen($file, 'r'); // Try to acquire a file lock if(!flock($filePointer, LOCK_SH)) { diff -Nru owncloud-7.0.3+dfsg/lib/private/files/filesystem.php owncloud-7.0.4+dfsg/lib/private/files/filesystem.php --- owncloud-7.0.3+dfsg/lib/private/files/filesystem.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/files/filesystem.php 2014-12-08 14:34:15.000000000 -0400 @@ -695,13 +695,22 @@ * @param bool $stripTrailingSlash * @return string */ - public static function normalizePath($path, $stripTrailingSlash = true) { + public static function normalizePath($path, $stripTrailingSlash = true, $isAbsolutePath = false) { if ($path == '') { return '/'; } + //no windows style slashes $path = str_replace('\\', '/', $path); + // When normalizing an absolute path, we need to ensure that the drive-letter + // is still at the beginning on windows + $windows_drive_letter = ''; + if ($isAbsolutePath && \OC_Util::runningOnWindows() && preg_match('#^([a-zA-Z])$#', $path[0]) && $path[1] == ':' && $path[2] == '/') { + $windows_drive_letter = substr($path, 0, 2); + $path = substr($path, 2); + } + //add leading slash if ($path[0] !== '/') { $path = '/' . $path; @@ -730,7 +739,7 @@ //normalize unicode if possible $path = \OC_Util::normalizeUnicode($path); - return $path; + return $windows_drive_letter . $path; } /** diff -Nru owncloud-7.0.3+dfsg/lib/private/files/mapper.php owncloud-7.0.4+dfsg/lib/private/files/mapper.php --- owncloud-7.0.3+dfsg/lib/private/files/mapper.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/files/mapper.php 2014-12-08 14:32:58.000000000 -0400 @@ -66,8 +66,8 @@ */ public function copy($path1, $path2) { - $path1 = $this->stripLast($path1); - $path2 = $this->stripLast($path2); + $path1 = $this->resolveRelativePath($path1); + $path2 = $this->resolveRelativePath($path2); $physicPath1 = $this->logicToPhysical($path1, true); $physicPath2 = $this->logicToPhysical($path2, true); @@ -113,18 +113,11 @@ return ''; } - private function stripLast($path) { - if (substr($path, -1) == '/') { - $path = substr_replace($path, '', -1); - } - return $path; - } - /** * @param string $logicPath */ private function resolveLogicPath($logicPath) { - $logicPath = $this->stripLast($logicPath); + $logicPath = $this->resolveRelativePath($logicPath); $sql = 'SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?'; $result = \OC_DB::executeAudited($sql, array(md5($logicPath))); $result = $result->fetchRow(); @@ -136,7 +129,7 @@ } private function resolvePhysicalPath($physicalPath) { - $physicalPath = $this->stripLast($physicalPath); + $physicalPath = $this->resolveRelativePath($physicalPath); $sql = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path_hash` = ?'); $result = \OC_DB::executeAudited($sql, array(md5($physicalPath))); $result = $result->fetchRow(); @@ -144,12 +137,35 @@ return $result['logic_path']; } + private function resolveRelativePath($path) { + $explodedPath = explode('/', $path); + $pathArray = array(); + foreach ($explodedPath as $pathElement) { + if (empty($pathElement) || ($pathElement == '.')) { + continue; + } elseif ($pathElement == '..') { + if (count($pathArray) == 0) { + return false; + } + array_pop($pathArray); + } else { + array_push($pathArray, $pathElement); + } + } + if (substr($path, 0, 1) == '/') { + $path = '/'; + } else { + $path = ''; + } + return $path.implode('/', $pathArray); + } + /** * @param string $logicPath * @param boolean $store */ private function create($logicPath, $store) { - $logicPath = $this->stripLast($logicPath); + $logicPath = $this->resolveRelativePath($logicPath); $index = 0; // create the slugified path @@ -177,14 +193,12 @@ /** * @param integer $index */ - public function slugifyPath($path, $index=null) { + public function slugifyPath($path, $index = null) { $path = $this->stripRootFolder($path, $this->unchangedPhysicalRoot); $pathElements = explode('/', $path); $sluggedElements = array(); - - $last= end($pathElements); - + foreach ($pathElements as $pathElement) { // remove empty elements if (empty($pathElement)) { @@ -196,20 +210,19 @@ // apply index to file name if ($index !== null) { - $last= array_pop($sluggedElements); + $last = array_pop($sluggedElements); // if filename contains periods - add index number before last period - if (preg_match('~\.[^\.]+$~i',$last,$extension)){ - array_push($sluggedElements, substr($last,0,-(strlen($extension[0]))).'-'.$index.$extension[0]); + if (preg_match('~\.[^\.]+$~i', $last, $extension)) { + array_push($sluggedElements, substr($last, 0, -(strlen($extension[0]))) . '-' . $index . $extension[0]); } else { // if filename doesn't contain periods add index ofter the last char - array_push($sluggedElements, $last.'-'.$index); - } - + array_push($sluggedElements, $last . '-' . $index); + } } $sluggedPath = $this->unchangedPhysicalRoot.implode('/', $sluggedElements); - return $this->stripLast($sluggedPath); + return $this->resolveRelativePath($sluggedPath); } /** @@ -218,8 +231,8 @@ * @param string $text * @return string */ - private function slugify($text) - { + private function slugify($text) { + $originalText = $text; // replace non letter or digits or dots by - $text = preg_replace('~[^\\pL\d\.]+~u', '-', $text); @@ -241,7 +254,17 @@ $text = preg_replace('~\.+$~', '', $text); if (empty($text)) { - return uniqid(); + /** + * Item slug would be empty. Previously we used uniqid() here. + * However this means that the behaviour is not reproducible, so + * when uploading files into a "empty" folder, the folders name is + * different. + * + * If there would be a md5() hash collision, the deduplicate check + * will spot this and append an index later, so this should not be + * a problem. + */ + return md5($originalText); } return $text; diff -Nru owncloud-7.0.3+dfsg/lib/private/files/storage/dav.php owncloud-7.0.4+dfsg/lib/private/files/storage/dav.php --- owncloud-7.0.3+dfsg/lib/private/files/storage/dav.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/files/storage/dav.php 2014-12-08 14:34:15.000000000 -0400 @@ -431,6 +431,7 @@ public function getPermissions($path) { $this->init(); + $path = $this->cleanPath($path); $response = $this->client->propfind($this->encodePath($path), array('{http://owncloud.org/ns}permissions')); if (isset($response['{http://owncloud.org/ns}permissions'])) { return $this->parsePermissions($response['{http://owncloud.org/ns}permissions']); @@ -475,6 +476,7 @@ */ public function hasUpdated($path, $time) { $this->init(); + $path = $this->cleanPath($path); try { $response = $this->client->propfind($this->encodePath($path), array( '{DAV:}getlastmodified', diff -Nru owncloud-7.0.3+dfsg/lib/private/files/storage/mappedlocal.php owncloud-7.0.4+dfsg/lib/private/files/storage/mappedlocal.php --- owncloud-7.0.3+dfsg/lib/private/files/storage/mappedlocal.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/files/storage/mappedlocal.php 2014-12-08 14:34:15.000000000 -0400 @@ -24,9 +24,6 @@ } public function __destruct() { - if (defined('PHPUNIT_RUN')) { - $this->mapper->removePath($this->datadir, true, true); - } } public function getId() { diff -Nru owncloud-7.0.3+dfsg/lib/private/group/database.php owncloud-7.0.4+dfsg/lib/private/group/database.php --- owncloud-7.0.3+dfsg/lib/private/group/database.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/group/database.php 2014-12-08 14:34:15.000000000 -0400 @@ -84,6 +84,10 @@ $stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `gid` = ?" ); $stmt->execute( array( $gid )); + // Delete the group-groupadmin relation + $stmt = OC_DB::prepare( "DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ?" ); + $stmt->execute( array( $gid )); + return true; } @@ -168,7 +172,7 @@ * Returns a list with all groups */ public function getGroups($search = '', $limit = null, $offset = null) { - $stmt = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` LIKE ? ORDER BY `gid` ASC', $limit, $offset); + $stmt = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE LOWER(`gid`) LIKE LOWER(?) ORDER BY `gid` ASC', $limit, $offset); $result = $stmt->execute(array('%' . $search . '%')); $groups = array(); while ($row = $result->fetchRow()) { diff -Nru owncloud-7.0.3+dfsg/lib/private/helper.php owncloud-7.0.4+dfsg/lib/private/helper.php --- owncloud-7.0.3+dfsg/lib/private/helper.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/helper.php 2014-12-08 14:34:15.000000000 -0400 @@ -1049,4 +1049,12 @@ return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative); } + + /** + * Returns whether the config file is set manually to read-only + * @return bool + */ + public static function isReadOnlyConfigEnabled() { + return \OC::$server->getConfig()->getSystemValue('config_is_read_only', false); + } } diff -Nru owncloud-7.0.3+dfsg/lib/private/largefilehelper.php owncloud-7.0.4+dfsg/lib/private/largefilehelper.php --- owncloud-7.0.3+dfsg/lib/private/largefilehelper.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/largefilehelper.php 2014-12-08 14:32:58.000000000 -0400 @@ -148,7 +148,7 @@ if (\OC_Helper::is_function_enabled('exec')) { $os = strtolower(php_uname('s')); $arg = escapeshellarg($filename); - $result = ''; + $result = null; if (strpos($os, 'linux') !== false) { $result = $this->exec("stat -c %s $arg"); } else if (strpos($os, 'bsd') !== false || strpos($os, 'darwin') !== false) { diff -Nru owncloud-7.0.3+dfsg/lib/private/preview.php owncloud-7.0.4+dfsg/lib/private/preview.php --- owncloud-7.0.3+dfsg/lib/private/preview.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/preview.php 2014-12-08 14:34:15.000000000 -0400 @@ -47,6 +47,7 @@ //filemapper used for deleting previews // index is path, value is fileinfo static public $deleteFileMapper = array(); + static public $deleteChildrenMapper = array(); /** * preview images object @@ -188,6 +189,21 @@ return $this->info; } + + /** + * @return array|null + */ + private function getChildren() { + $absPath = $this->fileView->getAbsolutePath($this->file); + $absPath = Files\Filesystem::normalizePath($absPath); + + if (array_key_exists($absPath, self::$deleteChildrenMapper)) { + return self::$deleteChildrenMapper[$absPath]; + } + + return null; + } + /** * set the path of the file you want a thumbnail from * @param string $file @@ -268,6 +284,10 @@ return $this; } + /** + * @param bool $keepAspect + * @return $this + */ public function setKeepAspect($keepAspect) { $this->keepAspect = $keepAspect; return $this; @@ -311,20 +331,25 @@ /** * deletes all previews of a file - * @return bool */ public function deleteAllPreviews() { $file = $this->getFile(); $fileInfo = $this->getFileInfo($file); - if($fileInfo !== null && $fileInfo !== false) { - $fileId = $fileInfo->getId(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; - $this->userView->deleteAll($previewPath); - return $this->userView->rmdir($previewPath); + $toDelete = $this->getChildren(); + $toDelete[] = $fileInfo; + + foreach ($toDelete as $delete) { + if ($delete !== null && $delete !== false) { + /** @var \OCP\Files\FileInfo $delete */ + $fileId = $delete->getId(); + + $previewPath = $this->getPreviewPath($fileId); + $this->userView->deleteAll($previewPath); + $this->userView->rmdir($previewPath); + } } - return false; } /** @@ -390,7 +415,7 @@ return array(); } - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + $previewPath = $this->getPreviewPath($fileId); $wantedAspectRatio = (float) ($this->getMaxX() / $this->getMaxY()); @@ -504,7 +529,7 @@ $this->preview = $preview; $this->resizeAndCrop(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + $previewPath = $this->getPreviewPath($fileId); $cachePath = $this->buildCachePath($fileId); if ($this->userView->is_dir($this->getThumbnailsFolder() . '/') === false) { @@ -661,6 +686,7 @@ /** * register a new preview provider to be used + * @param string $class * @param array $options * @return void */ @@ -726,14 +752,24 @@ array_multisort($keys, SORT_DESC, self::$providers); } + /** + * @param array $args + */ public static function post_write($args) { self::post_delete($args, 'files/'); } + /** + * @param array $args + */ public static function prepare_delete_files($args) { self::prepare_delete($args, 'files/'); } + /** + * @param array $args + * @param string $prefix + */ public static function prepare_delete($args, $prefix='') { $path = $args['path']; if (substr($path, 0, 1) === '/') { @@ -741,20 +777,63 @@ } $view = new \OC\Files\View('/' . \OC_User::getUser() . '/' . $prefix); - $info = $view->getFileInfo($path); - \OC\Preview::$deleteFileMapper = array_merge( - \OC\Preview::$deleteFileMapper, - array( - Files\Filesystem::normalizePath($view->getAbsolutePath($path)) => $info, - ) - ); + $absPath = Files\Filesystem::normalizePath($view->getAbsolutePath($path)); + self::addPathToDeleteFileMapper($absPath, $view->getFileInfo($path)); + if ($view->is_dir($path)) { + $children = self::getAllChildren($view, $path); + self::$deleteChildrenMapper[$absPath] = $children; + } + } + + /** + * @param string $absolutePath + * @param \OCP\Files\FileInfo $info + */ + private static function addPathToDeleteFileMapper($absolutePath, $info) { + self::$deleteFileMapper[$absolutePath] = $info; } + /** + * @param \OC\Files\View $view + * @param string $path + * @return array + */ + private static function getAllChildren($view, $path) { + $children = $view->getDirectoryContent($path); + $childrensFiles = array(); + + $fakeRootLength = strlen($view->getRoot()); + + for ($i = 0; $i < count($children); $i++) { + $child = $children[$i]; + + $childsPath = substr($child->getPath(), $fakeRootLength); + + if ($view->is_dir($childsPath)) { + $children = array_merge( + $children, + $view->getDirectoryContent($childsPath) + ); + } else { + $childrensFiles[] = $child; + } + } + + return $childrensFiles; + } + + /** + * @param array $args + */ public static function post_delete_files($args) { self::post_delete($args, 'files/'); } + /** + * @param array $args + * @param string $prefix + */ public static function post_delete($args, $prefix='') { $path = Files\Filesystem::normalizePath($args['path']); @@ -802,12 +881,18 @@ $maxX = $this->getMaxX(); $maxY = $this->getMaxY(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; - $preview = $previewPath . $maxX . '-' . $maxY . '.png'; + $previewPath = $this->getPreviewPath($fileId); + $preview = $previewPath . strval($maxX) . '-' . strval($maxY); if ($this->keepAspect) { - $preview = $previewPath . $maxX . '-with-aspect.png'; - return $preview; + $preview .= '-with-aspect'; } + $preview .= '.png'; + return $preview; } + + + private function getPreviewPath($fileId) { + return $this->getThumbnailsFolder() . '/' . $fileId . '/'; + } } diff -Nru owncloud-7.0.3+dfsg/lib/private/repair.php owncloud-7.0.4+dfsg/lib/private/repair.php --- owncloud-7.0.3+dfsg/lib/private/repair.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/repair.php 2014-12-08 14:34:15.000000000 -0400 @@ -10,6 +10,7 @@ use OC\Hooks\BasicEmitter; use OC\Hooks\Emitter; +use OC\Repair\RepairConfig; class Repair extends BasicEmitter { /** @@ -69,7 +70,8 @@ */ public static function getRepairSteps() { return array( - new \OC\Repair\RepairMimeTypes() + new \OC\Repair\RepairMimeTypes(), + new RepairConfig(), ); } @@ -83,14 +85,15 @@ $steps = array( new \OC\Repair\InnoDB(), new \OC\Repair\Collation(\OC::$server->getConfig(), \OC_DB::getConnection()), - new \OC\Repair\SearchLuceneTables() + new \OC\Repair\SearchLuceneTables(), + new \OC\Repair\RepairConfig() ); //There is no need to delete all previews on every single update //only 7.0.0 thru 7.0.2 generated broken previews $currentVersion = \OC_Config::getValue('version'); if (version_compare($currentVersion, '7.0.0.0', '>=') && - version_compare($currentVersion, '7.0.2.2', '<=')) { + version_compare($currentVersion, '7.0.3.4', '<=')) { $steps[] = new \OC\Repair\Preview(); } diff -Nru owncloud-7.0.3+dfsg/lib/private/request.php owncloud-7.0.4+dfsg/lib/private/request.php --- owncloud-7.0.3+dfsg/lib/private/request.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/request.php 2014-12-08 14:34:15.000000000 -0400 @@ -13,7 +13,7 @@ const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#'; const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#'; - const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)(:[0-9]+|)$/'; + const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)$/'; /** * Check overwrite condition @@ -27,22 +27,50 @@ } /** + * Strips a potential port from a domain (in format domain:port) + * @param $host + * @return string $host without appended port + */ + public static function getDomainWithoutPort($host) { + $pos = strrpos($host, ':'); + if ($pos !== false) { + $port = substr($host, $pos + 1); + if (is_numeric($port)) { + $host = substr($host, 0, $pos); + } + } + return $host; + } + + /** * Checks whether a domain is considered as trusted from the list * of trusted domains. If no trusted domains have been configured, returns * true. * This is used to prevent Host Header Poisoning. - * @param string $domain + * @param string $domainWithPort * @return bool true if the given domain is trusted or if no trusted domains * have been configured */ - public static function isTrustedDomain($domain) { - $trustedList = \OC_Config::getValue('trusted_domains', array()); + public static function isTrustedDomain($domainWithPort) { + // Extract port from domain if needed + $domain = self::getDomainWithoutPort($domainWithPort); + + // FIXME: Empty config array defaults to true for now. - Deprecate this behaviour with ownCloud 8. + $trustedList = \OC::$server->getConfig()->getSystemValue('trusted_domains', array()); if (empty($trustedList)) { return true; } + + // FIXME: Workaround for older instances still with port applied. Remove for ownCloud 9. + if(in_array($domainWithPort, $trustedList)) { + return true; + } + + // Always allow access from localhost if (preg_match(self::REGEX_LOCALHOST, $domain) === 1) { return true; } + return in_array($domain, $trustedList); } diff -Nru owncloud-7.0.3+dfsg/lib/private/security/crypto.php owncloud-7.0.4+dfsg/lib/private/security/crypto.php --- owncloud-7.0.3+dfsg/lib/private/security/crypto.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/security/crypto.php 2014-12-08 14:34:15.000000000 -0400 @@ -0,0 +1,130 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + + +namespace OC\Security; + +use Crypt_AES; +use Crypt_Hash; +use OCP\Security\ICrypto; +use OCP\Security\StringUtils; +use OCP\IConfig; + +/** + * Class Crypto provides a high-level encryption layer using AES-CBC. If no key has been provided + * it will use the secret defined in config.php as key. Additionally the message will be HMAC'd. + * + * Usage: + * $encryptWithDefaultPassword = \OC::$server->getCrypto()->encrypt('EncryptedText'); + * $encryptWithCustompassword = \OC::$server->getCrypto()->encrypt('EncryptedText', 'password'); + * + * @package OC\Security + */ +class Crypto implements ICrypto { + /** @var Crypt_AES $cipher */ + private $cipher; + /** @var int */ + private $ivLength = 16; + /** @var IConfig */ + private $config; + + /** + * @param IConfig $config + */ + function __construct(IConfig $config) { + $this->cipher = new Crypt_AES(); + $this->config = $config; + } + + /** + * Custom implementation of hex2bin since the function is only available starting + * with PHP 5.4 + * + * @TODO Remove this once 5.3 support for ownCloud is dropped + * @param $message + * @return string + */ + protected static function hexToBin($message) { + if (function_exists('hex2bin')) { + return hex2bin($message); + } + + return pack("H*", $message); + } + + /** + * @param string $message The message to authenticate + * @param string $password Password to use (defaults to `secret` in config.php) + * @return string Calculated HMAC + */ + public function calculateHMAC($message, $password = '') { + if($password === '') { + $password = $this->config->getSystemValue('secret'); + } + + // Append an "a" behind the password and hash it to prevent reusing the same password as for encryption + $password = hash('sha512', $password . 'a'); + + $hash = new Crypt_Hash('sha512'); + $hash->setKey($password); + return $hash->hash($message); + } + + /** + * Encrypts a value and adds an HMAC (Encrypt-Then-MAC) + * @param string $plaintext + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken + * @return string Authenticated ciphertext + */ + public function encrypt($plaintext, $password = '') { + if($password === '') { + $password = $this->config->getSystemValue('secret'); + } + $this->cipher->setPassword($password); + + $iv = \OC_Util::generateRandomBytes($this->ivLength); + $this->cipher->setIV($iv); + + $ciphertext = bin2hex($this->cipher->encrypt($plaintext)); + $hmac = bin2hex($this->calculateHMAC($ciphertext.$iv, $password)); + + return $ciphertext.'|'.$iv.'|'.$hmac; + } + + /** + * Decrypts a value and verifies the HMAC (Encrypt-Then-Mac) + * @param string $authenticatedCiphertext + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken + * @return string plaintext + * @throws \Exception If the HMAC does not match + */ + public function decrypt($authenticatedCiphertext, $password = '') { + if($password === '') { + $password = $this->config->getSystemValue('secret'); + } + $this->cipher->setPassword($password); + + $parts = explode('|', $authenticatedCiphertext); + if(sizeof($parts) !== 3) { + throw new \Exception('Authenticated ciphertext could not be decoded.'); + } + + $ciphertext = self::hexToBin($parts[0]); + $iv = $parts[1]; + $hmac = self::hexToBin($parts[2]); + + $this->cipher->setIV($iv); + + if(!StringUtils::equals($this->calculateHMAC($parts[0].$parts[1], $password), $hmac)) { + throw new \Exception('HMAC does not match.'); + } + + return $this->cipher->decrypt($ciphertext); + } + +} \ Pas de fin de ligne à la fin du fichier diff -Nru owncloud-7.0.3+dfsg/lib/private/security/stringutils.php owncloud-7.0.4+dfsg/lib/private/security/stringutils.php --- owncloud-7.0.3+dfsg/lib/private/security/stringutils.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/security/stringutils.php 2014-12-08 14:34:15.000000000 -0400 @@ -0,0 +1,46 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Security; + +class StringUtils { + + /** + * Compares whether two strings are equal. To prevent guessing of the string + * length this is done by comparing two hashes against each other and afterwards + * a comparison of the real string to prevent against the unlikely chance of + * collisions. + * + * Be aware that this function may leak whether the string to compare have a different + * length. + * + * @param string $expected The expected value + * @param string $input The input to compare against + * @return bool True if the two strings are equal, otherwise false. + */ + public static function equals($expected, $input) { + + if(!is_string($expected) || !is_string($input)) { + return false; + } + + if(function_exists('hash_equals')) { + return hash_equals($expected, $input); + } + + $randomString = \OC_Util::generateRandomBytes(10); + + if(hash('sha512', $expected.$randomString) === hash('sha512', $input.$randomString)) { + if($expected === $input) { + return true; + } + } + + return false; + } +} \ Pas de fin de ligne à la fin du fichier diff -Nru owncloud-7.0.3+dfsg/lib/private/server.php owncloud-7.0.4+dfsg/lib/private/server.php --- owncloud-7.0.3+dfsg/lib/private/server.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/server.php 2014-12-08 14:34:15.000000000 -0400 @@ -10,6 +10,7 @@ use OC\Files\Node\Root; use OC\Files\View; use OCP\IServerContainer; +use OC\Security\Crypto; /** * Class Server @@ -199,6 +200,9 @@ $this->registerService('Search', function ($c) { return new Search(); }); + $this->registerService('Crypto', function ($c) { + return new Crypto(\OC::$server->getConfig()); + }); $this->registerService('Db', function ($c) { return new Db(); }); @@ -480,6 +484,15 @@ } /** + * Returns a Crypto instance + * + * @return \OCP\Security\ICrypto + */ + function getCrypto() { + return $this->query('Crypto'); + } + + /** * Returns an instance of the db facade * * @return \OCP\IDb diff -Nru owncloud-7.0.3+dfsg/lib/private/setup.php owncloud-7.0.4+dfsg/lib/private/setup.php --- owncloud-7.0.3+dfsg/lib/private/setup.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/setup.php 2014-12-08 14:34:15.000000000 -0400 @@ -90,7 +90,9 @@ 'name' => 'MS SQL' ) ); - $configuredDatabases = $this->config->getSystemValue('supportedDatabases', array('sqlite', 'mysql', 'pgsql', 'oci', 'mssql')); + + $configuredDatabases = $this->config->getSystemValue('supportedDatabases', + array('sqlite', 'mysql', 'pgsql')); if(!is_array($configuredDatabases)) { throw new Exception('Supported databases are not properly configured.'); } @@ -164,7 +166,7 @@ && is_array($options['trusted_domains'])) { $trustedDomains = $options['trusted_domains']; } else { - $trustedDomains = array(OC_Request::serverHost()); + $trustedDomains = array(\OC_Request::getDomainWithoutPort(\OC_Request::serverHost())); } if (OC_Util::runningOnWindows()) { @@ -179,6 +181,7 @@ //generate a random salt that is used to salt the local user passwords $salt = OC_Util::generateRandomBytes(30); OC_Config::setValue('passwordsalt', $salt); + OC_Config::setValue('secret', OC_Util::generateRandomBytes(96)); //write the config file OC_Config::setValue('trusted_domains', $trustedDomains); diff -Nru owncloud-7.0.3+dfsg/lib/private/share/helper.php owncloud-7.0.4+dfsg/lib/private/share/helper.php --- owncloud-7.0.3+dfsg/lib/private/share/helper.php 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/share/helper.php 2014-12-08 14:32:58.000000000 -0400 @@ -189,20 +189,23 @@ public static function calculateExpireDate($defaultExpireSettings, $creationTime, $userExpireDate = null) { $expires = false; + $defaultExpires = null; if (!empty($defaultExpireSettings['defaultExpireDateSet'])) { - $expires = $creationTime + $defaultExpireSettings['expireAfterDays'] * 86400; + $defaultExpires = $creationTime + $defaultExpireSettings['expireAfterDays'] * 86400; } if (isset($userExpireDate)) { // if the admin decided to enforce the default expire date then we only take // the user defined expire date of it is before the default expire date - if ($expires && !empty($defaultExpireSettings['enforceExpireDate'])) { - $expires = min($userExpireDate, $expires); + if ($defaultExpires && !empty($defaultExpireSettings['enforceExpireDate'])) { + $expires = min($userExpireDate, $defaultExpires); } else { $expires = $userExpireDate; } + } else if ($defaultExpires && !empty($defaultExpireSettings['enforceExpireDate'])) { + $expires = $defaultExpires; } return $expires; diff -Nru owncloud-7.0.3+dfsg/lib/private/share/share.php owncloud-7.0.4+dfsg/lib/private/share/share.php --- owncloud-7.0.3+dfsg/lib/private/share/share.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/share/share.php 2014-12-08 14:34:15.000000000 -0400 @@ -288,9 +288,10 @@ * @param string $itemType * @param string $itemSource * @param string $user User user to whom the item was shared + * @param int $shareType only look for a specific share type * @return array Return list of items with file_target, permissions and expiration */ - public static function getItemSharedWithUser($itemType, $itemSource, $user) { + public static function getItemSharedWithUser($itemType, $itemSource, $user, $shareType = null) { $shares = array(); $fileDependend = false; @@ -314,6 +315,11 @@ $arguments[] = $user; } + if ($shareType !== null) { + $where .= ' AND `share_type` = ? '; + $arguments[] = $shareType; + } + $query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $where); $result = \OC_DB::executeAudited($query, $arguments); @@ -695,7 +701,7 @@ // check if it is a valid itemType self::getBackend($itemType); - $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith); + $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $shareType); $toDelete = array(); $newParent = null; @@ -1254,14 +1260,18 @@ if (isset($shareType)) { // Include all user and group items if ($shareType == self::$shareTypeUserAndGroups && isset($shareWith)) { - $where .= ' AND `share_type` IN (?,?,?)'; + $where .= ' AND ((`share_type` in (?, ?) AND `share_with` = ?) '; $queryArgs[] = self::SHARE_TYPE_USER; - $queryArgs[] = self::SHARE_TYPE_GROUP; $queryArgs[] = self::$shareTypeGroupUserUnique; - $userAndGroups = array_merge(array($shareWith), \OC_Group::getUserGroups($shareWith)); - $placeholders = join(',', array_fill(0, count($userAndGroups), '?')); - $where .= ' AND `share_with` IN ('.$placeholders.')'; - $queryArgs = array_merge($queryArgs, $userAndGroups); + $queryArgs[] = $shareWith; + $groups = \OC_Group::getUserGroups($shareWith); + if (!empty($groups)) { + $placeholders = join(',', array_fill(0, count($groups), '?')); + $where .= ' OR (`share_type` = ? AND `share_with` IN ('.$placeholders.')) '; + $queryArgs[] = self::SHARE_TYPE_GROUP; + $queryArgs = array_merge($queryArgs, $groups); + } + $where .= ')'; // Don't include own group shares $where .= ' AND `uid_owner` != ?'; $queryArgs[] = $shareWith; @@ -1452,8 +1462,11 @@ $row['permissions'] &= ~\OCP\PERMISSION_SHARE; } // Add display names to result - if ( isset($row['share_with']) && $row['share_with'] != '') { + if ( isset($row['share_with']) && $row['share_with'] != '' && + isset($row['share_with']) && $row['share_type'] === self::SHARE_TYPE_USER) { $row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']); + } else { + $row['share_with_displayname'] = $row['share_with']; } if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']); diff -Nru owncloud-7.0.3+dfsg/lib/private/updater.php owncloud-7.0.4+dfsg/lib/private/updater.php --- owncloud-7.0.3+dfsg/lib/private/updater.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/updater.php 2014-12-08 14:34:15.000000000 -0400 @@ -262,7 +262,6 @@ protected function checkAppUpgrade($version) { $apps = \OC_App::getEnabledApps(); - foreach ($apps as $appId) { if ($version) { $info = \OC_App::getAppInfo($appId); @@ -272,6 +271,15 @@ } if ($compatible && \OC_App::shouldUpgrade($appId)) { + /** + * FIXME: The preupdate check is performed before the database migration, otherwise database changes + * are not possible anymore within it. - Consider this when touching the code. + * @link https://github.com/owncloud/core/issues/10980 + * @see \OC_App::updateApp + */ + if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/preupdate.php')) { + $this->includePreUpdate($appId); + } if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/database.xml')) { \OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId) . '/appinfo/database.xml'); } @@ -281,6 +289,14 @@ $this->emit('\OC\Updater', 'appUpgradeCheck'); } + /** + * Includes the pre-update file. Done here to prevent namespace mixups. + * @param string $appId + */ + private function includePreUpdate($appId) { + include \OC_App::getAppPath($appId) . '/appinfo/preupdate.php'; + } + protected function doAppUpgrade() { $apps = \OC_App::getEnabledApps(); diff -Nru owncloud-7.0.3+dfsg/lib/private/user/user.php owncloud-7.0.4+dfsg/lib/private/user/user.php --- owncloud-7.0.3+dfsg/lib/private/user/user.php 2014-11-10 12:17:24.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/user/user.php 2014-12-08 14:34:15.000000000 -0400 @@ -115,7 +115,7 @@ */ public function setDisplayName($displayName) { $displayName = trim($displayName); - if ($this->canChangeDisplayName() && !empty($displayName)) { + if ($this->backend->implementsActions(\OC_USER_BACKEND_SET_DISPLAYNAME) && !empty($displayName)) { $this->displayName = $displayName; $result = $this->backend->setDisplayName($this->uid, $displayName); return $result !== false; diff -Nru owncloud-7.0.3+dfsg/lib/private/util.php owncloud-7.0.4+dfsg/lib/private/util.php --- owncloud-7.0.3+dfsg/lib/private/util.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/private/util.php 2014-12-08 14:34:15.000000000 -0400 @@ -497,6 +497,13 @@ ); $webServerRestart = true; } + if(!class_exists('XMLWriter')) { + $errors[] = array( + 'error'=> $l->t('PHP module %s not installed.', array('XMLWriter')), + 'hint'=>$moduleHint + ); + $webServerRestart = true; + } if(!class_exists('DOMDocument')) { $errors[] = array( 'error'=> $l->t('PHP module %s not installed.', array('dom')), diff -Nru owncloud-7.0.3+dfsg/lib/public/security/icrypto.php owncloud-7.0.4+dfsg/lib/public/security/icrypto.php --- owncloud-7.0.3+dfsg/lib/public/security/icrypto.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/public/security/icrypto.php 2014-12-08 14:34:15.000000000 -0400 @@ -0,0 +1,46 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Security; + +/** + * Class Crypto provides a high-level encryption layer using AES-CBC. If no key has been provided + * it will use the secret defined in config.php as key. Additionally the message will be HMAC'd. + * + * Usage: + * $encryptWithDefaultPassword = \OC::$server->getCrypto()->encrypt('EncryptedText'); + * $encryptWithCustomPassword = \OC::$server->getCrypto()->encrypt('EncryptedText', 'password'); + * + * @package OCP\Security + */ +interface ICrypto { + + /** + * @param string $message The message to authenticate + * @param string $password Password to use (defaults to `secret` in config.php) + * @return string Calculated HMAC + */ + public function calculateHMAC($message, $password = ''); + + /** + * Encrypts a value and adds an HMAC (Encrypt-Then-MAC) + * @param string $plaintext + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken + * @return string Authenticated ciphertext + */ + public function encrypt($plaintext, $password = ''); + + /** + * Decrypts a value and verifies the HMAC (Encrypt-Then-Mac) + * @param string $authenticatedCiphertext + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken + * @return string plaintext + * @throws \Exception If the HMAC does not match + */ + public function decrypt($authenticatedCiphertext, $password = ''); +} \ Pas de fin de ligne à la fin du fichier diff -Nru owncloud-7.0.3+dfsg/lib/public/security/stringutils.php owncloud-7.0.4+dfsg/lib/public/security/stringutils.php --- owncloud-7.0.3+dfsg/lib/public/security/stringutils.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/public/security/stringutils.php 2014-12-08 14:34:15.000000000 -0400 @@ -0,0 +1,25 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + + +namespace OCP\Security; + +class StringUtils { + /** + * Compares whether two strings are equal. To prevent guessing of the string + * length this is done by comparing two hashes against each other and afterwards + * a comparison of the real string to prevent against the unlikely chance of + * collisions. + * @param string $expected The expected value + * @param string $input The input to compare against + * @return bool True if the two strings are equal, otherwise false. + */ + public static function equals($expected, $input) { + return \OC\Security\StringUtils::equals($expected, $input); + } +} \ Pas de fin de ligne à la fin du fichier diff -Nru owncloud-7.0.3+dfsg/lib/repair/repairconfig.php owncloud-7.0.4+dfsg/lib/repair/repairconfig.php --- owncloud-7.0.3+dfsg/lib/repair/repairconfig.php 1969-12-31 20:00:00.000000000 -0400 +++ owncloud-7.0.4+dfsg/lib/repair/repairconfig.php 2014-12-08 14:34:15.000000000 -0400 @@ -0,0 +1,65 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Repair; + +use OC\Hooks\BasicEmitter; +use OC\RepairStep; +use Sabre\DAV\Exception; + +/** + * Class RepairConfig + * + * @package OC\Repair + */ +class RepairConfig extends BasicEmitter implements RepairStep { + + /** + * @return string + */ + public function getName() { + return 'Repair config'; + } + + /** + * Updates the configuration after running an update + */ + public function run() { + $this->removePortsFromTrustedDomains(); + $this->addSecret(); + } + + /** + * Remove ports from existing trusted domains in config.php + */ + private function removePortsFromTrustedDomains() { + $trustedDomains = \OC::$server->getConfig()->getSystemValue('trusted_domains', array()); + $newTrustedDomains = array(); + foreach($trustedDomains as $domain) { + $pos = strrpos($domain, ':'); + if ($pos !== false) { + $port = substr($domain, $pos + 1); + if (is_numeric($port)) { + $domain = substr($domain, 0, $pos); + } + } + $newTrustedDomains[] = $domain; + } + \OC::$server->getConfig()->setSystemValue('trusted_domains', $newTrustedDomains); + } + + /** + * Adds a secret to config.php + */ + private function addSecret() { + if(\OC::$server->getConfig()->getSystemValue('secret', null) === null) { + $secret = \OC_Util::generateRandomBytes(96); + \OC::$server->getConfig()->setSystemValue('secret', $secret); + } + } +} diff -Nru owncloud-7.0.3+dfsg/settings/admin.php owncloud-7.0.4+dfsg/settings/admin.php --- owncloud-7.0.3+dfsg/settings/admin.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/settings/admin.php 2014-12-08 14:34:15.000000000 -0400 @@ -42,6 +42,7 @@ $tmpl->assign('entries', $entries); $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); +$tmpl->assign('readOnlyConfigEnabled', OC_Helper::isReadOnlyConfigEnabled()); $tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking()); $tmpl->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); @@ -56,6 +57,7 @@ $excludeGroups = OC_Appconfig::getValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false; $tmpl->assign('shareExcludeGroups', $excludeGroups); $excludedGroupsList = OC_Appconfig::getValue('core', 'shareapi_exclude_groups_list', ''); + $excludedGroupsList = explode(',', $excludedGroupsList); // FIXME: this should be JSON! $tmpl->assign('shareExcludedGroupsList', implode('|', $excludedGroupsList)); diff -Nru owncloud-7.0.3+dfsg/settings/js/apps.js owncloud-7.0.4+dfsg/settings/js/apps.js --- owncloud-7.0.3+dfsg/settings/js/apps.js 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/settings/js/apps.js 2014-12-08 14:34:15.000000000 -0400 @@ -235,7 +235,7 @@ element.val(t('settings','Uninstall')); } else { OC.Settings.Apps.removeNavigation(appid); - appitem.removeClass('active'); + $('#app-navigation ul li').filterAttr('data-id', appid).remove(); } },'json'); }, diff -Nru owncloud-7.0.3+dfsg/settings/templates/admin.php owncloud-7.0.4+dfsg/settings/templates/admin.php --- owncloud-7.0.3+dfsg/settings/templates/admin.php 2014-11-10 12:18:34.000000000 -0400 +++ owncloud-7.0.4+dfsg/settings/templates/admin.php 2014-12-08 14:34:15.000000000 -0400 @@ -62,14 +62,28 @@ // is htaccess working ? if (!$_['htaccessworking']) { ?> -<div class="section"> - <h2><?php p($l->t('Security Warning'));?></h2> + <div class="section"> + <h2><?php p($l->t('Security Warning')); ?></h2> <span class="securitywarning"> <?php p($l->t('Your data directory and your files are probably accessible from the internet. The .htaccess file is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.')); ?> </span> -</div> + </div> +<?php +} + +// is read only config enabled +if ($_['readOnlyConfigEnabled']) { +?> +<div class="section"> + <h2><?php p($l->t('Read-Only config enabled'));?></h2> + + <span class="securitywarning"> + <?php p($l->t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?> + </span> + + </div> <?php } diff -Nru owncloud-7.0.3+dfsg/version.php owncloud-7.0.4+dfsg/version.php --- owncloud-7.0.3+dfsg/version.php 2014-11-10 12:19:38.000000000 -0400 +++ owncloud-7.0.4+dfsg/version.php 2014-12-08 14:35:45.000000000 -0400 @@ -1,6 +1,6 @@ <?php -$OC_Version = array(7,0,3,4); -$OC_VersionString = '7.0.3'; +$OC_Version = array(7,0,4,2); +$OC_VersionString = '7.0.4'; $OC_Edition = ''; $OC_Channel = 'stable'; -$OC_Build = '2014-11-10T16:19:38+00:00'; +$OC_Build = '2014-12-08T18:35:45+00:00';
Attachment:
signature.asc
Description: OpenPGP digital signature