[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Thu Jan 23 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

428.0. "File owner uic question" by PADKOA::COSTEUX (Le Plat Pays qui est le mien...) Mon Apr 07 1997 15:17

    Is there a way to do so that files created in a directory (or
    subdirectory) get the Owner UIC of the process creating it and not the
    Owner either from the parent directory or subdirectory or from an already
    exsting file having the same name and same extension ?
    
    Thanks for help.
    
    Jean-Pierre
T.RTitleUserPersonal
Name
DateLines
428.1Sounds Like SYSPRV Is Enabled...XDELTA::HOFFMANSteve, OpenVMS EngineeringMon Apr 07 1997 15:3621
:    Is there a way to do so that files created in a directory (or
:    subdirectory) get the Owner UIC of the process creating it and not the
:    Owner either from the parent directory or subdirectory or from an already
:    exsting file having the same name and same extension ?

   Sure.  Turn off the privileges.  :-)

   Every file created gets the owner UIC of the file's creator, unless
   the owner has SYSPRV or similar heavy privilege enabled, when the
   file(s) will get the owner of the parent directory or the previous
   version.  (There's a flow-chart in the documentation showing the
   whole ownership process...)  Use an ACL to allow non-privileged
   access to the directory...

   If you want to make the files accessable by other users, please
   take a look at the documentation set -- there are several different
   situations where this might be of interest including a basic ACL,
   or situations sporting a "resource identifier" for shared scratch
   space...

428.2EPS::VANDENHEUVELHeinMon Apr 07 1997 16:2534
    
 >   Is there a way to do so that files created in a directory (or
 >   subdirectory) get the Owner UIC of the process creating it and not the
 >   Owner either from the parent directory or subdirectory or from an already
 >   exsting file having the same name and same extension ?
    
    Sure, by explicitly specifying the owner UIC either on the
    command line (CREATE/OWNER, COPY/OWNER,...) or inside
    the FDL used (CREATE/FDL, CONVERT/FDL,...) or within
    a program by providing an XABPRO.
    
    Ooops, COPY/OWNER seems such a 'natural' command, but it is not there!
    Bummer. It should have been there :-). I can only think of clumsy 
    workaround for that from DCL. Ugly stuff like creating a dummy version
    first with the right UIC, copying the proper version, and deleting 
    the dummy. Yuck. Untested:
    		$! p2 = Target name, p1 = Source
    		$crea/own='f$getjpi("","UIC")' 'p2'
    		$tmp_name = f$search(p2)
    		$out_name = f$elem(0,";",tmp_name) 	! Strip version
    		$copy/new 'p1' 'out_name'
    		$new_name = f$search(out_name)
    		$dele 'tmp_name				! Remove dummy
    		$rena 'out_name 'tmp_name		! All done ?!
    It would be much simpler to just copy the file getting the wrong
    owner and following the copy by explicitly setting the ownership:
    Untested:
    		$! p2 = Target name, p1 = Source
    		$out_name = f$parse(p2, p1,,, "SYNTAX_ONLY") ! Apply defaults
    		$copy 'p1' 'p2'
    		$set file/own='f$getjpi("","UIC")' 'out_name'
    
    hth,
    	Hein.
428.3AUSS::GARSONDECcharity Program OfficeTue Apr 08 1997 02:428
    re .2,.0
    
    Instead of the non-existent COPY/OWNER one can use BACKUP.
    
    In many cases it is highly desirable that the newly created file
    inherits ownership - that's why the feature was added - so if the
    replies here don't address your question, you had better elaborate on
    what you are trying to do.