Operating System - OpenVMS
1830204 Members
11480 Online
109999 Solutions
New Discussion

Create a new directory with sane security as another directory

 
SOLVED
Go to solution
Chaim Budnick
Regular Advisor

Create a new directory with sane security as another directory

How do I easily create a new directory with the same security settings as another directory in the same root directory?

Chaim
6 REPLIES 6
Willem Grooters
Honored Contributor
Solution

Re: Create a new directory with sane security as another directory

Chaim,

$ SET DEFAULT
$ OWN=f$FILE_ATTRIBUTES (".DIR","UIC")
$ PRO=f$FILE_ATTRIBUTES (".DIR","PRO")
$ CREATE/DIRECTORY/OWNER='OWN'/PROTECTION='PRO' .DIR
$ SET SECURITY/LIKE=.DIR .DIR

OWN and PRO can be found interactively by dir:
$ DIR/SEC /DIR

SET SECURITY is not required if old directory doesn't hold an ACL.

Willem
Willem Grooters
OpenVMS Developer & System Manager
Bojan Nemec
Honored Contributor

Re: Create a new directory with sane security as another directory

Chaim,

This command will copy all the security attributes (ACL,owner and protection).

$ SET SECURITY/COPY_ATTRIBUTE=ALL/LIKE=old.dir new.dir

If you have ACEs which have the nopropagate
attribute, you must enter them by hand, because they are not copied.

Bojan
Martin Vorlaender
Honored Contributor

Re: Create a new directory with sane security as another directory

Willem, Bojan,

a minor nit (that hits me as well all the time ;-)

The syntax is

$ SET SECURITY /LIKE=NAME=old new

cu,
Martin
Jan van den Ende
Honored Contributor

Re: Create a new directory with sane security as another directory

Martin,

maybe I will do even more 'nitting'.

$ SET SECURITY /LIKE=NAME=old new


Yes, that IS correct... at VMS V7.3 & up.

For older versions, use

$ SET SECURITY new /LIKE=OBJECT_NAME=old
( param new is not positional, may also appear at end of line)

I always thought it a very clumsy syntax, especially since /OBJECT_NAME was only unique at char #8, there is/was also a qualifier /OBJECT_TYPE

Cheers.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: Create a new directory with sane security as another directory

On pretty old systems we had to do:
$ set file /acl /like=

And on _really_ old systems we didn't have ACLs...
.
Dale A. Marcy
Trusted Contributor

Re: Create a new directory with sane security as another directory

You could also use backup:

$ backup disk:[parent_dir]old.dir disk:[parent_dir]new.dir/by_owner=original

Where parent_dir is either 000000 or the directory above the directory to be replicated.