<?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: umask in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924383#M286503</link>
    <description>Raj,&lt;BR /&gt;&lt;BR /&gt;Sorry, but NO.  666 - 022 = 644 which = -rw-r--r-- (try it and see!)&lt;BR /&gt;&lt;BR /&gt;The numerical notations are:&lt;BR /&gt;&lt;BR /&gt;(r)ead = 4&lt;BR /&gt;(w)rite = 2&lt;BR /&gt;e(x)ecute = 1&lt;BR /&gt;&lt;BR /&gt;This is the same for user/owner, group and other/world.&lt;BR /&gt;&lt;BR /&gt;So rwxrwxrwx = 421 421 421 = 777 (if you add each triplet together).&lt;BR /&gt;&lt;BR /&gt;With the chmod command you can use 'chmod 755 file' or 'chmod u=rwx,go=rx file' to grant rwxr-xr-x permissions to a file.  u=user (or owner), g=group and o=other (or world).  The chmod man page explains this.  (I know you didn't ask about chmod, but I'm hoping this will help you understand.)</description>
    <pubDate>Thu, 11 Jan 2007 22:57:50 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2007-01-11T22:57:50Z</dc:date>
    <item>
      <title>umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924376#M286496</link>
      <description>How to read the umask setting like 022,027,0002 and 0113. Please explain the umask setting in the following format or any other easy way.&lt;BR /&gt;rwx--x-wx</description>
      <pubDate>Thu, 11 Jan 2007 01:34:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924376#M286496</guid>
      <dc:creator>Macho_2</dc:creator>
      <dc:date>2007-01-11T01:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924377#M286497</link>
      <description>This may be useful - &lt;A href="http://en.wikipedia.org/wiki/Umask" target="_blank"&gt;http://en.wikipedia.org/wiki/Umask&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Thu, 11 Jan 2007 02:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924377#M286497</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2007-01-11T02:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924378#M286498</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sample use "umask".&lt;BR /&gt;&lt;BR /&gt;$ umask 077&lt;BR /&gt;$ umask --&amp;gt; 077&lt;BR /&gt;$ umask -S --&amp;gt; u=rwx,g=,o=&lt;BR /&gt;&lt;BR /&gt;$ man umask&lt;BR /&gt;&lt;BR /&gt;rgs,&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 02:35:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924378#M286498</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2007-01-11T02:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924379#M286499</link>
      <description>try this one:&lt;BR /&gt;cd /tmp&lt;BR /&gt;mkdir fun_umask&lt;BR /&gt;cd fun_umask&lt;BR /&gt;umask 022&lt;BR /&gt;touch file_with_022&lt;BR /&gt;ls -l file_with_022&lt;BR /&gt;&lt;BR /&gt;grep umask /etc/profile&lt;BR /&gt;&lt;BR /&gt;what is your systems default umask ?&lt;BR /&gt;&lt;BR /&gt;now try this one:&lt;BR /&gt;&lt;BR /&gt;umask 0&lt;BR /&gt;touch file_with_000&lt;BR /&gt;ls -l file_with_000&lt;BR /&gt;&lt;BR /&gt;why did HP-UX provide the default umask settings ?  A well known security hole, that's why..&lt;BR /&gt;&lt;BR /&gt;the "touch" command provides a simple method of calling the system call function: creat().. using the umask(1) setting from the parent shell.&lt;BR /&gt;&lt;BR /&gt;let me know if you need more lessons here..&lt;BR /&gt;&lt;BR /&gt;best of luck and of couse we expect points, right :-)&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 22:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924379#M286499</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2007-01-11T22:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924380#M286500</link>
      <description>First, you must remember the default modes used to create files and directories.  The default permissions for a file are -rw-rw-rw- (666) and directories drwxrwxrwx (777).&lt;BR /&gt;&lt;BR /&gt;Now the umask "subtracts" (kinda sorta, but not really, but enough for this explanation) the umask bits from the default permissions.&lt;BR /&gt;&lt;BR /&gt;So:&lt;BR /&gt;&lt;BR /&gt;Example 1:&lt;BR /&gt;&lt;BR /&gt;umask = 022&lt;BR /&gt;&lt;BR /&gt;You create a file:&lt;BR /&gt;&lt;BR /&gt;default perms 666 minus umask 022 = permissions on file of 644 (-rw-r--r--).&lt;BR /&gt;&lt;BR /&gt;You create a directory:&lt;BR /&gt;&lt;BR /&gt;default perms 777 minus umask 022 = permissions of 755 (drwxr-xr-x)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Example 2:&lt;BR /&gt;&lt;BR /&gt;umask = 027&lt;BR /&gt;&lt;BR /&gt;You create a file:&lt;BR /&gt;666 - 027 = 640 (-rw-r-----)&lt;BR /&gt;&lt;BR /&gt;Create a dir:&lt;BR /&gt;&lt;BR /&gt;777 - 027 = 750 (drwxr-x---)&lt;BR /&gt;&lt;BR /&gt;If the umask has 4 digits, you can drop the leading 0 (as long as its a 0).&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 22:42:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924380#M286500</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-01-11T22:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924381#M286501</link>
      <description>Macho,&lt;BR /&gt;&lt;BR /&gt;For example you have umask set to 022, so when a file is created by default it gets (666-022) permission i.e 642 .&lt;BR /&gt;&lt;BR /&gt;if you hav umask set to 000 , so the default file permission will be 666-000 = 666 &lt;BR /&gt;&lt;BR /&gt;umask on file and directory differs,&lt;BR /&gt;&lt;BR /&gt;for&lt;BR /&gt;file = (666-umask value)&lt;BR /&gt;dir  = (777-umask value)&lt;BR /&gt;&lt;BR /&gt;Now the number convention to rwx &lt;BR /&gt;   &lt;BR /&gt;       r     w     x&lt;BR /&gt;Owner: 400  200    100&lt;BR /&gt;Group: 40   20     10&lt;BR /&gt;Other: 4    2      1&lt;BR /&gt;-------------------------&lt;BR /&gt;&lt;BR /&gt;So Umask 022 will provide default file creation permission to ( 666-022) = 644 &lt;BR /&gt;i.e  -rw-rw----  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this will help,&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Raj.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 22:42:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924381#M286501</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-11T22:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924382#M286502</link>
      <description>Macho,&lt;BR /&gt;&lt;BR /&gt;7 7 7&lt;BR /&gt;111 111 111&lt;BR /&gt;&lt;BR /&gt;rwx  rwx  rwx&lt;BR /&gt;&lt;BR /&gt;chmod 777 myfile&lt;BR /&gt;&lt;BR /&gt;: provides mode 777&lt;BR /&gt;&lt;BR /&gt;this assumes your umask is set to ZERO or 000&lt;BR /&gt;&lt;BR /&gt;umask 000&lt;BR /&gt;touch myfile&lt;BR /&gt;ls -l myfile&lt;BR /&gt;&lt;BR /&gt;mode of file is 777 or rwx-rwx-rwx&lt;BR /&gt;&lt;BR /&gt;x = 1&lt;BR /&gt;w = 2&lt;BR /&gt;r = 4&lt;BR /&gt;=====&lt;BR /&gt;     7&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 22:57:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924382#M286502</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2007-01-11T22:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924383#M286503</link>
      <description>Raj,&lt;BR /&gt;&lt;BR /&gt;Sorry, but NO.  666 - 022 = 644 which = -rw-r--r-- (try it and see!)&lt;BR /&gt;&lt;BR /&gt;The numerical notations are:&lt;BR /&gt;&lt;BR /&gt;(r)ead = 4&lt;BR /&gt;(w)rite = 2&lt;BR /&gt;e(x)ecute = 1&lt;BR /&gt;&lt;BR /&gt;This is the same for user/owner, group and other/world.&lt;BR /&gt;&lt;BR /&gt;So rwxrwxrwx = 421 421 421 = 777 (if you add each triplet together).&lt;BR /&gt;&lt;BR /&gt;With the chmod command you can use 'chmod 755 file' or 'chmod u=rwx,go=rx file' to grant rwxr-xr-x permissions to a file.  u=user (or owner), g=group and o=other (or world).  The chmod man page explains this.  (I know you didn't ask about chmod, but I'm hoping this will help you understand.)</description>
      <pubDate>Thu, 11 Jan 2007 22:57:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924383#M286503</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-01-11T22:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924384#M286504</link>
      <description>Macho, back to my math lesson..&lt;BR /&gt;&lt;BR /&gt;if you have mode:&lt;BR /&gt;&lt;BR /&gt;7 7 7&lt;BR /&gt;&lt;BR /&gt;and umask is set (set to &amp;gt; 000), then you subtract.&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;$ umask 022&lt;BR /&gt;&lt;BR /&gt;math:&lt;BR /&gt;7 7 7&lt;BR /&gt;-&lt;BR /&gt;0 2 2&lt;BR /&gt;=====&lt;BR /&gt;&lt;BR /&gt;well, the first 0 value might be interesting here.. what result do you get ?&lt;BR /&gt;&lt;BR /&gt;try this one:&lt;BR /&gt;&lt;BR /&gt;umask 022&lt;BR /&gt;touch file_junk&lt;BR /&gt;ls -l file_junk&lt;BR /&gt;&lt;BR /&gt;do you get:&lt;BR /&gt;rwx-rx-rx&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;766&lt;BR /&gt;&lt;BR /&gt;given: rwx = 7&lt;BR /&gt;rx = 5 (r=4 + x=1) = 5&lt;BR /&gt;&lt;BR /&gt;again: rwx is simply the math of:&lt;BR /&gt;   r = 4&lt;BR /&gt;   w = 2&lt;BR /&gt;   x = 1&lt;BR /&gt;   =====&lt;BR /&gt;total  7&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jan 2007 23:08:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924384#M286504</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2007-01-11T23:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924385#M286505</link>
      <description>sorry, my math is a little off&lt;BR /&gt;&lt;BR /&gt;umask 0&lt;BR /&gt;touch file&lt;BR /&gt;mode is 7 7 7&lt;BR /&gt;or&lt;BR /&gt;       rwx rwx rwx&lt;BR /&gt;&lt;BR /&gt;umask 022&lt;BR /&gt;touch file2&lt;BR /&gt;mode is 755    &amp;lt;--- note 755&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;      rwx  r x  r x&lt;BR /&gt;not group write, not others write&lt;BR /&gt;&lt;BR /&gt;best of luck and thanks for being a member here !!</description>
      <pubDate>Thu, 11 Jan 2007 23:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924385#M286505</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2007-01-11T23:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924386#M286506</link>
      <description>Patrick, &lt;BR /&gt;Thanks for correcting , I mean that only &lt;BR /&gt;= -rw-r--r--   ,  but in a hurry i made the mistake.&lt;BR /&gt;&lt;BR /&gt;644 is = -rw-r--r-- i.e [ ( 400+200+0) + (40+0+0) + (4+0+0) ] so it comes 644.&lt;BR /&gt;&lt;BR /&gt;thx ,&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 11 Jan 2007 23:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924386#M286506</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-11T23:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924387#M286507</link>
      <description>Macho,&lt;BR /&gt;&lt;BR /&gt;Also dont forget to check this out,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cactus2000.de/uk/unit/massunx.shtml" target="_blank"&gt;http://www.cactus2000.de/uk/unit/massunx.shtml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Raj.</description>
      <pubDate>Fri, 12 Jan 2007 00:08:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924387#M286507</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-12T00:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924388#M286508</link>
      <description>Dear All;&lt;BR /&gt;&lt;BR /&gt;Thanks for all your help.</description>
      <pubDate>Fri, 12 Jan 2007 01:25:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924388#M286508</guid>
      <dc:creator>Macho_2</dc:creator>
      <dc:date>2007-01-12T01:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924389#M286509</link>
      <description>Hi,&lt;BR /&gt;umask value has been subtracted (octal value for group user, group other) by the 666 for file file/777 for directory value, so:&lt;BR /&gt;&lt;BR /&gt;# Permissions&lt;BR /&gt;# umask (file/directory)&lt;BR /&gt;------ -------------------&lt;BR /&gt;   000 rw-rw-rw-/rwxrwxrwx  &lt;BR /&gt;   002 rw-rw-r--/rwxrwxr-x&lt;BR /&gt;   022 rw-r--r--/rwxr-xr-x&lt;BR /&gt;   027 rw-r-----/rwxr-x---&lt;BR /&gt;   077 rw-------/rwx------&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 12 Jan 2007 08:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924389#M286509</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-01-12T08:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924390#M286510</link>
      <description>Macho,&lt;BR /&gt;&lt;BR /&gt;"I have assigned points to   26  of   38  responses to my questions. " &lt;BR /&gt;&lt;BR /&gt;That means you have not assigned points to 12 replies of those who replied to your thread.&lt;BR /&gt;&lt;BR /&gt;I suggest you to make it 38/38 , to stay in touch with this forum with great responses, and giving value of the posts those who are using their time and trying to help.&lt;BR /&gt;&lt;BR /&gt;Also check out the link:&lt;BR /&gt;&lt;A href="http://66.34.90.71/ITRCForumsEtiquette/" target="_blank"&gt;http://66.34.90.71/ITRCForumsEtiquette/&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 09:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924390#M286510</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-12T09:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: umask</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924391#M286511</link>
      <description>&amp;gt;Patrick: Now the umask "subtracts" (kinda sorta&lt;BR /&gt;&lt;BR /&gt;The correct C expression is:&lt;BR /&gt;   int umask = 022;&lt;BR /&gt;   int perm  = 0666;&lt;BR /&gt;   int result_perm = perm &amp;amp; ~umask;&lt;BR /&gt;&lt;BR /&gt;(It is AND Complement.)&lt;BR /&gt;&lt;BR /&gt;Or in a real shell:&lt;BR /&gt;$ typeset -i8 um=8#22 perm=8#666; echo $um $perm&lt;BR /&gt;8#22 8#666&lt;BR /&gt;$ typeset -i8 final_perm&lt;BR /&gt;$ (( final_perm = perm &amp;amp; ~ um ))&lt;BR /&gt;$ echo $final_perm&lt;BR /&gt;8#644</description>
      <pubDate>Sat, 13 Jan 2007 00:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/umask/m-p/3924391#M286511</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-01-13T00:00:09Z</dc:date>
    </item>
  </channel>
</rss>

