[debian-edu-commits] debian-edu/pkg-team/ 02/02: debian/patches: Add 1016_allow-same-user-ids-as-adduser.patch. If strictNamingRules is set to false in gosa.conf, allow the same UID naming rule as found in /usr/bin/adduser (as of Debian jessie/stretch).
Mike Gabriel
sunweaver at debian.org
Wed Sep 9 12:28:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository gosa.
commit d7774d98129412c1caa75921e02a9efe26199cb2
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Wed Sep 9 14:27:55 2015 +0200
debian/patches: Add 1016_allow-same-user-ids-as-adduser.patch. If strictNamingRules is set to false in gosa.conf, allow the same UID naming rule as found in /usr/bin/adduser (as of Debian jessie/stretch).
---
.../1016_allow-same-user-ids-as-adduser.patch | 68 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 69 insertions(+)
diff --git a/debian/patches/1016_allow-same-user-ids-as-adduser.patch b/debian/patches/1016_allow-same-user-ids-as-adduser.patch
new file mode 100644
index 0000000..4e4544a
--- /dev/null
+++ b/debian/patches/1016_allow-same-user-ids-as-adduser.patch
@@ -0,0 +1,68 @@
+Description: Use a more modern UID naming rule.
+Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+Abstract:
+ When strictNamingRules are turned off in gosa.conf, we
+ should allow UID strings as allowed by concurrent versions
+ of adduser.
+ .
+ For defining "concurrent": This patch has been contributed
+ in 2015 (Debian jessie/stretch).
+
+--- a/gosa-core/include/functions.inc
++++ b/gosa-core/include/functions.inc
+@@ -1577,7 +1577,7 @@
+ if (strict_uid_mode()){
+ return "^[a-z0-9_-]+$";
+ } else {
+- return "^[a-zA-Z0-9 _.-]+$";
++ return "^[_.A-Za-z0-9][-\@_.A-Za-z0-9]*\$";
+ }
+ }
+
+--- a/gosa-core/include/utils/class_tests.inc
++++ b/gosa-core/include/utils/class_tests.inc
+@@ -113,13 +113,7 @@
+ return (TRUE);
+ }
+
+- /* STRICT adds spaces and case insenstivity to the uid check.
+- This is dangerous and should not be used. */
+- if (strict_uid_mode()){
+- return preg_match ("/^[a-z0-9_-]+$/", $uid);
+- } else {
+- return preg_match ("/^[a-z0-9 _.-]+$/i", $uid);
+- }
++ return preg_match ("/".$get_uid_regexp()."/", $uid);
+ }
+
+
+--- a/gosa-core/plugins/personal/generic/class_user.inc
++++ b/gosa-core/plugins/personal/generic/class_user.inc
+@@ -1352,11 +1352,7 @@
+ /* Check for valid input */
+ if ($this->is_modified && !tests::is_uid($this->uid)){
+
+- if (strict_uid_mode()){
+- $message[]= msgPool::invalid(_("Login"), $this->uid, "/[a-z0-9_-]/");
+- } else {
+- $message[]= msgPool::invalid(_("Login"), $this->uid, "/[a-z0-9_-]/i");
+- }
++ $message[]= msgPool::invalid(_("Login"), $this->uid, "/".get_uid_regexp()."/");
+ }
+ if (!tests::is_url($this->labeledURI)){
+ $message[]= msgPool::invalid(_("Homepage"), "", "", "http://www.your-domain.com/yourname");
+--- a/fai/admin/fai/class_faiTemplateEntry.inc
++++ b/fai/admin/fai/class_faiTemplateEntry.inc
+@@ -254,11 +254,7 @@
+ if($this->group == ""){
+ $message[] = msgPool::required(_("Group"));
+ }elseif (!tests::is_uid($this->group)){
+- if (strict_uid_mode()){
+- $message[]= msgPool::invalid(_("Group"), $this->group, "/[a-z0-9_-]/");
+- } else {
+- $message[]= msgPool::invalid(_("Group"), $this->group, "/[a-z0-9_-]/i");
+- }
++ $message[]= msgPool::invalid(_("Group"), $this->group, "/".get_uid_regexp()."/");
+ }
+
+ return ($message);
diff --git a/debian/patches/series b/debian/patches/series
index b583200..7c534f6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,6 +18,7 @@
1013_fix-smarty-gettext-tags-recognition.patch
1014_fix-description-of-new-prim-groups.patch
1015_allow-iso8601-date-format-in-user-API.patch
+1016_allow-same-user-ids-as-adduser.patch
2001_fix-smarty-location.patch
2002_fix-template-location.patch
2003_fix-class-mapping.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/gosa.git
More information about the debian-edu-commits
mailing list