Arni,

Concerning the file locking.

The lock provided in Perl is a co-operative locking. With that I mean
that if all applications adhere to the locking policy and implements the
lock over the protected object, then it is safe.

OTOH, any other application (Perl or whatever) may just ignore the
locking policy.

To make it *really* safe, you would need to use a file lock mechanism
implemented in either the operating system or (more likely) in the file
system driver.

Conclusion: If you have control of all systems requesting the protected
resource, then you're OK.

Regards
Gustav


Arni Raghu wrote:
> 
> Hi,
> Tired of adding/deleting users manually..I am writing my own perl scripts to
> automate the tasks for me...this I do by directly writing to the passwd and
> shadow files...(because I do not want to use Expect in the perl code)..It
> works great and has eased my admin tasks  to an extent..
> 
> But one thing that bothers me is file locking...I use flock(of perl) to do
> the locking etc..very basic...though it works now, I am woried that I am not
> doing it the right way..can anybody explain the caveats of this approach..??
> and what precautions I need to take..
> 
> I would have posted this to the perl group but thought it is more
> appropriate here..Pls forgive if this is considered OT here..
> 
> Thx,
> Arni
> 
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.

-- 
JFK, assassination plot, sex, money laundering, blackmail, hacking,
security, encryption, bomb, CIA, NSA, KGB, Russia, Lockerbie, terrorism,
child abuse, drug dealing, espionage.

pgp = Pretty Good Privacy.

http://www.schaffter.com


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to