How to disallow logout

Peter Pentchev roam at ringlet.net
Sat Sep 11 09:36:52 UTC 2010


On Fri, Sep 10, 2010 at 10:30:35PM -0400, jhell wrote:
> On 09/10/2010 22:21, jhell wrote:
> > On 09/09/2010 23:27, Aryeh Friedman wrote:
> >> I have a directory that must not exist on logout and rm -rf is not
> >> sufficent to do it because the contents need to be processed by our
> >> version control system.   The real life scenario is our version
> >> control system stores the repo for a given project encrypted but for
> >> techinical reasons it needs to keep the checkouted files in plain text
> >> (they are all in the same dir) and I want to *NEVER* have the plain
> >> text checkouted files in my dir when I logout, *BUT* instead of just
> >> deleting it I need to check them in...  so how do I make my .logout so
> >> if the file exists it will not exit and give a error saying that dir
> >> is still there? (minor but unimportant side effect of the version
> >> control system is the dir will have a different name everytime it is
> >> made but always the same prefix)
> >> _______________________________________________
> >> freebsd-hackers at freebsd.org mailing list
> >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
> > 
> > trap '/path/to/your_wrapper_script.HERE' 2
> > 
> 
> This should be:
> 
> trap '/path/to/script' EXIT
> 
> > Should execute the contents of that script on every logout. Whether that
> > script is a line by line action or a fully qualified script with
> > functions to call different actions are up to you.

...but, of course, that's only until people learn that they can bypass this
by something like 'kill -FPE $$'.

G'luck,
Peter

-- 
Peter Pentchev	roam at space.bg    roam at ringlet.net    roam at FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
If wishes were fishes, the antecedent of this conditional would be true.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20100911/37577d56/attachment.pgp


More information about the freebsd-hackers mailing list