Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/univention-app.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-09-20 00:15:25 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-09-26 02:18:53 +0300
commit9ea0c82e46cf369274c32b0b5aa6e53193ad6377 (patch)
treeb35fe069d01032e663f63c1322c63838875d52f0
parente24a6d261f4a44c14579afac5980432b89cd3692 (diff)
prepare 12.0.3 release12.0.3
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--Dockerfile10
-rw-r--r--Makefile2
-rw-r--r--resources/6502.patch128
-rw-r--r--resources/nextcloud-12.0.3.tar.bz2 (renamed from resources/nextcloud-12.0.2.tar.bz2)bin42756355 -> 42935218 bytes
-rw-r--r--setup13
5 files changed, 150 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index eef25f4..e3f481c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,11 +21,13 @@
FROM ubuntu:16.04
-COPY resources/nextcloud-12.0.2.tar.bz2 /root/nextcloud.tar.bz2
+COPY resources/nextcloud-12.0.3.tar.bz2 /root/nextcloud.tar.bz2
+COPY resources/6502.patch /root/6502.patch
COPY resources/entrypoint.sh /usr/sbin/
COPY resources/60-nextcloud.ini /etc/php/7.0/apache2/conf.d/
COPY resources/60-nextcloud.ini /etc/php/7.0/cli/conf.d/
+ENV NC_IS_PATCHED true
RUN /bin/bash -c "export DEBIAN_FRONTEND=noninteractive" && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
@@ -34,6 +36,7 @@ RUN /bin/bash -c "export DEBIAN_FRONTEND=noninteractive" && \
cron \
curl \
libapache2-mod-php \
+ patch \
php \
php-curl \
php-dompdf \
@@ -66,6 +69,11 @@ RUN cd /root/ && \
chmod +x occ && \
chown -R www-data /var/www/html
+# uncomment and adjust following block if a patch needs to be applied
+RUN cd /var/www/html/ && \
+ patch -p1 -t < /root/6502.patch && \
+ rm /root/6502.patch
+
RUN sed -i '/DocumentRoot \/var\/www\/html/a \\tAlias \/nextcloud \/var\/www\/html' /etc/apache2/sites-enabled/000-default.conf
EXPOSE 80
diff --git a/Makefile b/Makefile
index a4657a8..e13b525 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
app_name=nextcloud
-app_version=12.0.2-1
+app_version=12.0.3-0
ucs_version=4.1
diff --git a/resources/6502.patch b/resources/6502.patch
new file mode 100644
index 0000000..fbaeb52
--- /dev/null
+++ b/resources/6502.patch
@@ -0,0 +1,128 @@
+From de8626694f0dffdc50f78bb9ae7aaf0168e8e43d Mon Sep 17 00:00:00 2001
+From: Arthur Schiwon <blizzz@arthur-schiwon.de>
+Date: Mon, 11 Sep 2017 12:10:32 +0200
+Subject: [PATCH 1/5] fix limit-flaw in search on paged results
+
+Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
+---
+ apps/user_ldap/lib/Access.php | 16 ++++++++--------
+ .../tests/Integration/Lib/IntegrationTestPaging.php | 13 +++++++++----
+ 2 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
+index 69e1f3c52f4..e036f6ccb8b 100644
+--- a/apps/user_ldap/lib/Access.php
++++ b/apps/user_ldap/lib/Access.php
+@@ -1149,9 +1149,9 @@ private function countEntriesInSearchResults($searchResults) {
+ * @return array with the search result
+ */
+ public function search($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) {
+- if($limit <= 0) {
+- //otherwise search will fail
+- $limit = null;
++ $limitPerPage = intval($this->connection->ldapPagingSize);
++ if(!is_null($limit) && $limit < $limitPerPage && $limit > 0) {
++ $limitPerPage = $limit;
+ }
+
+ /* ++ Fixing RHDS searches with pages with zero results ++
+@@ -1163,7 +1163,7 @@ public function search($filter, $base, $attr = null, $limit = null, $offset = nu
+ $findings = array();
+ $savedoffset = $offset;
+ do {
+- $search = $this->executeSearch($filter, $base, $attr, $limit, $offset);
++ $search = $this->executeSearch($filter, $base, $attr, $limitPerPage, $offset);
+ if($search === false) {
+ return array();
+ }
+@@ -1174,7 +1174,7 @@ public function search($filter, $base, $attr = null, $limit = null, $offset = nu
+ //i.e. result do not need to be fetched, we just need the cookie
+ //thus pass 1 or any other value as $iFoundItems because it is not
+ //used
+- $this->processPagedSearchStatus($sr, $filter, $base, 1, $limit,
++ $this->processPagedSearchStatus($sr, $filter, $base, 1, $limitPerPage,
+ $offset, $pagedSearchOK,
+ $skipHandling);
+ return array();
+@@ -1185,10 +1185,10 @@ public function search($filter, $base, $attr = null, $limit = null, $offset = nu
+ }
+
+ $continue = $this->processPagedSearchStatus($sr, $filter, $base, $findings['count'],
+- $limit, $offset, $pagedSearchOK,
++ $limitPerPage, $offset, $pagedSearchOK,
+ $skipHandling);
+- $offset += $limit;
+- } while ($continue && $pagedSearchOK && $findings['count'] < $limit);
++ $offset += $limitPerPage;
++ } while ($continue && $pagedSearchOK && ($limit === null || $findings['count'] < $limit));
+ // reseting offset
+ $offset = $savedoffset;
+
+From 30bf1c158d4b1ca3c2a03097bf1b109e23b5325a Mon Sep 17 00:00:00 2001
+From: Arthur Schiwon <blizzz@arthur-schiwon.de>
+Date: Mon, 11 Sep 2017 12:11:25 +0200
+Subject: [PATCH 2/5] replace hard-coded attribute with the corresponding
+ settings option
+
+Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
+---
+ apps/user_ldap/lib/Group_LDAP.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
+index 60ce664684a..3667a2d09f7 100644
+--- a/apps/user_ldap/lib/Group_LDAP.php
++++ b/apps/user_ldap/lib/Group_LDAP.php
+@@ -333,7 +333,7 @@ public function getGroupGidNumber($dn) {
+ public function getUserGidNumber($dn) {
+ $gidNumber = false;
+ if($this->access->connection->hasGidNumber) {
+- $gidNumber = $this->getEntryGidNumber($dn, 'gidNumber');
++ $gidNumber = $this->getEntryGidNumber($dn, $this->access->connection->ldapGidNumber);
+ if($gidNumber === false) {
+ $this->access->connection->hasGidNumber = false;
+ }
+
+From 9fb8f1fcd323fe90d7c6008be93b7ead7d8181b5 Mon Sep 17 00:00:00 2001
+From: Arthur Schiwon <blizzz@arthur-schiwon.de>
+Date: Mon, 11 Sep 2017 15:30:44 +0200
+Subject: [PATCH 4/5] fix counting found results in search op
+
+Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
+---
+ apps/user_ldap/lib/Access.php | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
+index e036f6ccb8b..b6674cf0332 100644
+--- a/apps/user_ldap/lib/Access.php
++++ b/apps/user_ldap/lib/Access.php
+@@ -1030,7 +1030,7 @@ private function executeSearch($filter, $base, &$attr = null, $limit = null, $of
+ * @param array $sr the array containing the LDAP search resources
+ * @param string $filter the LDAP filter for the search
+ * @param array $base an array containing the LDAP subtree(s) that shall be searched
+- * @param int $iFoundItems number of results in the search operation
++ * @param int $iFoundItems number of results in the single search operation
+ * @param int $limit maximum results to be counted
+ * @param int $offset a starting point
+ * @param bool $pagedSearchOK whether a paged search has been executed
+@@ -1180,15 +1180,18 @@ public function search($filter, $base, $attr = null, $limit = null, $offset = nu
+ return array();
+ }
+
++ $iFoundItems = 0;
+ foreach($sr as $res) {
+ $findings = array_merge($findings, $this->invokeLDAPMethod('getEntries', $cr, $res));
++ $iFoundItems = max($iFoundItems, $findings['count']);
++ unset($findings['count']);
+ }
+
+- $continue = $this->processPagedSearchStatus($sr, $filter, $base, $findings['count'],
++ $continue = $this->processPagedSearchStatus($sr, $filter, $base, $iFoundItems,
+ $limitPerPage, $offset, $pagedSearchOK,
+ $skipHandling);
+ $offset += $limitPerPage;
+- } while ($continue && $pagedSearchOK && ($limit === null || $findings['count'] < $limit));
++ } while ($continue && $pagedSearchOK && ($limit === null || count($findings) < $limit));
+ // reseting offset
+ $offset = $savedoffset;
diff --git a/resources/nextcloud-12.0.2.tar.bz2 b/resources/nextcloud-12.0.3.tar.bz2
index c2e7ddb..9a9fec2 100644
--- a/resources/nextcloud-12.0.2.tar.bz2
+++ b/resources/nextcloud-12.0.3.tar.bz2
Binary files differ
diff --git a/setup b/setup
index 5032ecf..796fa2d 100644
--- a/setup
+++ b/setup
@@ -87,7 +87,7 @@ if [ "$NC_IS_UPGRADE" -eq 0 ] ; then
$OCC app:enable user_ldap
$OCC app:disable updatenotification
- if [ $NC_APPLIANCE = true ]; then
+ if [ "$NC_APPLIANCE" = true ]; then
# Heads up: in Nc 13 we will have occ app:install <appid>
EXTRA_APP_URLS=(\
https://download.nextcloud.com/server/apps/zenodo-0.9.3.tar.gz \
@@ -146,4 +146,15 @@ for HOST_IP in "${NC_HOST_IPS[@]}" ; do
NC_TRUSTED_DOMAIN_NO=$(($NC_TRUSTED_DOMAIN_NO+1))
done
+# env var is set from the dockerfile
+if [ "$NC_IS_PATCHED" = true ]; then
+ $OCC config:system:set integrity.check.disabled --value="true" --type=boolean
+ # (un)comment and adjust following line depending on the use case,
+ # otherwise a warning is shown, still
+ $OCC integrity:check-app user_ldap
+
+ # integrity checks are done once on upgrade case, thus we can directly remove the flag again
+ $OCC config:system:delete integrity.check.disabled
+fi
+
echo "*/15 * * * * www-data php -f /var/www/html/cron.php" > /etc/cron.d/nextcloud