<?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: Setting umask using environment variable - not a system call in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5594689#M640418</link>
    <description>&lt;P&gt;Thanks for your reply ! As you said ultimately this might be configuration on the webspeed application. &amp;nbsp;I was not able to locate documentation about this topic. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have simply logged a support case Progress about this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion to locate where the actual application is launched and apply umask would most likely work! After drilling down I was able to locate the actual executable. &amp;nbsp;This will be considered a last resort change by our DBA, as the policy is to avoid customizations to files in the installation directories of apps we have purchased.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We could probably use a wrapper script or something of the sort. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Etienne.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2012 14:08:44 GMT</pubDate>
    <dc:creator>beginetienne</dc:creator>
    <dc:date>2012-03-23T14:08:44Z</dc:date>
    <item>
      <title>Setting umask using environment variable - not a system call</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5593895#M640416</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HP-UX usxsl022 B.11.31 U ia64 0309084507 unlimited-user license&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if it is possible to set the umask by setting an environment variable. &amp;nbsp;I was told on a different forum that some flavors of unix/linux allowed the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UMASK=022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will this work on HP Unix ? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need this because we use apache and webspeed from Progress, which is basically our web transaction server. &amp;nbsp;The webspeed process runs under a user id, and it creates files with permissions rw-rw-rw. &amp;nbsp;This is not acceptable, and I need to apply umask 022 to meet some security standard we have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Etienne.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 20:35:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5593895#M640416</guid>
      <dc:creator>beginetienne</dc:creator>
      <dc:date>2012-03-22T20:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Setting umask using environment variable - not a system call</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5593963#M640417</link>
      <description>&lt;P&gt;Umask is fundamentally not an environment variable, though it is explicitly inherited from the parent process to the child just like (exported) environment variables (see fork(2)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ability to set it using an environment variable syntax would probably be a feature of a specific shell, implemented by running the umask() system call as the user or a script assigns a value to a specific variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sure your Progress is started with the correct umask? If it is started directly from /etc/inittab, it would probably inherit the kernel default umask, which has historically been 000 in HP-UX. Even if Progress is programmed to explicitly chmod() the files it creates to sane values, it might still allow its child processes to inherit the original unmodified value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you find no other way to configure the umask for webspeed, you might find the actual webspeed binary, rename it, and write a tiny shell script in its place. For example, if the original webspeed binary was /some/where/webspeed, you might do this:&lt;/P&gt;&lt;PRE&gt;mv /some/where/webspeed /some/where/webspeed.real
vi /some/where/webspeed&lt;BR /&gt;&amp;lt;write the script as below&amp;gt;&lt;BR /&gt;chmod 755 /some/where/webspeed&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The script /some/where/webspeed would be:&lt;/P&gt;&lt;PRE&gt;#!/bin/sh
umask 022
exec /some/where/webspeed.real "$@"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The "exec" command will make the shell process replace itself with the real webspeed binary, so there will be no extra shell process cluttering the ps listing. And the "$@" syntax will pass all the command line parameters given to this webspeed script to the webspeed.real binary exactly as they were, even if they contain spaces or special characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this kind of script does not help, it probably means webspeed is explicitly setting its own umask: in that case, it's time to read the webspeed documentation to find out how it decides the value it sets for itself. In such a case, it will probably be settable in some configuration file, but leaving it unset might cause it to default to 000.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 22:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5593963#M640417</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2012-03-22T22:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting umask using environment variable - not a system call</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5594689#M640418</link>
      <description>&lt;P&gt;Thanks for your reply ! As you said ultimately this might be configuration on the webspeed application. &amp;nbsp;I was not able to locate documentation about this topic. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have simply logged a support case Progress about this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion to locate where the actual application is launched and apply umask would most likely work! After drilling down I was able to locate the actual executable. &amp;nbsp;This will be considered a last resort change by our DBA, as the policy is to avoid customizations to files in the installation directories of apps we have purchased.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We could probably use a wrapper script or something of the sort. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Etienne.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2012 14:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-umask-using-environment-variable-not-a-system-call/m-p/5594689#M640418</guid>
      <dc:creator>beginetienne</dc:creator>
      <dc:date>2012-03-23T14:08:44Z</dc:date>
    </item>
  </channel>
</rss>

