Re: [Freeipa-devel] [PATCH] fixes #1193 init script related

2011-04-27 Thread Rob Crittenden

Simo Sorce wrote:

On Tue, 2011-04-26 at 17:08 -0400, Rob Crittenden wrote:

Simo Sorce wrote:

With this patch we stop clearing the environment variables when running
binaries allowing for env variables to be passed down by default.

This fixes also the init script against Fedora 15 and systemd

Simo.



I think it would be better to import copy and use:

if env is None:
  env = copy.deepcopy(os.environ)
  env[PATH] = /bin:/sbin:...

rob


Updated patch attached.

Simo.



ack

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] fixes #1193 init script related

2011-04-27 Thread Simo Sorce
On Wed, 2011-04-27 at 10:59 -0400, Rob Crittenden wrote:
 Simo Sorce wrote:
  On Tue, 2011-04-26 at 17:08 -0400, Rob Crittenden wrote:
  Simo Sorce wrote:
  With this patch we stop clearing the environment variables when running
  binaries allowing for env variables to be passed down by default.
 
  This fixes also the init script against Fedora 15 and systemd
 
  Simo.
 
 
  I think it would be better to import copy and use:
 
  if env is None:
env = copy.deepcopy(os.environ)
env[PATH] = /bin:/sbin:...
 
  rob
 
  Updated patch attached.
 
  Simo.
 
 
 ack

Pushed to master.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] fixes #1193 init script related

2011-04-27 Thread Rob Crittenden

Simo Sorce wrote:

On Wed, 2011-04-27 at 10:59 -0400, Rob Crittenden wrote:

Simo Sorce wrote:

On Tue, 2011-04-26 at 17:08 -0400, Rob Crittenden wrote:

Simo Sorce wrote:

With this patch we stop clearing the environment variables when running
binaries allowing for env variables to be passed down by default.

This fixes also the init script against Fedora 15 and systemd

Simo.



I think it would be better to import copy and use:

if env is None:
   env = copy.deepcopy(os.environ)
   env[PATH] = /bin:/sbin:...

rob


Updated patch attached.

Simo.



ack


Pushed to master.

Simo.



Pushed to ipa-2-0 branch

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] fixes #1193 init script related

2011-04-26 Thread Rob Crittenden

Simo Sorce wrote:

With this patch we stop clearing the environment variables when running
binaries allowing for env variables to be passed down by default.

This fixes also the init script against Fedora 15 and systemd

Simo.



I think it would be better to import copy and use:

if env is None:
env = copy.deepcopy(os.environ)
env[PATH] = /bin:/sbin:...

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] fixes #1193 init script related

2011-04-26 Thread Simo Sorce
On Tue, 2011-04-26 at 17:08 -0400, Rob Crittenden wrote:
 Simo Sorce wrote:
  With this patch we stop clearing the environment variables when running
  binaries allowing for env variables to be passed down by default.
 
  This fixes also the init script against Fedora 15 and systemd
 
  Simo.
 
 
 I think it would be better to import copy and use:
 
 if env is None:
  env = copy.deepcopy(os.environ)
  env[PATH] = /bin:/sbin:...
 
 rob

Updated patch attached.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
From 99479272dfa3d9a7ba8e593f72ec61da1d851752 Mon Sep 17 00:00:00 2001
From: Simo Sorce sso...@redhat.com
Date: Tue, 26 Apr 2011 15:51:34 -0400
Subject: [PATCH] ipautil: Preserve environment unless explicitly overridden
 by caller.

Fixes: https://fedorahosted.org/freeipa/ticket/1193
---
 ipapython/ipautil.py |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 81719ccaedcc9b01dccc3d01098830bcdc6aa087..b5a0b9105800b55296bb36877e9b98666426c7cc 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -28,6 +28,7 @@ import logging
 import subprocess
 import random
 import os, sys, traceback, readline
+import copy
 import stat
 import shutil
 import urllib2
@@ -119,7 +120,9 @@ def run(args, stdin=None, raiseonerr=True,
 p_err = None
 
 if env is None:
-env={PATH: /bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin}
+# copy default env
+env = copy.deepcopy(os.environ)
+env[PATH] = /bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin
 if stdin:
 p_in = subprocess.PIPE
 if capture_output:
-- 
1.7.4.4

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel