Operating System - HP-UX
1848284 Members
5763 Online
104024 Solutions
New Discussion

Re: mkdir permission problems

 
eric stewart_1
Occasional Contributor

mkdir permission problems

Here are commands I executed on HP 10.20.
When the directories do not exist the new ones get the correct permissions. When one already exists the new ones do not get the correct permisions.
Is there a fix that I can not find or is this a bug or is it that I misunderstand what I am seeing?
Why are the permissions 777 when the 1st directory exists?

/tmp
>umask
022
/tmp
>mkdir 1 11 111
/tmp
>ls -ld 1 11 111
drwxr-xr-x 2 estewar1 users 96 Jun 26 09:33 1
drwxr-xr-x 2 estewar1 users 96 Jun 26 09:33 11
drwxr-xr-x 2 estewar1 users 96 Jun 26 09:33 111
/tmp
>rmdir 11 111
/tmp
>mkdir 1 11 111
mkdir: cannot create 1: File exists
/tmp
>r ls
ls -ld 1 11 111
drwxr-xr-x 2 estewar1 users 96 Jun 26 09:33 1
drwxrwxrwx 2 estewar1 users 96 Jun 26 09:33 11
drwxrwxrwx 2 estewar1 users 96 Jun 26 09:33 111
/tmp
>
4 REPLIES 4
Andreas Voss
Honored Contributor

Re: mkdir permission problems

Hi,

i've done the same on 10.20 and 11.00 and got the same results.
Looks like you have found a bug in mkdir.

Regards
John Palmer
Honored Contributor

Re: mkdir permission problems

Looks like a bug to me 11.00 still has the same problem.

You can get around it by specifying the required mask with the -m argument e.g.

mkdir -m 755 1 11 111
rainer doelker
Valued Contributor

Re: mkdir permission problems

Eric,

hp has got an ChangeRequest (CR) for it: JAGad49043

I could not jet find the patch related to it. I'll post if I found the patch.

rainer
A. Clay Stephenson
Acclaimed Contributor

Re: mkdir permission problems

Hi Eric,

Looks like you have found a real bug in mkdir.
It does the same thing in 10.20,11.0, and 11i.
The only workaround I've found is to add the -m 755 option to mkdir to force creation with the desired mode.

Regards, Clay
If it ain't broke, I can fix that.