[nanny: 7/11] Get correct lang var from user-space



commit 6a95a0872dd3537864654547ce5f336045752baa
Author: Roberto Majadas <roberto majadas openshine com>
Date:   Tue May 11 16:52:52 2010 +0200

    Get correct lang var from user-space

 daemon/src/LinuxSessionCKFiltering.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/daemon/src/LinuxSessionCKFiltering.py b/daemon/src/LinuxSessionCKFiltering.py
index 0c75031..fd28461 100644
--- a/daemon/src/LinuxSessionCKFiltering.py
+++ b/daemon/src/LinuxSessionCKFiltering.py
@@ -138,7 +138,16 @@ class LinuxSessionCKFiltering(gobject.GObject) :
             
     def __launch_desktop_blocker(self, session_name, user_id, x11_display):
         print "Launch desktop-blocker to '%s'" % session_name
-        ret = os.system("DISPLAY=%s nanny-desktop-blocker" % x11_display)
+        proclist = gtop.proclist(gtop.PROCLIST_KERN_PROC_UID, int(user_id))
+
+        if len(proclist) > 0 :
+            from subprocess import Popen, PIPE
+
+            lang_var = Popen('cat /proc/%s/environ | tr "\\000" "\\n" | grep ^LANG= ' % proclist[0] , shell=True, stdout=PIPE).stdout.readline().strip("\n")
+            ret = os.system('DISPLAY=%s %s nanny-desktop-blocker' % (x11_display, lang_var))
+        else:
+            ret = os.system('DISPLAY=%s nanny-desktop-blocker' % (x11_display))
+
         return session_name, user_id, ret
 
     def __result_of_desktop_blocker(self, result):



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