Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot open file problem 1

Status
Not open for further replies.

vlz

IS-IT--Management
Aug 11, 2002
56
0
0
IL
Hi,
I use this operator in my ksh script:

cat << EOF > /tmp/allowed_fs_file
^/[^/]*usr
^/[^/]*user
^/[^/]*home
EOF

But from time to time I get the following error
message while running this script:
/tmp/sh<some_number>: cannot open

I check that /tmp has enough disk space.
The problem is that this problem is not persistent.
I get it also on different OS & OS versions,
like HP-UX 11.11 & 11.23(itanium) and Solaris 9
Please assist.

Thanks in advance,
Vadim
 
Check the permissions on /tmp, should be drwxrwxrwxt

rwx for everyone plus the sticky bit.

www.uwsg.iu.edu said:
...
When the sticky bit (t) is turned on for a directory users can have read and/or write permissions for that directory, but they can only remove or rename files that they own.
...


HTH,

p5wizard
 
Does this happen after the box has rebooted - I know /tmp gets cleared by default when Solaris reboots.

I want to be good, is that not enough?
 
1. the permissions are Ok.
2. we don't run this script after reboot
 
You might want to check for old /tmp/shNNNNN files that were left - normally these files only live for as long as the shell script needs the here-document, and the files should be deleted automatically.

If they stick around, an old file by userX might hinder userY if by chance the same number is generated for the filename.


HTH,

p5wizard
 
A work around:
echo "\
^/[^/]*usr
^/[^/]*user
^/[^/]*home" > /tmp/allowed_fs_file

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I don't have any /tmp/shNNNNN files.
I'll try solution sended by PHV.

Thanks everybody for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top