<?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: Trouble understanding umask and permissions on new files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280108#M882004</link>
    <description>Hey Paul,&lt;BR /&gt;Thought I'd try to do a little explanation of file permissions. Each digit corresponds&lt;BR /&gt;to the permissions for user, group, and other ... respectively.&lt;BR /&gt;&lt;BR /&gt;The umask is subtracted from 777 / 666 to give the permission set.&lt;BR /&gt;&lt;BR /&gt;So, since you have a umask 022, 666-022 leaves 644 (rw-r--r--). As r=4, w=2, x=1,&lt;BR /&gt;644 is user rw- (4+2) group r-- (4) others r-- (4).&lt;BR /&gt;&lt;BR /&gt;Hope this adds some clarity.</description>
    <pubDate>Tue, 18 May 2004 18:45:30 GMT</pubDate>
    <dc:creator>Dani Seely</dc:creator>
    <dc:date>2004-05-18T18:45:30Z</dc:date>
    <item>
      <title>Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280101#M881997</link>
      <description>When I login to my HP-UX 10.20 server, "umask" returns a value of 022 (umask -S returns u=rwx,g=rx,o=rx). Therefore, I would expect that when I create a new file using vi, the permission would be -rwxr-xr-x&lt;BR /&gt; However, when I create a file with vi it has the permission -rw-r--r--&lt;BR /&gt; I thought I understood permissions and umask but obviously there is something I'm missing.</description>
      <pubDate>Tue, 18 May 2004 16:11:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280101#M881997</guid>
      <dc:creator>Paul Neralich</dc:creator>
      <dc:date>2004-05-18T16:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280102#M881998</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It is for the creation of the files and the setting of execution bit is to be done seperately using "chmod" command. With the umask 022, the files get 'created' with the permissions -rw-r--r--.&lt;BR /&gt;&lt;BR /&gt;You don't have much choice there.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 18 May 2004 16:18:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280102#M881998</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-05-18T16:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280103#M881999</link>
      <description>umask only masks the default file and directory permissions&lt;BR /&gt;&lt;BR /&gt;default file permission: -rw-rw-rw&lt;BR /&gt;default dir permission: -rwxrwxrwx&lt;BR /&gt;&lt;BR /&gt;if you apply umkas of 022&lt;BR /&gt;&lt;BR /&gt;access permissions of the new file created would ne = 666 - 022 = 644 (rw-r--r--)&lt;BR /&gt;&lt;BR /&gt;for dirs = 777 - 022 = 755 (rwxr-xr-x)</description>
      <pubDate>Tue, 18 May 2004 16:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280103#M881999</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-05-18T16:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280104#M882000</link>
      <description>The "something" is the default mode of the file. In the shell, the default mode of a regular file is 666 and that of a directory is 777. Umask then "subtracts" (not quite an accurate term but close enough for this) from this default mode. If you need to set an executable bit from a shell created file, you must issue an explicit chmod after first creating the file.&lt;BR /&gt;&lt;BR /&gt;If you are developing in C, for example, both the open() and creat() system calls allow you to creat a file with whatever mode you wish in one step.&lt;BR /&gt;</description>
      <pubDate>Tue, 18 May 2004 16:20:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280104#M882000</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-05-18T16:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280105#M882001</link>
      <description>when setting the permissions for a new file, umask works in conjunction with the file creation mask.  unix utilities use a file creation mask of rw-rw-rw-.  then using your umask of 022, gives final permissions of rw-r--r--.&lt;BR /&gt;&lt;BR /&gt;by default when creating a file you have to do a chmod to make the file executable. just safer to do things that way.</description>
      <pubDate>Tue, 18 May 2004 16:28:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280105#M882001</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-05-18T16:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280106#M882002</link>
      <description>Thanks guys, I got exactly what I needed.&lt;BR /&gt;&lt;BR /&gt;- Paul N.</description>
      <pubDate>Tue, 18 May 2004 16:53:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280106#M882002</guid>
      <dc:creator>Paul Neralich</dc:creator>
      <dc:date>2004-05-18T16:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280107#M882003</link>
      <description>Hello Paul,&lt;BR /&gt;When you have "umask 022" in your startup file (.cshrc or .profile) you will get file permissions of 644 instead of 755.  This is a security "feature".  Under modern UNIX versions, umask cannot be used to set execute permissions on files, only directories, where execute is&lt;BR /&gt;synonymous with "searchable".&lt;BR /&gt;&lt;BR /&gt;With "umask 022" I see people believing that the "default permission" is 777. They are wrong.  777 is "global" read, write, and execute permissions, something you do not generally want to happen.  Thus the need to chmod the file to make it executable.</description>
      <pubDate>Tue, 18 May 2004 18:35:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280107#M882003</guid>
      <dc:creator>Dani Seely</dc:creator>
      <dc:date>2004-05-18T18:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble understanding umask and permissions on new files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280108#M882004</link>
      <description>Hey Paul,&lt;BR /&gt;Thought I'd try to do a little explanation of file permissions. Each digit corresponds&lt;BR /&gt;to the permissions for user, group, and other ... respectively.&lt;BR /&gt;&lt;BR /&gt;The umask is subtracted from 777 / 666 to give the permission set.&lt;BR /&gt;&lt;BR /&gt;So, since you have a umask 022, 666-022 leaves 644 (rw-r--r--). As r=4, w=2, x=1,&lt;BR /&gt;644 is user rw- (4+2) group r-- (4) others r-- (4).&lt;BR /&gt;&lt;BR /&gt;Hope this adds some clarity.</description>
      <pubDate>Tue, 18 May 2004 18:45:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trouble-understanding-umask-and-permissions-on-new-files/m-p/3280108#M882004</guid>
      <dc:creator>Dani Seely</dc:creator>
      <dc:date>2004-05-18T18:45:30Z</dc:date>
    </item>
  </channel>
</rss>

