<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how do i get the environment variables of a proces? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039186#M95576</link>
    <description>Hmm, how can one create a truly secure environment if one process can freely communicate with an other? Never mind... Hein&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 10 Apr 2007 12:24:14 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-04-10T12:24:14Z</dc:date>
    <item>
      <title>how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039179#M95569</link>
      <description>I am porting a perl script to hpux and I need a way to get the environment variables of a certain process. To do that in linux I look at /proc/&lt;PID&gt;/environ. How do I do that on hpux?&lt;/PID&gt;</description>
      <pubDate>Tue, 10 Apr 2007 10:24:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039179#M95569</guid>
      <dc:creator>Naoum</dc:creator>
      <dc:date>2007-04-10T10:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039180#M95570</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'for $key (keys %ENV) {print "$key=$ENV{$key}"}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 10 Apr 2007 10:47:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039180#M95570</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-10T10:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039181#M95571</link>
      <description>That will give me the env variables of MY process. I want to get them for any process give the PID of the process.</description>
      <pubDate>Tue, 10 Apr 2007 10:52:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039181#M95571</guid>
      <dc:creator>Naoum</dc:creator>
      <dc:date>2007-04-10T10:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039182#M95572</link>
      <description>Congratulations, you have created a non-portable application. There is no equivalent of the /proc filesystem in HP-UX at 11iv2 and below. In principle, you could do this by attaching gdb to a running process but that's not a very portable solution as well.</description>
      <pubDate>Tue, 10 Apr 2007 11:02:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039182#M95572</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-10T11:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039183#M95573</link>
      <description>As mentioned, there is no easy way to do this.</description>
      <pubDate>Tue, 10 Apr 2007 11:23:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039183#M95573</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2007-04-10T11:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039184#M95574</link>
      <description>So now that we know that the immediate question has no easy answer, and probably required excesive (unsafe) priv on Linux, maybe it is time to focus on...&lt;BR /&gt;&lt;BR /&gt;What is the real problem you are trying to solve?&lt;BR /&gt;&lt;BR /&gt;When you get those ENV variables... what do yo intent to do with them?&lt;BR /&gt;Maybe there is a better way than looking over the process shoulder. Maybe you can one can ask nicely.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Apr 2007 12:15:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039184#M95574</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-04-10T12:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039185#M95575</link>
      <description>Hein, &lt;BR /&gt;&lt;BR /&gt;Just for clarity there is no excesive (unsafe) priv on Linux for accessing info via procfs. it's a pseudo filesystem and is used exactly for the purpose(s) that Naoum used it.</description>
      <pubDate>Tue, 10 Apr 2007 12:20:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039185#M95575</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2007-04-10T12:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039186#M95576</link>
      <description>Hmm, how can one create a truly secure environment if one process can freely communicate with an other? Never mind... Hein&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Apr 2007 12:24:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039186#M95576</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-04-10T12:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039187#M95577</link>
      <description>A similar question was asked about ps -eew, which also doesn't exist on HP-UX:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1109088" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1109088&lt;/A&gt;</description>
      <pubDate>Tue, 10 Apr 2007 22:53:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039187#M95577</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-10T22:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039188#M95578</link>
      <description>The application was looking for the ORACLE_HOME of the process ... I guess I'll rewrite it to use the path to the executable out of ps -ef or something like that. &lt;BR /&gt;Thanks a lot guys.</description>
      <pubDate>Wed, 11 Apr 2007 08:57:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039188#M95578</guid>
      <dc:creator>Naoum</dc:creator>
      <dc:date>2007-04-11T08:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039189#M95579</link>
      <description>&lt;!--!*#--&gt;Maybe not quite what you miss,&lt;BR /&gt;but how about parsing the listener process from the proc table.&lt;BR /&gt;Most of the times it should enclose the ORACLE_HOME up to bin in its (ps) args.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -u oracle -x -o args|grep tns&lt;BR /&gt;/app/oracle/product/9.2.0/bin/tnslsnr l_alma -inherit&lt;BR /&gt;&lt;BR /&gt;@Hein "how can one create a truly secure environment?"&lt;BR /&gt;&lt;BR /&gt;The Linux folks have come up with an abundance of possible solutions.&lt;BR /&gt;To name but a few&lt;BR /&gt;&lt;BR /&gt;SELinux, AppArmor, VServer, Xen, User Mode Linux&lt;BR /&gt;&lt;BR /&gt;or from BSD take jails etc., etc.&lt;BR /&gt;&lt;BR /&gt;The /proc filesystem is a true boon that on Linux'es that don't use any of the above separations or mandatory access controls&lt;BR /&gt;that I sometimes miss on HP-UX.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Apr 2007 09:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039189#M95579</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-11T09:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039190#M95580</link>
      <description>Ralph, that's exactly what i meant. thanks.</description>
      <pubDate>Wed, 11 Apr 2007 09:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039190#M95580</guid>
      <dc:creator>Naoum</dc:creator>
      <dc:date>2007-04-11T09:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039191#M95581</link>
      <description>Hein, Ralph, Court:&lt;BR /&gt;&lt;BR /&gt;In Linux, much detailed information is available at /proc/&lt;PID&gt;/ virtual directories...  but the security-sensitive information is protected so that you must be the owner of the process (or root, of course) to be able to read it. This protection is achieved through traditional unix filesystem permissions.&lt;BR /&gt;&lt;BR /&gt;In particular, the environment file /proc/&lt;PID&gt;/environ is protected:&lt;BR /&gt;$ ls -l /proc/1/environ&lt;BR /&gt;-r--------  1 root root 0 2007-04-11 17:52 /proc/1/environ&lt;BR /&gt;$ ls -l /proc/11882/environ&lt;BR /&gt;-r--------  1 mkurkela mkurkela 0 2007-04-11 17:56 /proc/11882/environ&lt;BR /&gt;$ cat /proc/1/environ&lt;BR /&gt;cat: /proc/1/environ: Permission denied&lt;BR /&gt;&lt;BR /&gt;(Process 11882 in the example above is my current shell. Process 1 is init, of course.)&lt;BR /&gt;&lt;BR /&gt;As /proc is a virtual filesystem, these file permissions are automatically generated whenever someone tries to read the files/directories under /proc. So the permissions can't really be changed to cause security breaches.&lt;BR /&gt;&lt;BR /&gt;So now we know that the original perl script on Linux was either run as the same user than the interesting process, or run as root.&lt;BR /&gt;&lt;BR /&gt;MK&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 11 Apr 2007 10:10:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039191#M95581</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2007-04-11T10:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039192#M95582</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please take a moment to assign points to those who have taken the time to assist you. Here's how:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gary</description>
      <pubDate>Wed, 11 Apr 2007 11:21:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039192#M95582</guid>
      <dc:creator>Gary Cantwell</dc:creator>
      <dc:date>2007-04-11T11:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the environment variables of a proces?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039193#M95583</link>
      <description>done.</description>
      <pubDate>Wed, 11 Apr 2007 11:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-do-i-get-the-environment-variables-of-a-proces/m-p/5039193#M95583</guid>
      <dc:creator>Naoum</dc:creator>
      <dc:date>2007-04-11T11:35:45Z</dc:date>
    </item>
  </channel>
</rss>

