Merge lp:~pieq/checkbox/fix-1484872-env-variables-forced-to-non-international into lp:checkbox
Proposed by
Pierre Equoy
Status: | Rejected |
---|---|
Rejected by: | Zygmunt Krynicki |
Proposed branch: | lp:~pieq/checkbox/fix-1484872-env-variables-forced-to-non-international |
Merge into: | lp:checkbox |
Diff against target: |
59 lines (+34/-2) 2 files modified
plainbox/plainbox/impl/ctrl.py (+2/-2) plainbox/plainbox/impl/test_ctrl.py (+32/-0) |
To merge this branch: | bzr merge lp:~pieq/checkbox/fix-1484872-env-variables-forced-to-non-international |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zygmunt Krynicki (community) | Needs Fixing | ||
Review via email: mp+269873@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 3979. By Pierre Equoy
-
Force environment into non-internation
alized values Previously, get_execution_
environment( ) method in ctrl.py would set LANG
variable to 'C.UTF-8' but would not do anything to LANGUAGE or LC_* variables.We change this to make sure these variables are all set to empty strings in
order to force the system to use default (non-internationalized) values. This allow us to use English regexp in scripts, even on non-English systems.
12:11 <@zyga> ePierre: https:/ /code.launchpad .net/~pierre- equoy/checkbox/ fix-1484872- env-variables- forced- to-non- international/ +merge/ 269873 trusted- launcher
12:11 <@zyga> ePierre: can you explain how this works please
12:11 <@zyga> ePierre: deleting an environment variable really really means that that variable is gone in the process we fork off
12:11 < ePierre> zyga, sure
12:11 <@zyga> ePierre: I assume there's something that re-establishes them
12:11 <@zyga> ePierre: but I wonder what that is and so now I'm all ears
12:12 < ePierre> ok so we were checking this with spineau
12:12 < ePierre> zyga, we realized that currently, LANGUAGE is deleted from the env dict that is returned
12:13 < ePierre> zyga, but because of that, when pkexec is called, it is not called with a special value for LANGUAGE
12:13 <@zyga> mmm
12:13 <@zyga> ah, so this is for pkexec
12:13 <@zyga> I think you need to change your patch
12:13 < ePierre> zyga, so pkexec uses the available value in the system env, which is, for a system using Chinese, something like zh_CN:zh
12:13 <@zyga> sudo and pkexec use a "differential" environment
12:13 <@zyga> it's a hack that lets us set the environment in the process that they start
12:14 <@zyga> because they will otherwise change the environment significantly (sudo) or entirely (pkexec)
12:15 <@zyga> ePierre: I think this patch is not right, one sec
12:15 <@zyga> ePierre: can you please go and patch the differential environment
12:16 <@zyga> ePierre: I think it's the more correct approach, the generimc method is correct for non-helper execution controllers
12:16 <@zyga> ePierre: and for both pkexec, sudo and p-t-l you need to do things explicitly (and check all three)
12:16 <@zyga> ePierre: as a test case run a job that runs locale
12:16 <@zyga> as in locale(1)
12:16 <@zyga> and run it with each execution controller
12:17 <@zyga> ePierre: the patch should special case locale variables in differential environment
12:17 <@zyga> ePierre: and make sure to see how each of sudo/pkexec/p-t-l execution controllers work please
12:17 < ePierre> zyga what is p-t-l?
12:18 <@zyga> ePierre: plainbox-
12:18 < ePierre> ha, the famous trusted launcher, ok
12:18 <@zyga> thanks
12:18 <@zyga> ePierre: ping me if you have any questions, thanks for working on this!
12:18 < ePierre> zyga, ok, thanks