[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#796823: jessie-pu: package gosa/2.7.4+reloaded2-1+deb8u2



Control: tag +1 moreinfo
thanks

On Sat, Feb 20, 2016 at 12:36:52PM +0000, Julien Cristau wrote:
> Control: tag -1 moreinfo
> 
> On Mon, Aug 24, 2015 at 21:46:04 +0200, Mike Gabriel wrote:
> 
> > diff -Nru gosa-2.7.4+reloaded2/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch gosa-2.7.4+reloaded2/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch
> > --- gosa-2.7.4+reloaded2/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch	1970-01-01 01:00:00.000000000 +0100
> > +++ gosa-2.7.4+reloaded2/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch	2015-08-24 21:24:28.000000000 +0200
> > @@ -0,0 +1,30 @@
> > +Description: Fix entry removal in mail plugin
> > +Author: eannj <greg@brazcubas.br>
> > +Abstract:
> > + Without this patch, it is not possible to remove entries from
> > + "Alternative addresses" or from "Forward messages to non group members"
> > + list in "mail" tab of group objects. One selects an address and press
> > + "delete" but nothing happens, the page is refreshed but address entry
> > + remains. The same operation succeeds for users. It fails only for group
> > + objects. The attached patch fixes the issue.
> > +
> > +--- a/mail/admin/groups/mail/class_groupMail.inc
> > ++++ b/mail/admin/groups/mail/class_groupMail.inc
> > +@@ -394,7 +394,7 @@
> > +             }
> > +         }
> > +         if (isset($_POST['delete_forwarder'])){
> > +-            $this->delForwarder (get_post('forwarder_list'));
> > ++            $this->delForwarder ($_POST('forwarder_list'));
> > +         }
> > + 
> > + 
> > +@@ -432,7 +432,7 @@
> > +             }
> > +         }
> > +         if (isset($_POST['delete_alternate']) && isset($_POST['alternates_list'])){
> > +-            $this->delAlternate (get_post('alternates_list'));
> > ++            $this->delAlternate ($_POST('alternates_list'));
> > +         }
> > + 
> > + 
> 
> Shouldn't this be $_POST['alternates_list'] (and similar above)?
> Thankfully I'm not a php person, so please forgive the possibly stupid
> question.

thankfully i'm neither a php person but i have to admit^w^w^wam glad to
know some… ;)

So yeah, the above are probably syntax errors (or undefined) as it calls
a function where an array lookup is required.

There's also another error in the first statement, which is missing an
&& if (isset($_POST['delete_forwarder']))
statement.

Fixed this patch becomes:

--- a/mail/admin/groups/mail/class_groupMail.inc
+++ b/mail/admin/groups/mail/class_groupMail.inc
@@ -393,8 +393,8 @@
                 }
             }
         }
-        if (isset($_POST['delete_forwarder'])){
-            $this->delForwarder (get_post('forwarder_list'));
+        if (isset($_POST['delete_forwarder']) &&
isset($_POST['forwarder_list'])){
+            $this->delForwarder ($_POST['forwarder_list']);
         }
 
 
@@ -432,7 +432,7 @@
             }
         }
         if (isset($_POST['delete_alternate']) &&
isset($_POST['alternates_list'])){
-            $this->delAlternate (get_post('alternates_list'));
+            $this->delAlternate ($_POST['alternates_list']);
         }


I've committed this fix in the gosa debian/jessie/updates and master
branch already and will attach the full corrected debdiff for
gosa/2.7.4+reloaded2-1+deb8u2 to this mail.

$ git diff debian/2.7.4+reloaded2-1+deb8u1..debian/jessie/updates > gosa_2.7.4+reloaded2-1+deb8u2.diff
$ diffstat gosa_2.7.4+reloaded2-1+deb8u2.diff
 changelog                                                       |   30 ++++
 patches/0004_fix-get-post.patch                                 |   14 ++
 patches/0005_fix-password-expiry-status.patch                   |   14 ++
 patches/1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch |   62 ++++++++++
 patches/1010_fix-entry-removal-in-mail-plugin.patch             |   32 +++++
 patches/1011_define-isPluginModified.patch                      |   13 ++
 patches/1012_allow-one-level-domains-in-email-addresses.patch   |   22 +++
 patches/2009_allow-Debian-blends-to-override-gosa-conf.patch    |   27 ++++
 patches/series                                                  |    7 +
 9 files changed, 221 insertions(+)


