1754303 Members
2945 Online
108813 Solutions
New Discussion юеВ

remsh/rcp umask issues

 
SOLVED
Go to solution
K. Lesperance
Advisor

remsh/rcp umask issues

Hi,

We're having an issue attempting to rcp a file from one system to another. When copying to any other system, the permissions are preserved, however, this one system keeps resetting them to 600 (source permissions are 644).

If we try a "remsh hostname -l userid "/usr/bin/umask", we're seeing the umask is set to 077, instead of 00.

We cannot figure out where this value is coming from. There is no umask setting in the user's .profile/.login (plus this seems to affect all users, not just specific ones), nor is there one in /etc/profile. umask is set to 022 in /sbin/rc. I've compared the umask setting in all of the scripts in /sbin/init.d/, and they are the same across working and non-working hosts.

Any help with this would be greatly appreciated. We're unable to simply use "rcp -p", as we have a compiled application with rcp hard-coded without the flag.

Thank you.
16 REPLIES 16
OldSchool
Honored Contributor

Re: remsh/rcp umask issues

does the file already exist on the destination server? if so, and without the "-p", the "new" file retains the permissions of the existing file:


"If the -p option is not specified, rcp preserves the mode and owner of dest_file if it already exists;"
Tingli
Esteemed Contributor

Re: remsh/rcp umask issues

How about have umask=022 in .profile?
OldSchool
Honored Contributor

Re: remsh/rcp umask issues

also, what shell does the user have on the destination server? OS on that server?
K. Lesperance
Advisor

Re: remsh/rcp umask issues

No, the file does not exist.

umask is not set in .profile/.login as I mentioned in my original post. Plus, those files should not be sourced by rcp, I don't think.

Source is HP-UX 11.11, Destination is 11.31. We're seeing this behaviour with /sbin/sh and /bin/ksh. I haven't looked into csh yet.

Thanks
Patrick Wallek
Honored Contributor

Re: remsh/rcp umask issues

Check /etc/inetd.conf and see if any of the r-services have an option to specify the umask used.

I don't have an 11.31 system handy so I can't test that theory.
Dennis Handly
Acclaimed Contributor

Re: remsh/rcp umask issues

>If we try a "remsh hostname -l userid "/usr/bin/umask", we're seeing the umask is set to 077, instead of 00.

remsh doesn't execute ~/.profile.

Have you looked in these rc scripts:
/sbin/init.d/clean_adm
/sbin/init.d/hppcifddi
/sbin/init.d/inetd
/sbin/init.d/kmbuild
/sbin/init.d/secsh
/sbin/init.d/syslogd
Suraj K Sankari
Honored Contributor

Re: remsh/rcp umask issues

Hi,

Yes remsh is not using .profile so in this case right a script which copy your file from source to destination and change the permission.

Suraj
K. Lesperance
Advisor

Re: remsh/rcp umask issues

Patrick,

There's nothing in inetd.conf that's setting a umask. /sbin/init.d/inetd sets umask to 000, however, this is the same on both the working and non-working systems.

Dennis,

What am I looking for with these scripts? As I mentioned earlier, the umask value for is the same on every script on both working and non-working systems.

Suraj,

Writing a script is not an answer. As I said, we have a program that is copying these files over, and we cannot modify it. Aside from that, I'd rather solve this than work around it.
Dennis Handly
Acclaimed Contributor

Re: remsh/rcp umask issues

>What am I looking for with these scripts? As I mentioned earlier, the umask value for is the same on every script on both working and non-working systems.

This at least gives the default or starting values. When I use remsh, my umask is 0.

If it is 77, there must be some other change.
What does your /etc/inetd.conf have for rlogin?