From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4203 invoked from network); 9 Dec 2005 12:43:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Dec 2005 12:43:33 -0000 Received: (qmail 49507 invoked from network); 9 Dec 2005 12:43:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Dec 2005 12:43:27 -0000 Received: (qmail 29652 invoked by alias); 9 Dec 2005 12:43:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22057 Received: (qmail 29641 invoked from network); 9 Dec 2005 12:43:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Dec 2005 12:43:22 -0000 Received: (qmail 49030 invoked from network); 9 Dec 2005 12:43:22 -0000 Received: from cluster-c.mailcontrol.com (HELO rly11c.srv.mailcontrol.com) (168.143.177.190) by a.mx.sunsite.dk with SMTP; 9 Dec 2005 12:43:21 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly11c.srv.mailcontrol.com (MailControl) with ESMTP id jB9ChHgG018106 for ; Fri, 9 Dec 2005 12:43:17 GMT Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 9 Dec 2005 12:43:17 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id jB9ChEAu012889 for ; Fri, 9 Dec 2005 12:43:16 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id jB9ChDF9012886 for ; Fri, 9 Dec 2005 12:43:14 GMT Message-Id: <200512091243.jB9ChDF9012886@news01.csr.com> To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: zsh/newuser shouldn't run in emulation Date: Fri, 09 Dec 2005 12:43:12 +0000 From: Peter Stephenson X-OriginalArrivalTime: 09 Dec 2005 12:43:17.0158 (UTC) FILETIME=[20A4BC60:01C5FCBE] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-01 (www.mailcontrol.com) on 10.67.0.121 I've added an explicit test to zsh/newuser that it shouldn't run when emulating another shell. Actually, this was already covered for sh and ksh because they take a different branch during initialisation, but I'd prefer it to be explicit within the module. Index: Doc/Zsh/mod_newuser.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_newuser.yo,v retrieving revision 1.1 diff -u -r1.1 mod_newuser.yo --- Doc/Zsh/mod_newuser.yo 20 Jul 2005 16:08:22 -0000 1.1 +++ Doc/Zsh/mod_newuser.yo 9 Dec 2005 12:25:05 -0000 @@ -12,7 +12,9 @@ On loading, the module tests if any of the start-up files tt(.zshenv), tt(.zprofile), tt(.zshrc) or tt(.zlogin) exist in the directory given by the environment variable tt(ZDOTDIR), or the user's home directory if that -is not set. +is not set. The test is not performed and the module halts processing if +the shell was in an emulation mode (i.e. had been invoked as some other +shell than zsh). If none of the start-up files were found, the module then looks for the file tt(newuser) first in a sitewide directory, usually the parent Index: Src/options.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/options.c,v retrieving revision 1.24 diff -u -r1.24 options.c --- Src/options.c 8 Aug 2005 16:49:10 -0000 1.24 +++ Src/options.c 9 Dec 2005 12:25:07 -0000 @@ -33,7 +33,7 @@ /* current emulation (used to decide which set of option letters is used) */ /**/ -int emulation; +mod_export int emulation; /* the options; e.g. if opts[SHGLOB] != 0, SH_GLOB is turned on */ Index: Src/Modules/newuser.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/newuser.c,v retrieving revision 1.1 diff -u -r1.1 newuser.c --- Src/Modules/newuser.c 20 Jul 2005 16:08:23 -0000 1.1 +++ Src/Modules/newuser.c 9 Dec 2005 12:25:07 -0000 @@ -64,6 +64,9 @@ 0 }; const char **sp; + if (emulation != EMULATE_ZSH) + return; + if (!dotdir) dotdir = home; -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com