-- 
cheers,
	Holger
diff --git a/debian/changelog b/debian/changelog
index 23f59a9..6ec14e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,33 @@
+gosa (2.7.4+reloaded2-1+deb8u2) jessie-proposed-updates; urgency=medium
+
+  [ Mike Gabriel ]
+  * debian/patches:
+    + Add 1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch. Fix
+      label stripping in GOsa²'s image() function. This fixes displaying the
+      insertDhcp* icon in the DHCP service plugin. (Closes: #794117).
+    + Add 2009_allow-Debian-blends-to-override-gosa-conf.patch. Allow
+      Debian blends to provide their own version of gosa.conf and not get
+      bugged by GOsa's notification message on gosa.conf template changes.
+      Debian blends using GOsa (e.g., Edu, LAN) must handle gosa.conf
+      updates themselves. (Closes: #794118).
+    + Add 0004_fix-get-post.patch. Fix transferral of POST variables.
+    + Add 1010_fix-entry-removal-in-mail-plugin.patch. Fix entry deletion
+      of items in "alternatives addresses" and "forward messages to
+      non-group members" for group mail objects. (LP:#1307483).
+    + Add 0005_fix-password-expiry-status.patch. Fix expiration status
+      for passwords if shadowMax is used in POSIX/shadow accounts.
+    + Add 1011_define-isPluginModified.patch. Fix undefined property
+      error for non-defined usertags::$isPluginModified. (Closes: #794690).
+    + Add 1012_allow-one-level-domains-in-email-addresses.patch. Allow
+      one-level domains in email addresses (such as <uid>@intern, as used
+      in Debian Edu by default). (Closes: #794738).
+
+  [ Holger Levsen ]
+  * Fixup PHP syntax in 1010_fix-entry-removal-in-mail-plugin.patch. See
+    #796823 for the details.
+
+ -- Holger Levsen <holger@debian.org>  Fri, 20 May 2016 18:08:59 +0200
+
 gosa (2.7.4+reloaded2-1+deb8u1) jessie-proposed-updates; urgency=medium
 
   * debian/patches:
diff --git a/debian/patches/0004_fix-get-post.patch b/debian/patches/0004_fix-get-post.patch
new file mode 100644
index 0000000..b7d9a9a
--- /dev/null
+++ b/debian/patches/0004_fix-get-post.patch
@@ -0,0 +1,14 @@
+Description: Fix get_post for non-strings
+Origin: https://oss.gonicus.de/labs/gosa/changeset/21181/trunk
+
+--- a/gosa-core/include/functions.inc
++++ b/gosa-core/include/functions.inc
+@@ -2757,7 +2757,7 @@
+         } else {
+           $tmp = $_POST;
+         }
+-        return($tmp);
++        return($tmp[$name]);
+     }else{
+ 
+         if(version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc()){
diff --git a/debian/patches/0005_fix-password-expiry-status.patch b/debian/patches/0005_fix-password-expiry-status.patch
new file mode 100644
index 0000000..9f71f42
--- /dev/null
+++ b/debian/patches/0005_fix-password-expiry-status.patch
@@ -0,0 +1,14 @@
+Description: Fix expiration status when shadowMax is used
+Origin: https://oss.gonicus.de/labs/gosa/changeset/21241
+
+--- a/gosa-core/plugins/personal/posix/class_posixAccount.inc
++++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc
+@@ -155,7 +155,7 @@
+         }
+       } elseif (($this->shadowLastChange + $this->shadowMin) >= $current){
+         $this->status= _("active").", "._("password not changeable");
+-      } elseif (($this->shadowLastChange + $this->shadowMax) >= $current){
++      } elseif (($this->shadowLastChange + $this->shadowMax) <= $current){
+         $this->status= _("active").", "._("password expired");
+       } else {
+         $this->status= _("active");
diff --git a/debian/patches/1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch b/debian/patches/1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch
new file mode 100644
index 0000000..df00fc3
--- /dev/null
+++ b/debian/patches/1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch
@@ -0,0 +1,62 @@
+Description: Fix label extraction from image paths
+Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+Abstract:
+ The DHCP service plugin uses image() function calls like this kind:
+ .
+ $editImgIns = image('images/lists/element.png[new]', 'insertDhcp_%s', _("Insert new DHCP section"));
+ .
+ The "[new] part of the image file name is used for referencing the
+ style sheet of the image label.
+ .
+ The upstream version of the image function now does three things:
+ .
+   1. Check if the image itself has a style sheet (if not, bail out).
+      ^^^^ Here the function bails out, as it cannot find a style sheet
+           for "element.png[new]". The label needs to be substracted first.
+
+   2. Check if a label name has been appended to the image file name.
+   3. If (2), check if the label style sheet exists (if not, die).
+   4. If (3), then strip the "[<label>]" part from the file name.
+ .
+ We change this to:
+   1. Check if a label name has been appended to the image file name.
+      (if so, substract that label name from the path name of the image).
+   2. Check if the image itself has a style sheet (if not, bail out).
+   3. Check if the label style sheet exist (if not, die).
+
+--- a/gosa-core/include/functions.inc
++++ b/gosa-core/include/functions.inc
+@@ -3576,16 +3576,19 @@
+   }
+   $styles= session::global_get('img-styles');
+ 
++  /* Extract labels from path */
++  preg_match("/(.*\.png)\[(.*)\]$/", $path, $matches);
++
++  if (count($matches) == 3) {
++    $path = $matches[1];
++    $label= $matches[2];
++  }
++
+   /* If there's nothing available, just return nothing */
+   if (!array_key_exists($path, $styles)) {
+     return "";
+   }
+ 
+-  /* Extract labels from path */
+-  if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
+-    $label= $matches[1];
+-  }
+-
+   $lbl= "";
+   if ($label) {
+     if (isset($styles["images/label-".$label.".png"])) {
+@@ -3593,8 +3596,6 @@
+     } else {
+       die("Invalid label specified: $label\n");
+     }
+-
+-    $path= preg_replace("/\[.*\]$/", "", $path);
+   }
+ 
+   // Non middle layout?
diff --git a/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch b/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch
new file mode 100644
index 0000000..d3843c3
--- /dev/null
+++ b/debian/patches/1010_fix-entry-removal-in-mail-plugin.patch
@@ -0,0 +1,32 @@
+Description: Fix entry removal in mail plugin
+Author: eannj <greg@brazcubas.br>
+Abstract:
+ Without this patch, it is not possible to remove entries from
+ "Alternative addresses" or from "Forward messages to non group members"
+ list in "mail" tab of group objects. One selects an address and press
+ "delete" but nothing happens, the page is refreshed but address entry
+ remains. The same operation succeeds for users. It fails only for group
+ objects. The attached patch fixes the issue.
+
+--- a/mail/admin/groups/mail/class_groupMail.inc
++++ b/mail/admin/groups/mail/class_groupMail.inc
+@@ -393,8 +393,8 @@
+                 }
+             }
+         }
+-        if (isset($_POST['delete_forwarder'])){
+-            $this->delForwarder (get_post('forwarder_list'));
++        if (isset($_POST['delete_forwarder']) && isset($_POST['forwarder_list'])){
++            $this->delForwarder ($_POST['forwarder_list']);
+         }
+ 
+ 
+@@ -432,7 +432,7 @@
+             }
+         }
+         if (isset($_POST['delete_alternate']) && isset($_POST['alternates_list'])){
+-            $this->delAlternate (get_post('alternates_list'));
++            $this->delAlternate ($_POST['alternates_list']);
+         }
+ 
+ 
diff --git a/debian/patches/1011_define-isPluginModified.patch b/debian/patches/1011_define-isPluginModified.patch
new file mode 100644
index 0000000..07be6ba
--- /dev/null
+++ b/debian/patches/1011_define-isPluginModified.patch
@@ -0,0 +1,13 @@
+Description: Define undefined usertabs::$isPluginModified
+Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+
+--- a/gosa-core/include/class_tabs.inc
++++ b/gosa-core/include/class_tabs.inc
+@@ -36,6 +36,7 @@
+   var $SubDialog = false;
+   var $acl_category; 
+   var $multiple_support_active = FALSE;
++  var $isPluginModified = FALSE;
+ 
+   var $parent = null; // A parent object if available, e.g. a management class.
+ 
diff --git a/debian/patches/1012_allow-one-level-domains-in-email-addresses.patch b/debian/patches/1012_allow-one-level-domains-in-email-addresses.patch
new file mode 100644
index 0000000..cfa68e7
--- /dev/null
+++ b/debian/patches/1012_allow-one-level-domains-in-email-addresses.patch
@@ -0,0 +1,22 @@
+Description: Allow one-level domains in email addresses
+Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+Abstract:
+ Make it possible to use one-level domains in email address
+ (such as <uid>@intern) as commonly used in a Debian Edu
+ default installation.
+
+--- a/gosa-core/include/utils/class_tests.inc
++++ b/gosa-core/include/utils/class_tests.inc
+@@ -237,10 +237,10 @@
+       return (TRUE);
+     }
+     if ($template){
+-      return preg_match ("/^[._a-z0-9{\[\]}%\+-]+@[_a-{}\[\]%z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
++      return preg_match ("/^[^0-9][a-zA-Z0-9_{\[\]}%]+([.][a-zA-Z0-9_{\[\]}%]\+-]+)*[@][a-zA-Z0-9_-{\[\]}%]+([.][a-zA-Z0-9_-{\[\]}%]+)*$/",
+           $address);
+     } else {
+-      return preg_match ("/^[._a-z0-9\+-]+@[_a-z0-9-]+(\.[a-z0-9i-]+)(\.[a-z0-9-]+)*$/i",
++      return preg_match ("/^[^0-9][a-zA-Z0-9_\+-]+([.][a-zA-Z0-9_\+-]+)*[@][a-zA-Z0-9_-]+([.][a-zA-Z0-9_-]+)*$/",
+           $address);
+     }
+   }
diff --git a/debian/patches/2009_allow-Debian-blends-to-override-gosa-conf.patch b/debian/patches/2009_allow-Debian-blends-to-override-gosa-conf.patch
new file mode 100644
index 0000000..2e197e9
--- /dev/null
+++ b/debian/patches/2009_allow-Debian-blends-to-override-gosa-conf.patch
@@ -0,0 +1,27 @@
+Description: Debian Edu and Debian LAN take care of maintaining its own version of gosa.conf
+Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+
+--- a/gosa-core/include/class_config.inc
++++ b/gosa-core/include/class_config.inc
+@@ -1124,6 +1124,21 @@
+          */
+         session::global_set("LastChecked",$this->config_version);
+ 
++        /* Debian Edu and Debian LAN take care of maintaining its own
++           version of gosa.conf.
++
++           Do not compare our gosa.conf template with the actual config
++           version in /etc/gosa/gosa.conf to avoid the misleading message
++           dialog asking the GOsa admin to re-run the GOsa setup. With
++           Debian Edu and Debian LAN, re-running the GOsa setup will
++           break GOsa for those setups.
++        */
++
++        // The below regexp is the PHP way of a <string>.startsWith() function...
++        if (preg_match('~'.preg_quote("Managed-by-Debian",'~').'~A', $this->config_version) > 0) {
++            return;
++        }
++
+         $current = md5(file_get_contents(CONFIG_TEMPLATE_DIR."/gosa.conf"));
+ 
+         /* Check contributed config version and current config version.
diff --git a/debian/patches/series b/debian/patches/series
index fa9b4fc..d4e6e77 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,10 +1,16 @@
 0001_smarty3.patch
 0002_style-robustness.patch
 0003_xss-vulnerability-on-login-screen.patch
+0004_fix-get-post.patch
+0005_fix-password-expiry-status.patch
 1001_fix-mass-ldapimport.patch
 1002_trim-decrypt.patch
 1003_RequestHeader-no-underscores-apache24.patch
 1004_fix-typos-in-man-pages.patch
+1009_fix-insertDhcp-icon-in-dhcp-section-overview.patch
+1010_fix-entry-removal-in-mail-plugin.patch
+1011_define-isPluginModified.patch
+1012_allow-one-level-domains-in-email-addresses.patch
 2001_fix-smarty-location.patch
 2002_fix-template-location.patch
 2003_fix-class-mapping.patch
@@ -13,3 +19,4 @@
 2006_sasl-password-change.patch
 2007_gen-uids-like-gosa26.patch
 2008_enable-csv-import-on-clean-installs.patch
+2009_allow-Debian-blends-to-override-gosa-conf.patch

Attachment: signature.asc
Description: Digital signature


Reply to: