Operating System - HP-UX
1834462 Members
2947 Online
110067 Solutions
New Discussion

Re: Permissions when a file is delivered.

 
SOLVED
Go to solution
Manuales
Super Advisor

Permissions when a file is delivered.

Hi,

There is a server "A" receiving a file from other system "B" and when the user delivers the information to the server "B", the information is left as follows
-rw-rw---- 1 userA system 3465 Nov 26 12:40 Information.txt

I need the information.txt file has the permissions as follows:
-rw-rw-rw-

what doi have to update into the profile to get this one?
10 REPLIES 10
Patrick Wallek
Honored Contributor
Solution

Re: Permissions when a file is delivered.

>>There is a server "A" receiving a file from
>>other system "B"

How is the file be sent from ServerB to ServerA?

The method used will determine the steps you need to take.
Manuales
Super Advisor

Re: Permissions when a file is delivered.

An application (SAP) generates the information and then that information is delivered into a path that is mounted from other server.
Patrick Wallek
Honored Contributor

Re: Permissions when a file is delivered.

>>that information is delivered into a path
>>that is mounted from other server.

Mounted how? Via NFS?

If it is NFS, then the process that creates the file needs to change the file permissions programmatically.

The other option would be to have a cron job periodically do a 'chmod 666 information.txt' to change the permissions.

However, I would question why the file needs to be rw by EVERYONE. This would effectively allow ANY USER to absolutely clobber the data in the file and render it utterly useless.

Manuales
Super Advisor

Re: Permissions when a file is delivered.

1.- Mounted how? Via NFS?
Yes, it is, via NFS

2.- If it is NFS, then the process that creates the file needs to change the file permissions programmatically.
is not there other way to do that? if i use umask command into profile user id?

2.- The other option would be to have a cron job periodically do a 'chmod 666 information.txt' to change the permissions.
OK ..

3.- However, I would question why the file needs to be rw by EVERYONE. This would effectively allow ANY USER to absolutely clobber the data in the file and render it utterly useless.
It is due there is other application (Tumbleweed) that is listening if there are files or not to be sent, but, if the file has the permissions -rw-rw---- (660) the file can not be listened by the daemon that is listening for files ... the file has to be permissions for strangers due the owner userid of Tumbleweed processes are not in the same group, so, when i changed to 666 or 466 Tumbleweed daemon process could listen and in that moment the file was sent immediatly ....

do you suggest me other thing?
do you know if i use umask userid into the profile of the user (owner of the information) it could work?
Dennis Handly
Acclaimed Contributor

Re: Permissions when a file is delivered.

>if i use umask userid into the profile of the user (owner of the information) it could work?

Yes, typically the umask controls the permission. You would set it to 0 to get 666.
But there would be security issues with other files created. Perhaps you only want to set it to 0 only when you run this application that creates the file?
Manuales
Super Advisor

Re: Permissions when a file is delivered.

i reviewed the file /etc/profile
=========================================
$ cat /etc/profile | grep umask
umask 022
=========================================

When the file was delivered,the permissions are:
660

if i update the .profile only of this user (userA), could i get 666 ? what numbers do i have to use after umask command? umask 000?

please let me know.
Patrick Wallek
Honored Contributor

Re: Permissions when a file is delivered.

>>f i update the .profile only of this user
>>(userA), could i get 666 ?

Maybe. Does someone actually login as this user to run the process that creates this file?

>>what numbers do i have to use after umask
>>command? umask 000?

Yes. 'umask 000' or 'umask 0' will give you the permissions you say you require.
OldSchool
Honored Contributor

Re: Permissions when a file is delivered.

umask 000 for the user that runs the process creating the file should do it. unless the SAP application "owns" the file, then the umask for SAP would have to change

listing the file to determine the owner will point you in the right direction i suppose. and that would be the user on serverA.....
OldSchool
Honored Contributor

Re: Permissions when a file is delivered.

you might also consider adding the tunbleweed to the "group" that can read the file.....
Manuales
Super Advisor

Re: Permissions when a file is delivered.

ok, thanks all for your suggests !!!!!

have a nice day.