Zsh Mailing List Archive
Messages sorted by:
Re: adding history logging "automagically" :)
- X-seq: zsh-workers 23669
- From: "Joe D" <joe.divola@xxxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: adding history logging "automagically" :)
- Date: Mon, 9 Jul 2007 21:27:54 -0400
- Cc: zsh-workers@xxxxxxxxxx
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=XTl8llwsuvPA8HI0DnMlQhvSVa30Bq/9OHk2mGUMvHv4zssDy8A+zGnnIVogPRrkiWd7z6hUv4WDDqvMOql+nfmZUIBAzHYTkGuUnX/LrNC/MontHLiTYvnI3Ef0WGpLsNezD1b+ZxGcjkwjHvW5aDmM+8mgs0DFOmOasOF0y7o=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=PMHau8+rfbUMjveT4PFco8eY6yHrPEu61wBR6jR9L/2t6kOJl2udV2Ox7xq9Ly+RnE+piOxFjx/gw2+ix9JRPXC8R67agaYpPgClvssrwLoI+tyV0rQ2bYjnlh1CwHwlX7kfX/ziCGwlvP7s5vPZvQncVOYnqj3ottrBmhhPi/w=
- In-reply-to: <070709174750.ZM11342@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3cb6e920707091041t3b3f5c1cy7d7b08e6028c22f9@xxxxxxxxxxxxxx> <070709174750.ZM11342@xxxxxxxxxxxxxxxxxxxxxx>
On 7/9/07, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Jul 9, 1:41pm, Joe D wrote:
} So in a nutshell, all I want to do is modify 'zsh' source
Ick. Don't do that.
If there's a way to 'hide' it from the regular users (sure, those more ambitious will figure it out, but not worried about them), then i'd do it.
I don't think you want SHARE_HISTORY - that means the shells pass the
current history around among themselves while they are running. You
don't really want Alice to see Bob's commands, do you?
Also I think APPEND_HISTORY is redundant with INC_APPEND_HISTORY, but
it probably won't hurt anything.
In any case you're going to be defeated here by a zsh security feature
that prevents the shell from using a history file that is owned and/or
writable by someone else. Each shell will try to assume ownership of
the file and remove group/other write permission, so there will be a
mad scramble of unlinking/recreating of the file as each shell notices
that one of the others has tried to grab it. That's probably why you
can't find the file even though you can find the lock.
The best you might be able to do is
so that every user has his or her own history file in some_location.
Beyond that, I suggest placing
if [[ $USER = (list|of|problem|users) ]]; then
in /etc/zshenv, which is always run (unless the shell was configured
with --disable-zshenv). Using EXTENDED_HISTORY will give you time
stamps on the entries, so you can combine and sort the users' log
files to determine the order of events.
They could still deliberately mess you up by frobbing those setopts
later ... so I suppose if you must hack the source, the place to put
your dosetopt() calls would be in Src/init.c, in loop(), with an
"if (toplevel)" test protecting them. But if your users are so badly
behaved as to ignore your instructions to leave those options alone,
you have worse problems than just tracking down what happened when.
Good suggestions - thanks Bart. I'll give the /etc/zshenv options a try and see if that is enough to handle our problem users.
Messages sorted by: