----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

On Wed, 23 Feb 2000, Keith Ball wrote:

> Hi,
> 
> Ok so I can now excute commands, I am however having problems with
> ownership.  I can not clock in, or clock out files because I do not have
> have permission to write to them.  I use the "chown wwwrun *" command, and
> this gives me temporary release.  However it doesn't work when I check out
> the files and lock them, I get a permission denied message...
[snip]

With the applications which have been discussed so far, I'd suggest that
you look at solving the file ownership issue by running the JVM in manual
mode, as the appropriate user (rather than as nobody).  This would (IMO)
be better than sudo (ugg) or a setuid script (slightly less painful). 

When you can, it's much better (as others have mentioned) to avoid system
calls whenever possible (ie. if java.io.File does it, use that).  But
once in a while, that's not possible ... a while ago, I helped build a
page compilation system, and because the javac compiler calls
System.exit() when it's done, that's what we did.  (A nice side benifit
is that you can use jikes, which is far faster, if you want to.)

So far as the problems with sudo -- since it's intended to be a secure
program, it does certain checks.  The environment of the www user clearly
fails to satisfy those ... generally, the sudo's which I've used required
a password entry, and I'm not sure how you'd get around that (though it's
probably possible).  OTOH, it is possible to make a setuid program (either
a perl script or a compiled program) which will change to the appropriate
uid for you. I've usually found it easier to avoid this, however; most
tools try to avoid letting you have enough rope to hang yourself, which
can be annoying when that's what you want to do.

hth --

Ed
--
See you at ApacheCon 2000 in Orlanda, Florida, March 8-10, 2000.
                 http://www.Apachecon.com/




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to