Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

TL;DR: upcoming upstream point release update with security related
fixes.

Hi,

Please consider unblocking the upcoming package owncloud

The 7.0.4 upstream point release is expected next week, and it adds a
new OC\Security\Crypto class that should be useful for the next security
fixes (and maybe some security fixes, information will be updated with
the actual release; I can follow up to a private e-mail address for the
release team if you want to discuss not yet disclosed security matters).

Among the other fixes, it removes an annoying behaviour, causing the
config file (in /etc) to be touched on CardDAV connexion, changing its
timestamp for no good reason, and making program looking at changes in
the /etc directory (e.g., metche) to spam the administrator.

In case you’d refuse the whole upcoming new release, I’d like you to
consider allowing at least this targeted fix (see the minimal changes in
lib/private/config.php from the attached diff). Please let me know and
I’ll upload owncloud/7.0.3+dfsg-2 ASAP and update this request (or open
a new one if you may still consider 7.0.4+dfsg-1 later).

The attached filtered debdiff is not too big considering the five new
files (see binary debdiff in P.-S.) are providing 308 insertions there:

 50 files changed, 801 insertions(+), 143 deletions(-)

It has been filtered with the following command (7.0.4~rc1 is the
version that has been uploaded to experimental yesterday, and 7.0.4
should not add too much change to it):

debdiff --ignore-space ../owncloud_7.0.{3,4~rc1}+dfsg-1.dsc | \
        filterdiff -x '*/core/doc/*' -x'*/apps/*/tests/*'

- the documentation ('*/core/doc/*') change is irrelevant, since it’s
  provided by owncloud-doc anyway (bug report will follow if you accept
  this pre-approval);
- the tests are not shipped (nor used at build time yet since they rely
  on an installed ownCloud instance)

The Debian changelog follows, it merely document actual upstream
changes, the (WIP) upstream changelog is currently:

- 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 
- Several smaller fixes

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 <taf...@debian.org>  Mon, 01 Dec 2014 19:10:39 -0400

unblock owncloud/7.0.4+dfsg-1

Thanks a lot in advance for considering.

Regards

David

P.-S.: $ debdiff ../owncloud_7.0.{3,4~rc1}+dfsg-1_amd64.changes
[The following lists of changes regard files as different if they have
different names, permissions or owners.]

Files in second .changes but not in first
-----------------------------------------
-rw-r--r--  root/root   /usr/share/owncloud/lib/private/security/crypto.php
-rw-r--r--  root/root   /usr/share/owncloud/lib/private/security/stringutils.php
-rw-r--r--  root/root   /usr/share/owncloud/lib/public/security/icrypto.php
-rw-r--r--  root/root   /usr/share/owncloud/lib/public/security/stringutils.php
-rw-r--r--  root/root   /usr/share/owncloud/lib/repair/repairconfig.php

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-26674-] {+26700+}
Version: [-7.0.3+dfsg-1-] {+7.0.4~rc1+dfsg-1+}

diff -Nru -w owncloud-7.0.3+dfsg/apps/calendar/js/calendar.js owncloud-7.0.4~rc1+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~rc1+dfsg/apps/calendar/js/calendar.js	2014-12-01 16:31:57.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 -w owncloud-7.0.3+dfsg/apps/documents/js/viewer/viewer.js owncloud-7.0.4~rc1+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~rc1+dfsg/apps/documents/js/viewer/viewer.js	2014-12-01 16:31:58.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 -w owncloud-7.0.3+dfsg/apps/documents/lib/db/session.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/documents/lib/db/session.php	2014-12-01 16:31:58.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 -w owncloud-7.0.3+dfsg/apps/files/appinfo/remote.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files/appinfo/remote.php	2014-12-01 16:30:38.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 -w owncloud-7.0.3+dfsg/apps/files/tests/ajax_rename.php owncloud-7.0.4~rc1+dfsg/apps/files/tests/ajax_rename.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_encryption/ajax/updatePrivateKeyPassword.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_encryption/lib/stream.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_encryption/lib/stream.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_encryption/lib/util.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_encryption/lib/util.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/crypt.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/crypt.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/helper.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/helper.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/hooks.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/hooks.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/keymanager.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/keymanager.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/proxy.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/proxy.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/share.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/share.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/stream.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/stream.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/testcase.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/testcase.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/trashbin.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/trashbin.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/util.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/util.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_encryption/tests/webdav.php owncloud-7.0.4~rc1+dfsg/apps/files_encryption/tests/webdav.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/files_external/lib/config.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_external/lib/config.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_external/lib/smb_oc.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_external/lib/smb_oc.php	2014-12-01 16:31:56.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 @@
 		}
 	}
 
