<?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: setuid on directory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362504#M194342</link>
    <description>I have the same issue and one example that i have is i am both root and the normal user and a lot of my settings i keep in the normal users home folder and some times when i run programs as root, the files that are created (in the normal user's home folder) are only accessable by root and i would prefer to keep it so that the normal user is the owner. if this above situation were true (setuid retains owner when created in the folder) i could avoid this all together.</description>
    <pubDate>Wed, 09 May 2007 14:34:12 GMT</pubDate>
    <dc:creator>debug_1</dc:creator>
    <dc:date>2007-05-09T14:34:12Z</dc:date>
    <item>
      <title>setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362496#M194334</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to setuid on a directory so any files created in there with have the ownership of the directory owner. So I used the chmod u+s command but it doesn't seem to work. Any ideas, the chmod g+s does work.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Mike</description>
      <pubDate>Sat, 21 Aug 2004 12:47:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362496#M194334</guid>
      <dc:creator>Michael O'brien_1</dc:creator>
      <dc:date>2004-08-21T12:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362497#M194335</link>
      <description>Hi Mike,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unixpeople.com/HOWTO/advanced.permissions.and.ACLs.html" target="_blank"&gt;http://www.unixpeople.com/HOWTO/advanced.permissions.and.ACLs.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Since the sticky bit had no implied meaning with respect to a directory,&lt;BR /&gt;it was decided to make its meaning thus:&lt;BR /&gt;&lt;BR /&gt;When the sticky bit is set on a directory, the only people who can remove&lt;BR /&gt;files from that directory are:&lt;BR /&gt;1) root&lt;BR /&gt;2) the owner of the directory&lt;BR /&gt;3) the owner of the file to be removed&lt;BR /&gt;&lt;BR /&gt;So, the permissions on the /tmp directory are actually:&lt;BR /&gt;&lt;BR /&gt;drwxrwxrwt   7 sys      sys          463 Aug  3 22:20 /tmp&lt;BR /&gt;&lt;BR /&gt;The "t" represents the sticky bit.&lt;BR /&gt;&lt;BR /&gt;{set the sticky bit on the directory "testing"}&lt;BR /&gt;$ chmod o+t testing&lt;BR /&gt;&lt;BR /&gt;Can we set these bits using octal permissions?&lt;BR /&gt;&lt;BR /&gt;Sure. Even though the "ls -l" output shows us 9 bits of permissions, the &lt;BR /&gt;inode actually stores 12 bits. Even though the display embeds the setuid, &lt;BR /&gt;setgid, and sticky bits within the same 9 characters, they are actually&lt;BR /&gt;the most significant bits of the permissions and as such, can be represented&lt;BR /&gt;by an additional octal digit when using chmod.&lt;BR /&gt;&lt;BR /&gt;Example&lt;BR /&gt;-------&lt;BR /&gt;&lt;BR /&gt;To set the permissions on the tmp directory.&lt;BR /&gt;# chmod 1777 /tmp&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Sat, 21 Aug 2004 13:55:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362497#M194335</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-08-21T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362498#M194336</link>
      <description>Hi Robert-Jan,&lt;BR /&gt;&lt;BR /&gt;Thanks for your response, what I'm trying to achieve is to set setuid on the directory not the sticky bit. I would like any files created by any user to take the ownership of the directory our.&lt;BR /&gt;&lt;BR /&gt;If the directory "test" is owned by user A and user B creates a file in the directory. The file should be then be owned by user A. &lt;BR /&gt;&lt;BR /&gt;The command to achieve is &lt;BR /&gt;chmod u+s test&lt;BR /&gt;&lt;BR /&gt;I've set the setgid so any files created in the test directory have the group ownership of user A group. This was achieved using&lt;BR /&gt;&lt;BR /&gt;chmod g+s test&lt;BR /&gt;&lt;BR /&gt;But the setuid doesn;t seem to have an effect.&lt;BR /&gt;&lt;BR /&gt;I'll check out the link you sent me to see if that can shed any light on the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Mike</description>
      <pubDate>Sun, 22 Aug 2004 04:25:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362498#M194336</guid>
      <dc:creator>Michael O'brien_1</dc:creator>
      <dc:date>2004-08-22T04:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362499#M194337</link>
      <description>Hi Mike,&lt;BR /&gt;&lt;BR /&gt;Try this.&lt;BR /&gt;&lt;BR /&gt;# chmod 4755 your_directory&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Mon, 23 Aug 2004 02:41:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362499#M194337</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-08-23T02:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362500#M194338</link>
      <description>I don't believe the setuid bit on a directory works the same way as the the setgid bit does.  Do you have any documentation to the contrary, or are you extrapolating from the setgid bit?&lt;BR /&gt;&lt;BR /&gt;See the man page for 'creat(2)', which only refers to the effect of the setgid bit (this is on 11.11):&lt;BR /&gt;&lt;BR /&gt;      If the file exists, its length is truncated to 0, and its mode and&lt;BR /&gt;      owner are unchanged.  Otherwise, the file's owner ID is set to the&lt;BR /&gt;      effective user ID of the process.  If the set-group-ID bit of the&lt;BR /&gt;      parent directory is set, the file's group ID is set to the group ID of&lt;BR /&gt;      the parent directory.  Otherwise, the file's group ID is set to the&lt;BR /&gt;      process's effective group ID.&lt;BR /&gt;&lt;BR /&gt;(Regarding the chmod command, 'chmod u+s' and 'chmod 4755' have the same effect on the setuid bit.  It's the setuid bit itself that has no effect when a file is created.)</description>
      <pubDate>Mon, 23 Aug 2004 05:22:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362500#M194338</guid>
      <dc:creator>Andrew Merritt_2</dc:creator>
      <dc:date>2004-08-23T05:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362501#M194339</link>
      <description>Andrew/Robert Jan,&lt;BR /&gt;&lt;BR /&gt;thanks for your responses, maybe I misunderstood the use of setuid on directories. Maybe you can suggest a solution to my probelm. I would like to create a directory with write privledges to everybody but when they create files in the directory they are owned by myself. Any sugestions.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Mike</description>
      <pubDate>Mon, 23 Aug 2004 08:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362501#M194339</guid>
      <dc:creator>Michael O'brien_1</dc:creator>
      <dc:date>2004-08-23T08:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362502#M194340</link>
      <description>So, it sounds like you are familiar with setguid on a directory. Whereby setting the group bit to a sitcky bit will cause files created in a directory to get the group set to the group of the directory.&lt;BR /&gt;&lt;BR /&gt;But I don't believe that there is a bit you can set to get files created in a directory to be owned by the directory's owner.  &lt;BR /&gt;&lt;BR /&gt;In other words if a user creates a file, he/she owns that file and there's no way (that I know of) to set it so that the owner of the directory in which the file resides owns the newly created file.&lt;BR /&gt;&lt;BR /&gt;So, since you want to own the files that you create, you don't have to do anything, because that is the default behavior.</description>
      <pubDate>Mon, 23 Aug 2004 19:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362502#M194340</guid>
      <dc:creator>Eric Herberholz</dc:creator>
      <dc:date>2004-08-23T19:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362503#M194341</link>
      <description>There isn't a way to do what you want, if people are creating files using standard utilities.&lt;BR /&gt;&lt;BR /&gt;If it's an application that is creating the files when other people run it, then you could set the setuid bit on the program to do that (it's a little more complicated than just that, but that's the general idea).&lt;BR /&gt;&lt;BR /&gt;The other option would be to run a background job or cron job that periodically changes the owner of the files in that directory to be you.&lt;BR /&gt;&lt;BR /&gt;It partly depends on why you want the files to be owned by you, and how they are created, as to what might work.&lt;BR /&gt;&lt;BR /&gt;Andrew</description>
      <pubDate>Tue, 24 Aug 2004 03:56:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362503#M194341</guid>
      <dc:creator>Andrew Merritt_2</dc:creator>
      <dc:date>2004-08-24T03:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362504#M194342</link>
      <description>I have the same issue and one example that i have is i am both root and the normal user and a lot of my settings i keep in the normal users home folder and some times when i run programs as root, the files that are created (in the normal user's home folder) are only accessable by root and i would prefer to keep it so that the normal user is the owner. if this above situation were true (setuid retains owner when created in the folder) i could avoid this all together.</description>
      <pubDate>Wed, 09 May 2007 14:34:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362504#M194342</guid>
      <dc:creator>debug_1</dc:creator>
      <dc:date>2007-05-09T14:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: setuid on directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362505#M194343</link>
      <description>debug,&lt;BR /&gt;&lt;BR /&gt;Try some tests and see.&lt;BR /&gt;&lt;BR /&gt;I belive the set-gid bit is advisory, and not all applications may adhere to the advisory.&lt;BR /&gt;&lt;BR /&gt;-erich&lt;BR /&gt;</description>
      <pubDate>Wed, 09 May 2007 15:28:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-on-directory/m-p/3362505#M194343</guid>
      <dc:creator>Eric Herberholz</dc:creator>
      <dc:date>2007-05-09T15:28:39Z</dc:date>
    </item>
  </channel>
</rss>

