Operating System - HP-UX
1833777 Members
1968 Online
110063 Solutions
New Discussion

how to write to a directory which don't have the same owner and group

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how to write to a directory which don't have the same owner and group

Oracle user (grouped by dba) started a process, and wanted to write to a directory that is not owned by Oracle, and not grouped by dba. Is there any alternate way to write something to the directory without changing the ownership of the directory, and without changing the permission to "777"?

I tried to put Oracle in that same group of that directory as Oracle's 2nd groupship, but still doesn't work, since when the process is started, it uses it's primary group.

Please advice
Thanks!
none
4 REPLIES 4
john kingsley
Honored Contributor

Re: how to write to a directory which don't have the same owner and group

You can create an acl for the group you want to grant these permissions to:

To view acls:

getacl

To give acls to a specific group:

setacl -m g:dba:rwx

This will give group dba read-write-execute permissions to the directory without changing the group ownership of the directory.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: how to write to a directory which don't have the same owner and group

In order for multiple groups to work automatically, you need to create a link from /etc/group to /etc/logingroup

ln /etc/group /etc/logingroup
If it ain't broke, I can fix that.
Hanry Zhou
Super Advisor

Re: how to write to a directory which don't have the same owner and group

Here is the real case:

I have a directory listed as the following:

775 abc users dirname

the id "oracle" is withing "dba" group as shown in /etc/passwd file, it also belong to "users" group as shown "users:20:oracle" in /etc/group file.

My question, if it is possible that the process started by "oracle" can not write it's output to "dirname" directory? I believe "oracle" should be able to write to that directory, but, users are saying they can not, and they could not provide us any error messages. Please advice.
none
A. Clay Stephenson
Acclaimed Contributor

Re: how to write to a directory which don't have the same owner and group

This will work iff (if and only if) you link /etc/group and /etc/logingroup so that the chgrp is done automatically; otherwise, it would require an explicit chgrp command.
If it ain't broke, I can fix that.