+	/**
+	 * 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 ) {
-		\OC::$session->set('smb-credentials', $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 -w owncloud-7.0.3+dfsg/apps/files_sharing/public.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_sharing/public.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_sharing/templates/public.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/files_sharing/templates/public.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/apps/files_sharing/tests/cache.php owncloud-7.0.4~rc1+dfsg/apps/files_sharing/tests/cache.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/updater/templates/update.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/updater/templates/update.php	2014-12-01 16:31:45.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 -w owncloud-7.0.3+dfsg/apps/user_ldap/lib/access.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/user_ldap/lib/access.php	2014-12-01 16:31:56.000000000 -0400
@@ -928,7 +928,7 @@
 		foreach($searchResults as $res) {
 			$count = intval($this->ldap->countEntries($cr, $res));
 			$counter += $count;
-			if($count === $limit) {
+			if($count > 0 && $count === $limit) {
 				$hasHitLimit = true;
 			}
 		}
@@ -1316,32 +1316,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]);
+		// 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]);
-			$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]);
+
+		$subIdStart = 8; // 1 + 1 + 6
+		$subIdLength = 4;
+		if (strlen($sid) !== $subIdStart + $subIdLength * $numberSubID) {
+			// Incorrect number of bytes present.
+			return '';
+		}
+
+		// 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, 8+4*$i, 4));
-				$subIDs[] = $subID[1];
-			}
-		} catch (\Exception $e) {
-			return '';
+			$subID = unpack('V', substr($sid, $subIdStart + $subIdLength * $i, $subIdLength));
+			$subIDs[] = sprintf('%u', $subID[1]);
 		}
 
-		return sprintf('S-%d-%d-%s', $srl, $iav, implode('-', $subIDs));
+		// Result for example above: S-1-5-21-249921958-728525901-1594176202
+		return sprintf('S-%d-%s-%s', $revision, $iav, implode('-', $subIDs));
 	}
 
 	/**
diff -Nru -w owncloud-7.0.3+dfsg/apps/user_ldap/tests/access.php owncloud-7.0.4~rc1+dfsg/apps/user_ldap/tests/access.php
Les fichiers binaires /tmp/pzhceYwQdy/owncloud-7.0.3+dfsg/apps/user_ldap/tests/data/sid.dat et /tmp/LlVMYxLPrC/owncloud-7.0.4~rc1+dfsg/apps/user_ldap/tests/data/sid.dat sont différents
diff -Nru -w owncloud-7.0.3+dfsg/apps/user_ldap/tests/user_ldap.php owncloud-7.0.4~rc1+dfsg/apps/user_ldap/tests/user_ldap.php
diff -Nru -w owncloud-7.0.3+dfsg/apps/user_ldap/user_ldap.php owncloud-7.0.4~rc1+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~rc1+dfsg/apps/user_ldap/user_ldap.php	2014-12-01 16:31:56.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)) {
diff -Nru -w owncloud-7.0.3+dfsg/config/config.sample.php owncloud-7.0.4~rc1+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~rc1+dfsg/config/config.sample.php	2014-12-01 16:31:56.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',
 
@@ -521,6 +522,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,
 
@@ -806,7 +808,8 @@
 ),
 
 /**
- * Database types that are supported for installation.
+ * Database types that are supported for installation. (SQLite is available only in 
+ * ownCloud Community Edition, oci and mssql only for the Enterprise Edition)
  *
  * Available:
  * 	- sqlite (SQLite3)
@@ -831,4 +834,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 -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/antivirus_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/antivirus_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/auth_ldap.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/auth_ldap.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/automatic_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/automatic_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/background_jobs_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/background_jobs_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/background_jobs.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/background_jobs.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/big_file_upload_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/big_file_upload_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/collaborative_documents_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/collaborative_documents_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/config_sample_php_parameters.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/config_sample_php_parameters.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_3rdparty.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_3rdparty.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration-antivirus.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration-antivirus.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_apps.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_apps.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_assets.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_assets.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_automation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_automation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_config_sample_php.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_config_sample_php.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_custom_clients.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_custom_clients.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_database.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_database.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_encryption.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_encryption.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_file_sharing.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_file_sharing.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_files_locking.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_files_locking.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_knowledgebase.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_knowledgebase.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_language.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_language.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_logging.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_logging.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_mail.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_mail.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_preview.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_preview.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_reverseproxy.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_reverseproxy.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuration_users.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuration_users.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_big_file_upload.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuring_big_file_upload.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_documents.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuring_documents.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/configuring_search.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/configuring_search.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_client_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/custom_client_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_mount_config_gui.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/custom_mount_config_gui.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_mount_config.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/custom_mount_config.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/custom_user_backend.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/custom_user_backend.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/database_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/database_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/email_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/email_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/encryption_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/encryption_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/external_storage_configuration_gui.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/external_storage_configuration_gui.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/external_storage_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/external_storage_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/file_sharing_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/file_sharing_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/files_locking_enabling.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/files_locking_enabling.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/index.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/index.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/js_css_asset_management_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/js_css_asset_management_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/knowledgebase_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/knowledgebase_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/language_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/language_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/logging_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/logging_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/previews_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/previews_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/reverse_proxy_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/reverse_proxy_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/search_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/search_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/server_to_server_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/server_to_server_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/server_to_server_managing.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/server_to_server_managing.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/serving_static_files_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/serving_static_files_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/thirdparty_php_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/thirdparty_php_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_auth_ftp_smb_imap.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/user_auth_ftp_smb_imap.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_auth_ldap.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/user_auth_ldap.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/user_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/user_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/configuration/xsendfile.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/configuration/xsendfile.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/contents.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/contents.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/index.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/index.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/appliance_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/appliance_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/apps_management_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/apps_management_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_hiawatha.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/configuration_hiawatha.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_lighttpd.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/configuration_lighttpd.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_nginx.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/configuration_nginx.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/configuration_yaws.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/configuration_yaws.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/hiawatha_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/hiawatha_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/index.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/index.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_appliance.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_appliance.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_linux.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_linux.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_macos.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_macos.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_others.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_others.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_source.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_source.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_ucs.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_ucs.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_windows.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_windows.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/installation_wizard.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/installation_wizard.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/lighttpd_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/lighttpd_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/linux_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/linux_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/macos_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/macos_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/nginx_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/nginx_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/others_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/others_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/source_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/source_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/ucs_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/ucs_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/windows_installation.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/windows_installation.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/installation/yaws_configuration.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/installation/yaws_configuration.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/maintenance/convert_db.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/maintenance/convert_db.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/maintenance/index.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/maintenance/index.html
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/maintenance/upgrade.html owncloud-7.0.4~rc1+dfsg/core/doc/admin/maintenance/upgrade.html
Les fichiers binaires /tmp/pzhceYwQdy/owncloud-7.0.3+dfsg/core/doc/admin/objects.inv et /tmp/LlVMYxLPrC/owncloud-7.0.4~rc1+dfsg/core/doc/admin/objects.inv sont différents
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/antivirus_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/antivirus_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/auth_ldap.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/auth_ldap.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/automatic_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/automatic_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/background_jobs_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/background_jobs_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/background_jobs.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/background_jobs.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/big_file_upload_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/big_file_upload_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/collaborative_documents_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/collaborative_documents_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/config_sample_php_parameters.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/config_sample_php_parameters.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_3rdparty.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_3rdparty.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration-antivirus.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration-antivirus.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_apps.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_apps.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_assets.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_assets.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_automation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_automation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_custom_clients.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_custom_clients.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_database.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_database.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_encryption.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_encryption.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_file_sharing.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_file_sharing.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_files_locking.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_files_locking.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_language.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_language.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_logging.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_logging.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_mail.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_mail.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_preview.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_preview.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuration_users.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuration_users.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_documents.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuring_documents.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/configuring_search.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/configuring_search.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_client_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/custom_client_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_mount_config.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/custom_mount_config.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/custom_user_backend.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/custom_user_backend.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/database_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/database_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/email_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/email_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/encryption_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/encryption_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration_gui.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration_gui.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/external_storage_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/file_sharing_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/file_sharing_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/files_locking_enabling.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/files_locking_enabling.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/index.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/index.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/js_css_asset_management_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/js_css_asset_management_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/knowledgebase_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/knowledgebase_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/language_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/language_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/logging_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/logging_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/previews_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/previews_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/reverse_proxy_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/reverse_proxy_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/search_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/search_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/server_to_server_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/server_to_server_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/server_to_server_managing.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/server_to_server_managing.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/serving_static_files_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/serving_static_files_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/thirdparty_php_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/thirdparty_php_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_auth_ftp_smb_imap.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/user_auth_ftp_smb_imap.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_auth_ldap.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/user_auth_ldap.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/user_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/user_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/configuration/xsendfile.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/configuration/xsendfile.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/contents.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/contents.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/index.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/index.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/appliance_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/appliance_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/apps_management_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/apps_management_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_hiawatha.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/configuration_hiawatha.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_lighttpd.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/configuration_lighttpd.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_nginx.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/configuration_nginx.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/configuration_yaws.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/configuration_yaws.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/hiawatha_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/hiawatha_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/index.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/index.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_appliance.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_appliance.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_linux.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_linux.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_macos.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_macos.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_others.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_others.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_source.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_source.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_ucs.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_ucs.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_windows.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_windows.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/installation_wizard.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/installation_wizard.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/lighttpd_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/lighttpd_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/linux_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/linux_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/macos_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/macos_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/nginx_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/nginx_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/others_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/others_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/source_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/source_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/ucs_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/ucs_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/windows_installation.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/windows_installation.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/installation/yaws_configuration.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/installation/yaws_configuration.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/issues/index.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/issues/index.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/maintenance/convert_db.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/maintenance/convert_db.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/doc/admin/_sources/maintenance/upgrade.txt owncloud-7.0.4~rc1+dfsg/core/doc/admin/_sources/maintenance/upgrade.txt
diff -Nru -w owncloud-7.0.3+dfsg/core/js/lostpassword.js owncloud-7.0.4~rc1+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~rc1+dfsg/core/js/lostpassword.js	2014-12-01 16:31:56.000000000 -0400
@@ -115,7 +115,11 @@
 	},
 
 	redirect : function(msg){
+		if(OC.webroot !== '') {
 		window.location = OC.webroot;
+		} else {
+			window.location = '/';
+		}
 	},
 
 	resetError : function(msg){
diff -Nru -w owncloud-7.0.3+dfsg/core/js/share.js owncloud-7.0.4~rc1+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~rc1+dfsg/core/js/share.js	2014-12-01 16:31:56.000000000 -0400
@@ -444,7 +444,7 @@
 					}
 				});
 			}
-			$('#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) {
diff -Nru -w owncloud-7.0.3+dfsg/debian/changelog owncloud-7.0.4~rc1+dfsg/debian/changelog
--- owncloud-7.0.3+dfsg/debian/changelog	2014-11-13 13:50:08.000000000 -0400
+++ owncloud-7.0.4~rc1+dfsg/debian/changelog	2014-12-01 19:11:46.000000000 -0400
@@ -1,3 +1,58 @@
+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 <taf...@debian.org>  Mon, 01 Dec 2014 19:10:39 -0400
+
 owncloud (7.0.3+dfsg-1) unstable; urgency=medium
 
   [ David Prévot ]
diff -Nru -w owncloud-7.0.3+dfsg/debian/patches/0001-Disable-the-appstore.patch owncloud-7.0.4~rc1+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~rc1+dfsg/debian/patches/0001-Disable-the-appstore.patch	2014-12-01 18:15:22.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 c073d94..f237f9f 100644
 --- a/config/config.sample.php
 +++ b/config/config.sample.php
-@@ -521,8 +521,9 @@ $CONFIG = array(
- 
+@@ -523,8 +523,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(
+@@ -538,12 +539,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 27b1233..78f4968 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 a18c72d..e95c613 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 -w owncloud-7.0.3+dfsg/debian/patches/0002-Fix-displayed-version.patch owncloud-7.0.4~rc1+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~rc1+dfsg/debian/patches/0002-Fix-displayed-version.patch	2014-12-01 18:15:23.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 f237f9f..d07aef1 100644
 --- a/config/config.sample.php
 +++ b/config/config.sample.php
-@@ -406,7 +406,7 @@ $CONFIG = array(
+@@ -407,7 +407,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 -w owncloud-7.0.3+dfsg/debian/patches/0003-Improve-logfile-handling.patch owncloud-7.0.4~rc1+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~rc1+dfsg/debian/patches/0003-Improve-logfile-handling.patch	2014-12-01 18:15:25.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 d07aef1..f90313d 100644
 --- a/config/config.sample.php
 +++ b/config/config.sample.php
-@@ -442,8 +442,9 @@ $CONFIG = array(
+@@ -443,8 +443,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 78f4968..8e9686b 100644
 --- a/lib/base.php
 +++ b/lib/base.php
-@@ -615,7 +615,7 @@ class OC {
+@@ -609,7 +609,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 -w owncloud-7.0.3+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch owncloud-7.0.4~rc1+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~rc1+dfsg/debian/patches/path/0005-Adapt-Doctrine-Symphony-Patchwork-and-Pimple-path.patch	2014-12-01 18:15:26.000000000 -0400
@@ -14,7 +14,7 @@
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/lib/base.php b/lib/base.php
-index 25992b2..93eb6a6 100644
+index 8e9686b..c1217d5 100644
 --- a/lib/base.php
 +++ b/lib/base.php
 @@ -431,12 +431,12 @@ class OC {
diff -Nru -w owncloud-7.0.3+dfsg/debian/upstream/changelog owncloud-7.0.4~rc1+dfsg/debian/upstream/changelog
--- owncloud-7.0.3+dfsg/debian/upstream/changelog	2014-11-13 13:49:45.000000000 -0400
+++ owncloud-7.0.4~rc1+dfsg/debian/upstream/changelog	2014-12-01 19:10:04.000000000 -0400
@@ -1,3 +1,17 @@
+Version 7.0.4 December 8th 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 
+    Several smaller fixes
+
 Version 7.0.3 November 13th 2014
 
     Some OS X server fixes
diff -Nru -w owncloud-7.0.3+dfsg/lib/base.php owncloud-7.0.4~rc1+dfsg/lib/base.php
--- owncloud-7.0.3+dfsg/lib/base.php	2014-11-10 12:18:34.000000000 -0400
+++ owncloud-7.0.4~rc1+dfsg/lib/base.php	2014-12-01 16:31:56.000000000 -0400
@@ -573,14 +573,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 -w owncloud-7.0.3+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/appframework/middleware/security/securitymiddleware.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/app.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/app.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/config.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/config.php	2014-12-01 16:30:38.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 -w owncloud-7.0.3+dfsg/lib/private/files/filesystem.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/files/filesystem.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/files/mapper.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/files/mapper.php	2014-12-01 16:30:38.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
@@ -183,8 +199,6 @@
 		$pathElements = explode('/', $path);
 		$sluggedElements = array();
 		
-		$last= end($pathElements);
-		
 		foreach ($pathElements as $pathElement) {
 			// remove empty elements
 			if (empty($pathElement)) {
@@ -205,11 +219,10 @@
 				// if filename doesn't contain periods add index ofter the last char
 				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 -w owncloud-7.0.3+dfsg/lib/private/files/storage/dav.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/files/storage/dav.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/files/storage/mappedlocal.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/files/storage/mappedlocal.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/group/database.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/group/database.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/largefilehelper.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/largefilehelper.php	2014-12-01 16:30:39.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 -w owncloud-7.0.3+dfsg/lib/private/preview.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/preview.php	2014-12-01 16:31:56.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 . '/';
+		$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);
-			return $this->userView->rmdir($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 -w owncloud-7.0.3+dfsg/lib/private/repair.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/repair.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/request.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/request.php	2014-12-01 16:31:56.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
@@ -36,13 +36,26 @@
 	 * have been configured
 	 */
 	public static function isTrustedDomain($domain) {
-		$trustedList = \OC_Config::getValue('trusted_domains', array());
+		// Extract port from domain if needed
+		$pos = strrpos($domain, ':');
+		if ($pos !== false) {
+			$port = substr($domain, $pos + 1);
+			if (is_numeric($port)) {
+				$domain = substr($domain, 0, $pos);
+			}
+		}
+
+		// 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;
 		}
