<?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: rm vs. rm -f in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753145#M784359</link>
    <description>The ability to remove a file has nothing to do with the ownership of a file (with one exception I'll mention in a moment) but depends upon the permissions of the directory that houses the file. If a user has write permission on a directory, he can remove any file. That is why 777 directory permission is such a dangerous thing. The exception is if the sticky-bit (e.g instead of 777, the mode is 1777) is set then only the owner of a file can delete a file eventhough the directory permission would otherwise allow it. The permission to chmod or chown a file is determined solely by the owner of the file. Of course, a super-user is allowed unrestricted access for any of these tasks.</description>
    <pubDate>Thu, 16 Mar 2006 22:49:02 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2006-03-16T22:49:02Z</dc:date>
    <item>
      <title>rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753143#M784357</link>
      <description>Got what I think is a simple problem and I think I know the answer but it buffudles me why this works.&lt;BR /&gt;&lt;BR /&gt;I have an Oracle User Directory that is blown up 777. Files below that have permissions set to 644. Because of the directory setup any one can drop or files in and such. However my question is this. When a user attemptes to "rm" a file they get prompted to change mode to 644 but the file does not get removed unless they are the owner. However if they do an rm -f to the file it gets removed. Following the standard security that UX follows the strictist rule the file should not have been removed unless the owner or root did the removing of the file. Why is this permitted?&lt;BR /&gt;&lt;BR /&gt;It is a HP-UX 11i (11.11) current on all patches. My person belief is because the directory structure set to by the DBA as they are the owner of the sctructre is set to 777. It see's the removal of the file as a change to the directory when a force is given vs. a file change when just an rm is issued.&lt;BR /&gt;&lt;BR /&gt;Thanks for the info.&lt;BR /&gt;&lt;BR /&gt;-Al</description>
      <pubDate>Thu, 16 Mar 2006 21:43:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753143#M784357</guid>
      <dc:creator>Albert Smith_1</dc:creator>
      <dc:date>2006-03-16T21:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753144#M784358</link>
      <description>By default (not exactly, but you most probablely have alias rm=rm -i), rm will prompt before deleting a file. rm -f is forcefull, without prompt deletion of a file.&lt;BR /&gt;&lt;BR /&gt;The file perms do not matter, if dir has open perms to everyone.&lt;BR /&gt;&lt;BR /&gt;Check your alises.&lt;BR /&gt;alias</description>
      <pubDate>Thu, 16 Mar 2006 22:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753144#M784358</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-03-16T22:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753145#M784359</link>
      <description>The ability to remove a file has nothing to do with the ownership of a file (with one exception I'll mention in a moment) but depends upon the permissions of the directory that houses the file. If a user has write permission on a directory, he can remove any file. That is why 777 directory permission is such a dangerous thing. The exception is if the sticky-bit (e.g instead of 777, the mode is 1777) is set then only the owner of a file can delete a file eventhough the directory permission would otherwise allow it. The permission to chmod or chown a file is determined solely by the owner of the file. Of course, a super-user is allowed unrestricted access for any of these tasks.</description>
      <pubDate>Thu, 16 Mar 2006 22:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753145#M784359</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-16T22:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753146#M784360</link>
      <description>Hi Albert,&lt;BR /&gt;&lt;BR /&gt;Yes rm should be used by -i which will request confirmation  before removing each entry.&lt;BR /&gt;&lt;BR /&gt;If you have the directory permissions as 775 or 755 then other users other than the owner cannot delete files withtin the directory.&lt;BR /&gt;&lt;BR /&gt;And here is rm VS rm -f&lt;BR /&gt;The rm command removes the entries for one or more files from a directory. rm â  f (force option forces each file or directory to be removed without prompting for confirmation, regardless of the permissions of the entry.  This option also suppresses diagnostic messages regarding nonexistent operands.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IA&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Mar 2006 22:53:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753146#M784360</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2006-03-16T22:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753147#M784361</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;man rm says, &lt;BR /&gt;&lt;BR /&gt;   rm recognizes the following options:&lt;BR /&gt;&lt;BR /&gt;  -f   Force each file or directory to be removed without prompting for confirmation, regardless of the permissions of the entry.  This option also suppresses diagnostic messages regarding nonexistent operands.&lt;BR /&gt;&lt;BR /&gt;       This option does not suppress any diagnostic messages other than those regarding nonexistent operands.  To suppress all error message and interactive prompts, the -f option should be used while redirecting standard error output to /dev/null.&lt;BR /&gt;&lt;BR /&gt; This option ignores any previous occurrence of the -i option.&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 16 Mar 2006 23:03:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753147#M784361</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-03-16T23:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753148#M784362</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;rm - grace fule , asks for confirmation etc&lt;BR /&gt;&lt;BR /&gt;rm -f  -- fourecfull remove&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Siva.</description>
      <pubDate>Thu, 16 Mar 2006 23:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753148#M784362</guid>
      <dc:creator>Sivakumar TS</dc:creator>
      <dc:date>2006-03-16T23:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753149#M784363</link>
      <description>Difference rm vs rm -f&lt;BR /&gt;&lt;BR /&gt;a) i) rm will make diagnostic error messages when the file is not existing&lt;BR /&gt;    ii) rm -f will not make any error messages. It will redirect error messages to /dev/null&lt;BR /&gt;&lt;BR /&gt;b) i) While deletion of file, rm will check file permissions.&lt;BR /&gt;    ii) rm -f will not care about permission and will delete files&lt;BR /&gt;&lt;BR /&gt;rm -f will not care about confirmation. It is differing with rm -i here.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Mar 2006 00:02:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753149#M784363</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-03-17T00:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753150#M784364</link>
      <description>Albert,&lt;BR /&gt;the proof that delete priv comes from the directory:&lt;BR /&gt;mkdir /tmp/test&lt;BR /&gt;chmod 755 /tmp/test&lt;BR /&gt;cd /tmp/test&lt;BR /&gt;touch a&lt;BR /&gt;chmod 777 a&lt;BR /&gt;&lt;BR /&gt;Another user can now enter the /tmp/test dir, edit and update the file, but can not remove it.&lt;BR /&gt;From man rm:&lt;BR /&gt;"Removal of a file requires write and search (execute) permission in its directory, but no permissions on the file itself."&lt;BR /&gt;&lt;BR /&gt;Also the rm -f of a non-existent file is 0 (success), whereas rm of a non-existent file return 2(error).</description>
      <pubDate>Fri, 17 Mar 2006 02:50:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753150#M784364</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-03-17T02:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: rm vs. rm -f</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753151#M784365</link>
      <description>Thanks all you reassured me here. I figured that is what it was.&lt;BR /&gt;&lt;BR /&gt;I will be assigning points shortly.&lt;BR /&gt;&lt;BR /&gt;-Al</description>
      <pubDate>Fri, 17 Mar 2006 09:11:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-vs-rm-f/m-p/3753151#M784365</guid>
      <dc:creator>Albert Smith_1</dc:creator>
      <dc:date>2006-03-17T09:11:20Z</dc:date>
    </item>
  </channel>
</rss>

