Solved

permissions for file written by script

Posted on 2004-10-09
4
247 Views
Last Modified: 2010-04-20
I'm trying to write a perl script to write a file that will be readable by a tomcat program.  The script is admin.pl in a cgi-bin directory of a domain and the file has owner fv88 and group psacln.  The file I'm trying to a file (home.jsp) in a subdir of the tomcat4 directory.  Files in that directory have the owner as root and group as tomcat4.

I've tried the following without success:
1. chmod home.jsp to 777.  This is a plesk server with umask of 022, and plesk doesn't like 777 (but I don't know if that matters here or not).
2. added fv88 to the tomcat4 group.

How can I configure things so the script admin.pl will overwrite home.jsp?

msibley
0
Comment
Question by:msibley
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
owensleftfoot earned 125 total points
ID: 12267740
The user that the script runs as will need write access to the directory  home.jsp is in.
0
 

Author Comment

by:msibley
ID: 12268506
Wouldn't either of 1 or 2 above have done that?  Do scripts run as a different user than the owner of the script file?
msibley
0
 

Author Comment

by:msibley
ID: 12268645
figured it out . . . it was a permissions problem in a directory up the tree.

Thanks anyway, I'll give you the pts.

msibley
0
 
LVL 1

Expert Comment

by:jeffparis
ID: 13701159
in php, I know I have to do this before chmodding:

            $o_umask = umask(0);
                  

And this after chmodding:
            umask($o_umask);


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iptables limit connection per ip correct way ? 2 84
linux pull logs and export FTP 4 58
CentOS 7 Installation 7 57
Linux haproxy: stop temporary haproxy service 9 34
In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now