Operating System - HP-UX
1834939 Members
2163 Online
110071 Solutions
New Discussion

Re: file permission issue

 
SOLVED
Go to solution
arun m govind
Frequent Advisor

file permission issue

hi,

in my hp-ux 11.11 system i set umask of a user as 000.but when i create a new file its permission become rw_rw_rw_.why?????umask is showing 00.???????
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: file permission issue

Shalom,

Arun umask works in a sort of counter-intuitive way.

umask 027
touch umask.027
umask 002
touch umask.002
umask 000
touch umask.000
ll
total 66
drwxr-xr-x 2 root sys 96 Aug 17 13:58 ./
drwxrwxrwx 8 bin bin 33792 Aug 17 13:58 ../
-rw-rw-rw- 1 root sys 0 Aug 17 13:58 umask.000
-rw-rw-r-- 1 root sys 0 Aug 17 13:58 umask.002
-rw-r----- 1 root sys 0 Aug 17 13:58 umask.027


Hope this helps.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pupil_1
Trusted Contributor

Re: file permission issue

Are you creating the file as that particular user? If there is reference of umask in the .profile of the user, then the /etc/profile will be overwritten !!

Please let us know how did you set umask for the user.
There is always something new to learn everyday !!
arun m govind
Frequent Advisor

Re: file permission issue

hi,

thaks for the replay.
when i move a file (rwxrwxrwx) to oter location how can i preserve the permission.
Yarek
Regular Advisor

Re: file permission issue

Try "cp -p"
Jaime Bolanos Rojas.
Honored Contributor

Re: file permission issue

Arun,

Tar will do the best job preserving the permissions.

Please take your time and asign points to people that help you out.

Regards,

Jaime.
Work hard when the need comes out.
arun m govind
Frequent Advisor

Re: file permission issue

hai

thanks to everybody

regards
arun m govind
Bill Hassell
Honored Contributor

Re: file permission issue

Files are always created with a permission of -rw-rw-rw. Therefore, umask 00 leaves the permissions as shown. Only a directory is created with -rwxrwxrwx. NOTE: 777 is a very bad permission for a file. If the file is not a script, then the file has no business having the execute bit set. And allowing a file to have world-writable permission means that the contents will be completely trashed by anyone on the computer.

777 is (wrongfully) used to solve permission problems and (sadly) documented in many beginner Unix books as a 'normal' permission. A 777 file should only be a junk file. All other files should be protected from the 'world' with 664 or 644 permission.


Bill Hassell, sysadmin