From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5018 invoked from network); 13 Oct 2006 14:43:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Oct 2006 14:43:15 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46170 invoked from network); 13 Oct 2006 14:43:09 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Oct 2006 14:43:08 -0000 Received: (qmail 28386 invoked by alias); 13 Oct 2006 14:42:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10864 Received: (qmail 28279 invoked from network); 13 Oct 2006 14:42:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Oct 2006 14:42:53 -0000 Received: (qmail 43806 invoked from network); 13 Oct 2006 14:42:52 -0000 Received: from wx-out-0506.google.com (66.249.82.228) by a.mx.sunsite.dk with SMTP; 13 Oct 2006 14:42:47 -0000 Received: by wx-out-0506.google.com with SMTP id s7so871346wxc for ; Fri, 13 Oct 2006 07:42:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=TzdZC1zeUdZq2lqosse/XyPGp0wq1J7hFDSYYrg5hrA3UxT4oyx5MhtLYgXpNxWHcJythOSS8ljzqG0l1LTcF2Xmenqg5TcWU/93tYGNKPnwB7Ff2MuF+Lg13D019YjNbo77EDEBaTqu75HW0Szu6e/P2jXBUb2yIIwmyfDIsy4= Received: by 10.70.96.3 with SMTP id t3mr5374258wxb; Fri, 13 Oct 2006 07:42:44 -0700 (PDT) Received: from ?192.168.10.23? ( [65.211.29.191]) by mx.google.com with ESMTP id i19sm574261wxd.2006.10.13.07.42.43; Fri, 13 Oct 2006 07:42:43 -0700 (PDT) In-Reply-To: References: <76C42610-83A0-4174-ADBF-5CD4D75891D5@gmail.com> <200610121802.k9CI2A8i025805@news01.csr.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: zsh-users@sunsite.dk Content-Transfer-Encoding: 7bit From: Michael Hernandez Subject: Re: can't write zsh_history Date: Fri, 13 Oct 2006 10:42:40 -0400 To: William Scott X-Mailer: Apple Mail (2.752.2) On Oct 13, 2006, at 10:30 AM, William Scott wrote: > > > On Fri, 13 Oct 2006, William Scott wrote: > >>>> root. Is there something I can do to alter the way zsh writes to my >>>> history file when I am root? >>> if (( ! EUID )); then >>> HISTFILE=~/.history_root >>> else >>> HISTFILE=~/.history >>> fi >> >> You got my hopes up with this, but unfortunately I can't get this >> to work, using my favorite security hole: >> >> luser-% sudo zsh >> root-# (various nefarious evildoing) >> root-# exit >> zsh: can't write history file /Users/luser/.zsh_history >> >> (I call it .zsh_history, BTW). >> >> Even "sudo zsh -l" doesn't help. $HISTFILE never changes. >> I thought about having it update dynamically like $PWD, >> but it seems like a lot of overhead for an occasional >> irritation. In addition, in my case at least the >> ownership of ~/.zsh_history remains with luser. >> >> > > I should never post before morning coffee. sudo /bin/zsh -l > corrects the problem; I had a differently behaving zsh at > the head of the $PATH. > > So a slightly different question: > > is there a way to alias > > "sudo zsh" to "sudo /bin/zsh -l" ? > > I'd like to mention that I decided to "su -" and not just "su"f, and this way I can use root's startup files and not have to worry about my files being touched. It works .... for now ;) Mike