<?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: $ RUN/UIC vs. SYS$CREPRC in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171513#M26440</link>
    <description>Ian: No change.&lt;BR /&gt;Wim: Nice thought but I doubt the system owner would accept this. Second, if such a check is made by LOGINOUT.EXE itself, it wouldn't help.</description>
    <pubDate>Fri, 24 Apr 2009 10:31:24 GMT</pubDate>
    <dc:creator>Willem Grooters</dc:creator>
    <dc:date>2009-04-24T10:31:24Z</dc:date>
    <item>
      <title>$ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171510#M26437</link>
      <description>&lt;!--!*#--&gt;(VMS 7.3-2)&lt;BR /&gt;&lt;BR /&gt;In DCL, I can create a proces under the same username but a different UIC:&lt;BR /&gt;&lt;BR /&gt;$ run/uic='uic'/input='Runfile'/out='rlog' sys$system:loginout.exe -&lt;BR /&gt;     /PROCESS_NAME='ProcesName' -&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;and BLA.COM is executed under that UIC. The drwaback is that the original user requires IMPERSONATE privilege. &lt;BR /&gt;&lt;BR /&gt;To avoid this, I created a small program, doing the same but using the CREPRC system service, and installed it with IMPERSONATE privilege (Of course, after some checking to avoid abuse):&lt;BR /&gt;&lt;BR /&gt;        status = SYS$CREPRC (&amp;amp;pid,&lt;BR /&gt;                             &amp;amp;imgnam,&lt;BR /&gt;                             &amp;amp;inputfile_descr,&lt;BR /&gt;                             &amp;amp;outputfile_descr,&lt;BR /&gt;                             0,                         // errorfile&lt;BR /&gt;                             0,                 // privileges&lt;BR /&gt;                             &amp;amp;QuotaArray,&lt;BR /&gt;                             &amp;amp;runprcnam_descr,&lt;BR /&gt;                             0,                 // prioriteit&lt;BR /&gt;                             uic,&lt;BR /&gt;                             0,                 // term. mailbox&lt;BR /&gt;                             flg,&lt;BR /&gt;                             0,                 // itemlist&lt;BR /&gt;                             0,                 // node&lt;BR /&gt;                             0 ) ;              // RAD&lt;BR /&gt;&lt;BR /&gt;(imgnam = SYS$SYSTEM:LOGINOUT.EXE)&lt;BR /&gt;&lt;BR /&gt;and the image is executed where I would otherwise use RUN/UIC.&lt;BR /&gt;&lt;BR /&gt;The intended procedure is actually executed but the UIC of the process remains the one of the original user. But this change of UIC is required (for reasons not to be discussed here - I know there are better ways of doing this but this is what I'm to work with)&lt;BR /&gt;&lt;BR /&gt;The flags I used is just PRC$V_DETACH (though the documentation sttaes IMPERSONATE, it's not found in prcdef on this VMS version)&lt;BR /&gt;Because DCL is involved, I need to use LOGINOUT.EXE, but the documentation isn't clear whether this will, or will not allow execution under a different UIC - opposite to DCL. &lt;BR /&gt;&lt;BR /&gt;Is there a way to achieve my goal: Running a procedure under a different UIC - as a separate (sub)process, using the system service?</description>
      <pubDate>Fri, 24 Apr 2009 08:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171510#M26437</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-04-24T08:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171511#M26438</link>
      <description>I wonder if you need to set NOUAF as well.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Apr 2009 09:54:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171511#M26438</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2009-04-24T09:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171512#M26439</link>
      <description>You could also copy loginout.exe to a new file and install that with privs. And regulate access via an ACL.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Fri, 24 Apr 2009 10:01:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171512#M26439</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2009-04-24T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171513#M26440</link>
      <description>Ian: No change.&lt;BR /&gt;Wim: Nice thought but I doubt the system owner would accept this. Second, if such a check is made by LOGINOUT.EXE itself, it wouldn't help.</description>
      <pubDate>Fri, 24 Apr 2009 10:31:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171513#M26440</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-04-24T10:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171514#M26441</link>
      <description>Hi Willem,&lt;BR /&gt;&lt;BR /&gt;Sorry to not answer your question directly but, please go the whole hog and stick a $persona_create + $persona_assume before the $creprc. Then you can drop the UIC altogether.&lt;BR /&gt;&lt;BR /&gt;You need to install the program with SYSPRV as well as DETACH privs and organize access so not everyone can run it, but I'm guessing it's what you really want?&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher&lt;BR /&gt;&lt;BR /&gt;PS. DOes anyone want to hear about my Mum's knee replacement and how long I've been spending in hospitals lately :-(</description>
      <pubDate>Fri, 24 Apr 2009 10:40:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171514#M26441</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2009-04-24T10:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171515#M26442</link>
      <description>Ian: Overlooked something: old version was still installed. After I corrected that error, NOUAF seems just what was needed. Sorry I cannot add points :)&lt;BR /&gt;Richard: I would have done so if there wasn't a time constraint with the customer. &lt;BR /&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:14:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171515#M26442</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-04-24T11:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171516#M26443</link>
      <description>I found out that PRCDEF on our 7.3-2 system isn't in sync with the VMS System Services manual, so I had to code&lt;BR /&gt;&lt;BR /&gt;flags= 0|PRC$M_DETACH|PRC$M_LOGIN&lt;BR /&gt;&lt;BR /&gt;to get things going.&lt;BR /&gt;&lt;BR /&gt;When in sync (VMS &amp;gt; 7.3-2), use:&lt;BR /&gt;&lt;BR /&gt;flags= 0|PRC$M_IMPERSONATE|PRC$M_NOUAF&lt;BR /&gt;&lt;BR /&gt;do not forget to INSTALL REPLACE the image afterwards :D&lt;BR /&gt;&lt;BR /&gt;====&lt;BR /&gt;As has been quoted many many times: there are better ways to achieve the same thing. If possible, avoid this hack and use the advise given by Richard Mahler, Hoff, John Gillings and others.</description>
      <pubDate>Fri, 24 Apr 2009 11:22:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171516#M26443</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-04-24T11:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171517#M26444</link>
      <description>Pragmatically, this stuff is the same.  The:&lt;BR /&gt;&lt;BR /&gt;flags= PRC$M_DETACH|PRC$M_LOGIN&lt;BR /&gt;&lt;BR /&gt;is the same as:&lt;BR /&gt;&lt;BR /&gt;flags= PRC$M_IMPERSONATE|PRC$M_NOUAF&lt;BR /&gt;&lt;BR /&gt;with the bits renamed.&lt;BR /&gt;&lt;BR /&gt;Notice the results of the following (yeah, its Bliss) search:&lt;BR /&gt;&lt;BR /&gt;$ search sys$share:*.req PRC$M_IMPERSONATE,PRC$M_NOUAF,PRC$M_DETACH,PRC$M_LOGIN&lt;BR /&gt;&lt;BR /&gt;******************************&lt;BR /&gt;SYS$COMMON:[SYSLIB]STARLET.REQ;1&lt;BR /&gt;&lt;BR /&gt;literal PRC$M_NOUAF = %X'40';&lt;BR /&gt;literal PRC$M_DETACH = %X'200';&lt;BR /&gt;literal PRC$M_LOGIN = %X'40';&lt;BR /&gt;literal PRC$M_IMPERSONATE = 512; &lt;BR /&gt;&lt;BR /&gt;The values of  PRC$M_NOUAF and PRC$M_LOGIN match, and PRC$M_DETACH and PRC$M_IMPERSONATE (after converting bases) match.&lt;BR /&gt;&lt;BR /&gt;The fundamental error here is the assumption that the context is comprised of "just" the UIC.  That was mostly the case back in RSX-11M, but in OpenVMS and particularly in OpenVMS after V6.0, there's way, way, way _way_ more to the process context than "just" the UIC.&lt;BR /&gt;&lt;BR /&gt;I generally suggest the use the persona services; those tend to get this stuff right, where changing "just" the UIC tends to lead to weirdness and pain.&lt;BR /&gt;&lt;BR /&gt;If you want to update your C library reference area, the LIBEXT tool on the Freeware V7.0 is what the C installation kits once used; it's a wildcard library extraction tool.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Apr 2009 13:46:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171517#M26444</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2009-04-24T13:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171518#M26445</link>
      <description>I know it's the same. It's just that prcdef.h on these systems is not in line with the docs. I ran into this because usage of PRC$M_IMPERSONATE and PRC$M_NOUAF caused compilation errors; you just must be aware of the issue ;)</description>
      <pubDate>Fri, 24 Apr 2009 18:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171518#M26445</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-04-24T18:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: $ RUN/UIC vs. SYS$CREPRC</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171519#M26446</link>
      <description>General comment about PRC$M_NOUAF ...&lt;BR /&gt;&lt;BR /&gt;When you run LOGINOUT in a detached process *WITHOUT* specifying PRC$M_NOUAF for $CREPRC, or *WITH* /AUTHORIZE on the DCL RUN command, (note that the default is reversed between the two), many of the process attributes you have specified with qualifiers or parameters may be overridden in the resulting process.&lt;BR /&gt;&lt;BR /&gt;  That includes UIC, process name, quotas and privileges. Behind the scenes, the process is created with whatever you specified, but LOGINOUT replaces them with values from the UAF.&lt;BR /&gt;&lt;BR /&gt;  This is all documented in the IDSM. Creating processes is complex, and loaded with pitfalls, defaults, default defaults, minima and other overrides. Test your code carefully, and examine resulting processes from SDA to make sure everything is correct.&lt;BR /&gt;&lt;BR /&gt;Note that the official Compaq/HP "Programming OpenVMS System Services" training course has a fairly serious error along these lines in the $CREPRC example - it's supposed to be setting working set parameters, but manages to to a CPU limit instead.  &lt;BR /&gt;&lt;BR /&gt;Willem, double check your QuotaArray variable. Don't trust listings or even DEBUG. You need to be able to examine it as raw quadword hex values and verify that all the fields really are in the right place. To get it right, it needs to be declared as unaligned.</description>
      <pubDate>Sun, 26 Apr 2009 21:46:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-uic-vs-sys-creprc/m-p/5171519#M26446</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-04-26T21:46:32Z</dc:date>
    </item>
  </channel>
</rss>

