<?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: Problem with SUID bit in executable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709230#M659751</link>
    <description>&lt;!--!*#--&gt;&amp;gt; &amp;gt; ls -l /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34&lt;BR /&gt;lrwxr-xr-x 1 root sys 16 Feb 20 2007 /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34@ -&amp;gt; libicuuc.sl.34.0&lt;BR /&gt;&lt;BR /&gt;Ok.  That's a link to something.  Now what&lt;BR /&gt;about the link target, "libicuuc.sl.34.0"?</description>
    <pubDate>Thu, 04 Nov 2010 11:09:14 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-11-04T11:09:14Z</dc:date>
    <item>
      <title>Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709227#M659748</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have the following problem.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;../bin/memdbkey and ../bin/memdbkey2 are identical executables. The only different thing is permissions: ../bin/memdbkey2 has SIUD bit.&lt;BR /&gt;&lt;BR /&gt;User-1: owner of the executables&lt;BR /&gt;hpx418&amp;gt; uname -a              &lt;BR /&gt;HP-UX hpx418 B.11.23 U ia64 1139467043 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; pwd     &lt;BR /&gt;/devjuser/jp/ccjp/avinokur/proj/gadj750_CNV64/ut&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; id      &lt;BR /&gt;uid=75308(avinokur) gid=479(pm)&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ls -l ../bin/memdbkey*&lt;BR /&gt;-rwxr-xr-x   1 avinokur   pm         2037608 Nov  4 11:15 ../bin/memdbkey*&lt;BR /&gt;-rwsr-sr-x   1 avinokur   pm         2037608 Nov  4 12:17 ../bin/memdbkey2*&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ../bin/memdbkey &lt;BR /&gt;// Works fine      &lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ../bin/memdbkey2&lt;BR /&gt;// Works fine&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Unber-2: Another user&lt;BR /&gt;hpx418&amp;gt; uname -a&lt;BR /&gt;HP-UX hpx418 B.11.23 U ia64 1139467043 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; pwd&lt;BR /&gt;/devjuser/jp/ccjp/avinokur/proj/gadj750_CNV64/ut&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; id&lt;BR /&gt;uid=204925(monitor) gid=20(users)&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ls -l ../bin/memdbkey*&lt;BR /&gt;-rwxr-xr-x   1 avinokur   pm         2037608 Nov  4 11:15 ../bin/memdbkey*&lt;BR /&gt;-rwsr-sr-x   1 avinokur   pm         2037608 Nov  4 12:17 ../bin/memdbkey2*&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ../bin/memdbkey&lt;BR /&gt;// Works fine&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; ../bin/memdbkey2&lt;BR /&gt;/usr/lib/hpux64/dld.so: Unable to find library 'libicuuc.sl.34'.&lt;BR /&gt;Killed&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Alex Vinokur&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2010 09:51:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709227#M659748</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-04T09:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709228#M659749</link>
      <description>&lt;!--!*#--&gt;A ".doc" attachment (MS Word?) is not a&lt;BR /&gt;convenient form for everyone.  (What's in it&lt;BR /&gt;besides plain text?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; /usr/lib/hpux64/dld.so: Unable to find library 'libicuuc.sl.34'.&lt;BR /&gt;&lt;BR /&gt;Ok.  So where's "libicuuc.sl.34", and who&lt;BR /&gt;owns it, and what are its permissions&lt;BR /&gt;("ls -l")?</description>
      <pubDate>Thu, 04 Nov 2010 10:23:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709228#M659749</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-11-04T10:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709229#M659750</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;My Word-attachment holds the same information as plain text.&lt;BR /&gt;&lt;BR /&gt;=========================================================&lt;BR /&gt;&amp;gt; id&lt;BR /&gt;uid=75308(avinokur) gid=479(pm)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ldd ../bin/memdbkey2 | &amp;amp; tee log&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&amp;gt; grep libicuuc log                                           &lt;BR /&gt;        libicuuc.sl.34 =&amp;gt;       /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34&lt;BR /&gt;        &lt;BR /&gt;&amp;gt; ls -l /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34&lt;BR /&gt;lrwxr-xr-x   1 root       sys             16 Feb 20  2007 /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34@ -&amp;gt; libicuuc.sl.34.0&lt;BR /&gt;&lt;BR /&gt;&amp;gt; env | grep "/usr/local64/xerces-c2_6_0_icu_64b//lib"&lt;BR /&gt;SHLIB_PATH= ...&lt;BR /&gt;LD_LIBRARY_PATH= ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;=========================================================&lt;BR /&gt;&amp;gt; id&lt;BR /&gt;uid=204925(monitor) gid=20(users)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ldd ../bin/memdbkey2 | &amp;amp; tee ~/log2&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&amp;gt; grep libicuuc ~/log2               &lt;BR /&gt;        Unable to find library 'libicuuc.sl.34'.&lt;BR /&gt;        &lt;BR /&gt;        &lt;BR /&gt;&amp;gt; ls -l /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34&lt;BR /&gt;lrwxr-xr-x   1 root       sys             16 Feb 20  2007 /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34@ -&amp;gt; libicuuc.sl.34.0&lt;BR /&gt;&lt;BR /&gt;&amp;gt; env | grep "/usr/local64/xerces-c2_6_0_icu_64b//lib"&lt;BR /&gt;SHLIB_PATH= ...&lt;BR /&gt;LD_LIBRARY_PATH= ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;---------------&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2010 10:51:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709229#M659750</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-04T10:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709230#M659751</link>
      <description>&lt;!--!*#--&gt;&amp;gt; &amp;gt; ls -l /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34&lt;BR /&gt;lrwxr-xr-x 1 root sys 16 Feb 20 2007 /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34@ -&amp;gt; libicuuc.sl.34.0&lt;BR /&gt;&lt;BR /&gt;Ok.  That's a link to something.  Now what&lt;BR /&gt;about the link target, "libicuuc.sl.34.0"?</description>
      <pubDate>Thu, 04 Nov 2010 11:09:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709230#M659751</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-11-04T11:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709231#M659752</link>
      <description>&amp;gt; ls -l /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.3&lt;BR /&gt;4.0 &lt;BR /&gt;-rwxr-xr-x   1 root       sys        4078304 Dec 11  2006 /usr/local64/xerces-c2_6_0_icu_64b//lib/libicuuc.sl.34.0*&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2010 11:13:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709231#M659752</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-04T11:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709232#M659753</link>
      <description>&amp;gt; env | grep "/usr/local64/xerces-c2_6_0_icu_64b//lib"&lt;BR /&gt;SHLIB_PATH= ...&lt;BR /&gt;LD_LIBRARY_PATH= ... &lt;BR /&gt;&lt;BR /&gt;As mentioned in your comp.sys.hp.hpux newsgroup post, it is important to know that the security police force dld to ignore the setting of those environment variables.&lt;BR /&gt;&lt;BR /&gt;If you want those paths to be honored, you must follow the directions in dld.so(5) and edit /etc/dld.sl.conf.</description>
      <pubDate>Fri, 05 Nov 2010 04:17:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709232#M659753</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-05T04:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709233#M659754</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;hpx418&amp;gt; uname -a             &lt;BR /&gt;HP-UX hpx418 B.11.23 U ia64 1139467043 unlimited-user license&lt;BR /&gt;hpx418&amp;gt; more /etc/dld.sl.conf&lt;BR /&gt;/etc/dld.sl.conf: No such file or directory&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Nov 2010 06:42:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709233#M659754</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-07T06:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709234#M659755</link>
      <description>Actually, the only thing I need is to give another process to change mode of some directory.&lt;BR /&gt;&lt;BR /&gt;Is this approach correct?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; cp /usr/bin/chmod myChmod&lt;BR /&gt;&lt;BR /&gt;&amp;gt; chmod 4555 myChmod&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ls -ld myChmod&lt;BR /&gt;-r-sr-xr-x   1 avinokur   pm           52388 Nov  7 08:41 myChmod&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now,&lt;BR /&gt;&lt;BR /&gt;&amp;gt; id   &lt;BR /&gt;uid=204925(monitor) gid=20(users)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ls -ld myDir&lt;BR /&gt;dr--------   2 avinokur   pm              96 Nov  7 08:42 myDir/&lt;BR /&gt;&lt;BR /&gt;&amp;gt; chmod 777 myDir&lt;BR /&gt;chmod: can't change myDir: Not owner&lt;BR /&gt;&lt;BR /&gt;&amp;gt; myChmod 777 myDir&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ls -ld myDir     &lt;BR /&gt;drwxrwxrwx   2 avinokur   pm              96 Nov  7 08:42 myDir/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;====================================&lt;BR /&gt;Now, I would like to do something like (for any user)&lt;BR /&gt;int main ()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;  ...&lt;BR /&gt;  system ("./myChmod 0777 ./myDir/);&lt;BR /&gt;&lt;BR /&gt;  ...&lt;BR /&gt;&lt;BR /&gt;  return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Nov 2010 06:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709234#M659755</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-07T06:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709235#M659756</link>
      <description>Hi Alex:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Actually, the only thing I need is to give another process to change mode of some directory.&lt;BR /&gt;&lt;BR /&gt;Then you need to create an executable that is owned by 'root' and has its setuid set.  You don't need the setgid bit, though.  The permissions will look like:&lt;BR /&gt;&lt;BR /&gt;-r-sr-xr-x 1 root sys &lt;BR /&gt;&lt;BR /&gt;That is, 4555&lt;BR /&gt;&lt;BR /&gt;Instead of calling 'system(3S)' in your executable, simply call 'chmod(2)' to do the work.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 07 Nov 2010 11:46:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709235#M659756</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-07T11:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709236#M659757</link>
      <description>The problem with the "myChmod approach" is that any user that is able to execute it will also be able to get root access on the system, by using it on password files. The chmod command is not designed to be setuid: if you give it setuid root permissions, you'll be creating an unlimited master key that can bypass *all* the security in your system.&lt;BR /&gt;&lt;BR /&gt;If at all possible, you should avoid setting up setuid-root programs. Perhaps you could create a group, add the users of your application to that group and then make myDir writable by that group only?&lt;BR /&gt;&lt;BR /&gt;But if you absolutely must have your program change the permissions on a directory it does not own, make a small program "chmodMydir" and make it setuid root.&lt;BR /&gt;&lt;BR /&gt;You should design to be as secure as possible, and to do exactly one thing and nothing else: to change the permissions of the specific directory your application needs.&lt;BR /&gt;&lt;BR /&gt;The chmodMydir program should open() the desired directory for reading, then _while holding the opened file descriptor_, it should use fstat() to verify the real name of the directory and that it really is the directory your application needs, not something nasty like a symbolic link to a critical system directory. &lt;BR /&gt;&lt;BR /&gt;If the directory passes the checks, use the fchmod() function on the file descriptor to change the permissions directly within your program.&lt;BR /&gt;&lt;BR /&gt;(The purpose of holding the file descriptor while making the checks is to protect your chmodMydir from race conditions. A malicious user might make chmodMydir run on a symbolic link, then change where the link is pointing to while chmodMydir is running. Holding the file descriptor ensures both the checks and the fchmod() will be operating on the same object, no matter what happens in between.) &lt;BR /&gt;&lt;BR /&gt;The chmodMydir program should check the return code of all the system calls it makes. If there is an error, it should output a descriptive error message (perhaps using perror() or strerror(errno)), and then exit.&lt;BR /&gt;&lt;BR /&gt;It would be best if the chmodMydir program would not have to accept any input from the user directly: a hardcoded directory name would be safest. Reading the directory name from a configuration file that is writeable only by root might also be acceptable *if* you clearly document that the permissions of that configuration file will be critical for system security. If you need to accept the directory name from the command line or from an environment variable, be *extremely* careful in the checking phase.&lt;BR /&gt;&lt;BR /&gt;You should assume any external data can be tampered with in order to overflow the buffers in your program, so use appropriate functions to limit the amount of data you're reading (e.g. use fgets() or strncpy() to read the directory name to your buffer, then make sure it's in fact null-terminated).&lt;BR /&gt;&lt;BR /&gt;With at least these precautions, it *might* be reasonably safe to give your chownMydir program setuid-root permissions. (I'm sure I've forgotten something important: please don't blindly trust me.)&lt;BR /&gt;&lt;BR /&gt;Google for "writing setuid programs" to find lots of other advice for making a program secure enough for setuid-root use.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Sun, 07 Nov 2010 12:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709236#M659757</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-11-07T12:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709237#M659758</link>
      <description>&amp;gt;/etc/dld.sl.conf: No such file or directory&lt;BR /&gt;&lt;BR /&gt;Then you need to create that file.&lt;BR /&gt;Also, if all you want is chmod(2), why do you need libicuuc.sl.34?</description>
      <pubDate>Sun, 07 Nov 2010 19:27:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709237#M659758</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-07T19:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SUID bit in executable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709238#M659759</link>
      <description>A lot of thanks to everyone.</description>
      <pubDate>Tue, 09 Nov 2010 06:38:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-suid-bit-in-executable/m-p/4709238#M659759</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-09T06:38:54Z</dc:date>
    </item>
  </channel>
</rss>