+
+		// Always allow access from localhost
 		if (preg_match(self::REGEX_LOCALHOST, $domain) === 1) {
 			return true;
 		}
+
 		return in_array($domain, $trustedList);
 	}
 
diff -Nru -w owncloud-7.0.3+dfsg/lib/private/security/crypto.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/security/crypto.php	2014-12-01 16:31:56.000000000 -0400
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Copyright (c) 2014 Lukas Reschke <lu...@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 -w owncloud-7.0.3+dfsg/lib/private/security/stringutils.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/security/stringutils.php	2014-12-01 16:31:56.000000000 -0400
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Copyright (c) 2014 Lukas Reschke <lu...@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 -w owncloud-7.0.3+dfsg/lib/private/server.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/server.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/setup.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/setup.php	2014-12-01 16:31:56.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.');
 		}
@@ -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 -w owncloud-7.0.3+dfsg/lib/private/share/helper.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/share/helper.php	2014-12-01 16:30:39.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 -w owncloud-7.0.3+dfsg/lib/private/share/share.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/share/share.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/updater.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/updater.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/user/user.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/user/user.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/private/util.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/private/util.php	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/lib/public/security/icrypto.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/public/security/icrypto.php	2014-12-01 16:31:56.000000000 -0400
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Copyright (c) 2014 Lukas Reschke <lu...@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 -w owncloud-7.0.3+dfsg/lib/public/security/stringutils.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/public/security/stringutils.php	2014-12-01 16:31:56.000000000 -0400
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Copyright (c) 2014 Lukas Reschke <lu...@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 -w owncloud-7.0.3+dfsg/lib/repair/repairconfig.php owncloud-7.0.4~rc1+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~rc1+dfsg/lib/repair/repairconfig.php	2014-12-01 16:31:56.000000000 -0400
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright (c) 2014 Lukas Reschke <lu...@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 -w owncloud-7.0.3+dfsg/settings/js/apps.js owncloud-7.0.4~rc1+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~rc1+dfsg/settings/js/apps.js	2014-12-01 16:31:56.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 -w owncloud-7.0.3+dfsg/version.php owncloud-7.0.4~rc1+dfsg/version.php
--- owncloud-7.0.3+dfsg/version.php	2014-11-10 12:19:38.000000000 -0400
+++ owncloud-7.0.4~rc1+dfsg/version.php	2014-12-01 16:33:08.000000000 -0400
@@ -2,5 +2,5 @@
 $OC_Version = array(7,0,3,4);
 $OC_VersionString = '7.0.3';
 $OC_Edition = '';
-$OC_Channel = 'stable';
-$OC_Build = '2014-11-10T16:19:38+00:00';
+$OC_Channel = 'testing';
+$OC_Build = '2014-12-01T20:33:08+00:00';

Attachment: signature.asc
Description: Digital signature

Reply via email to