2 commits - kolabd/__init__.py pykolab/logger.py saslauthd/kolab-saslauthd.sysconfig wallace/__init__.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed May 30 11:04:37 CEST 2012


 kolabd/__init__.py                  |   16 ++++++++++------
 pykolab/logger.py                   |    9 +++++++--
 saslauthd/kolab-saslauthd.sysconfig |    5 +++++
 wallace/__init__.py                 |   16 ++++++++++------
 4 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit 02c032ccb58b4aed02f9cb0590e0f36c5dfb8b63
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed May 30 11:01:15 2012 +0200

    Add kolab-saslauthd.sysconfig

diff --git a/saslauthd/kolab-saslauthd.sysconfig b/saslauthd/kolab-saslauthd.sysconfig
new file mode 100644
index 0000000..0bfb4bc
--- /dev/null
+++ b/saslauthd/kolab-saslauthd.sysconfig
@@ -0,0 +1,5 @@
+# Configuration file for the Kolab SASL Autentication daemon.
+#
+# See kolab-saslauthd --help for more flags.
+#
+FLAGS="--fork -l warning"
\ No newline at end of file


commit e2b0cacccc6aed5fbd8864fc694f437130899327
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue May 29 10:47:39 2012 +0200

    Make sure we use no functions that have been introduced in Python > 2.6 (#803)

diff --git a/kolabd/__init__.py b/kolabd/__init__.py
index 6939326..bf4fc7b 100644
--- a/kolabd/__init__.py
+++ b/kolabd/__init__.py
@@ -92,12 +92,16 @@ class KolabDaemon(object):
         exitcode = 0
 
         try:
-            (ruid, euid, suid) = os.getresuid()
-            (rgid, egid, sgid) = os.getresgid()
+            try:
+                (ruid, euid, suid) = os.getresuid()
+                (rgid, egid, sgid) = os.getresgid()
+            except AttributeError, errmsg:
+                ruid = os.getuid()
+                rgid = os.getgid()
 
             if ruid == 0:
                 # Means we can setreuid() / setregid() / setgroups()
-                if egid == 0:
+                if rgid == 0:
                     # Get group entry details
                     try:
                         (
@@ -115,7 +119,7 @@ class KolabDaemon(object):
                         sys.exit(1)
 
                     # Set real and effective group if not the same as current.
-                    if not group_gid == egid:
+                    if not group_gid == rgid:
                         log.debug(
                                 _("Switching real and effective group id to %d") % (
                                         group_gid
@@ -125,7 +129,7 @@ class KolabDaemon(object):
 
                         os.setregid(group_gid, group_gid)
 
-                if euid == 0:
+                if ruid == 0:
                     # Means we haven't switched yet.
                     try:
                         (
@@ -147,7 +151,7 @@ class KolabDaemon(object):
 
 
                     # Set real and effective user if not the same as current.
-                    if not user_uid == euid:
+                    if not user_uid == ruid:
                         log.debug(
                                 _("Switching real and effective user id to %d") % (
                                         user_uid
diff --git a/pykolab/logger.py b/pykolab/logger.py
index 94a84fb..878f79f 100644
--- a/pykolab/logger.py
+++ b/pykolab/logger.py
@@ -92,8 +92,13 @@ class Logger(logging.Logger):
             fhandle.close()
 
         # Make sure (read: attempt to change) the permissions
-        (ruid, euid, suid) = os.getresuid()
-        (rgid, egid, sgid) = os.getresgid()
+        try:
+            (ruid, euid, suid) = os.getresuid()
+            (rgid, egid, sgid) = os.getresgid()
+        except AttributeError, errmsg:
+            ruid = os.getuid()
+            rgid = os.getgid()
+
         if ruid == 0 or rgid == 0:
             try:
                 os.chown(
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 0d04c5b..45ad211 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -254,12 +254,16 @@ class WallaceDaemon(object):
         exitcode = 0
 
         try:
-            (ruid, euid, suid) = os.getresuid()
-            (rgid, egid, sgid) = os.getresgid()
+            try:
+                (ruid, euid, suid) = os.getresuid()
+                (rgid, egid, sgid) = os.getresgid()
+            except AttributeError, errmsg:
+                ruid = os.getuid()
+                rgid = os.getgid()
 
             if ruid == 0:
                 # Means we can setreuid() / setregid() / setgroups()
-                if egid == 0:
+                if rgid == 0:
                     # Get group entry details
                     try:
                         (
@@ -277,7 +281,7 @@ class WallaceDaemon(object):
                         sys.exit(1)
 
                     # Set real and effective group if not the same as current.
-                    if not group_gid == egid:
+                    if not group_gid == rgid:
                         log.debug(
                                 _("Switching real and effective group id to %d") % (
                                         group_gid
@@ -287,7 +291,7 @@ class WallaceDaemon(object):
 
                         os.setregid(group_gid, group_gid)
 
-                if euid == 0:
+                if ruid == 0:
                     # Means we haven't switched yet.
                     try:
                         (
@@ -309,7 +313,7 @@ class WallaceDaemon(object):
 
 
                     # Set real and effective user if not the same as current.
-                    if not user_uid == euid:
+                    if not user_uid == ruid:
                         log.debug(
                                 _("Switching real and effective user id to %d") % (
                                         user_uid





More information about the commits mailing list