Re: Plexus

Tony Sanders ([email protected])
Wed, 04 Aug 1993 10:45:55 -0500


> Hello,
>
> you mentioned that if no one else does it, you would try to port
> Plexus to Solaris by the next version. Do you have any kind of time
> table, so I would know if there's any sense in me trying to look into
Plexus is done in my spare time.

> this? I'm not very fluent in these locking things, so it migh ttake
> time and the result may not be spectacular. Also, do you have any idea
Here is basically what you need to do; change all occurrences of flock(...)
to &seize(...) and then add something like this in site.pl

do 'fcntl.ph';
eval 'sub F_RDLCK {1;}' unless defined &F_RDLCK;
eval 'sub F_WRLCK {3;}' unless defined &F_WRLCK;
eval 'sub F_SETLKW {9;}' unless defined &F_SETLKW;
$s_flock = "ssllss"; # struct flock {type, whence, start, len, pid}

sub seize {
local($FH, $lock, $flock) = @_;
$flock = pack($s_flock,
($lock == &LOCK_SH ? &F_RDLCK : &F_WRLCK), 0, 0, 0, 0);
fcntl($FH, &F_SETLKW, $flock);
}

This code is untested so you will have to play around with it.

> why perl considers Plexus unsafe and refuses to use port 80?
You are running something like suidperl or taintperl.
Maybe you have Plexus suid root or something.

--sanders