zsh-users
 help / color / mirror / code / Atom feed
* "autoload -U" expanding alias
@ 2004-03-23 21:43 Thorsten Kampe
  2004-03-24 18:36 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Kampe @ 2004-03-23 21:43 UTC (permalink / raw)
  To: zsh-users

[zsh 4.2.0 on Gentoo]

I have a script that zcompiles some rcfiles. It's asking whether to
overwrite files:
re-compiling /home/thorsten/.zsh/.zlogout.zwc: mv: overwrite
`/home/thorsten/.zsh/.zlogout.zwc.old', overriding mode 0400? 

What's happening and how can I prevent this question?

The "-U" keeps my "mv -i" alias from being expanded....

Thorsten

[1]
,---
| #! /bin/zsh -f
| emulate -LR zsh
| 
| localzdotdir=~/.zsh
| nwzdotdir=~/mnt/nwhome/ifolder/conf/zsh
| 
| autoload -U zrecompile
| zrecompile -p -R /etc/profile.d/zshell.zsh -- \
|               -R /etc/zprofile             -- \
|               -R /etc/zsh/zprofile         -- \
|               -M $localzdotdir/.zcompdump  -- \
|               -R $localzdotdir/.zlogin     -- \
|               -R $localzdotdir/.zlogout    -- \
|               -R $localzdotdir/.zshrc      -- \
|               -R ~/.zshenv                 -- \
|               -M $nwzdotdir/.zcompdump     -- \
|               -R $nwzdotdir/.zlogin        -- \
|               -R $nwzdotdir/.zlogout       -- \
|               -R $nwzdotdir/.zshrc
`---


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "autoload -U" expanding alias
  2004-03-23 21:43 "autoload -U" expanding alias Thorsten Kampe
@ 2004-03-24 18:36 ` Bart Schaefer
  2004-03-24 20:41   ` Thorsten Kampe
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2004-03-24 18:36 UTC (permalink / raw)
  To: zsh-users

On Mar 23, 10:43pm, Thorsten Kampe wrote:
} 
} I have a script that zcompiles some rcfiles. It's asking whether to
} overwrite files:
} re-compiling /home/thorsten/.zsh/.zlogout.zwc: mv: overwrite
} `/home/thorsten/.zsh/.zlogout.zwc.old', overriding mode 0400? 

This message is happening because of the 0400 file mode, not because of
any option being passed to the "mv" command.  Files that are not writable
in directories that are writable trigger this behavior unless "mv -f" is
used.
 
} What's happening and how can I prevent this question?

chmod 0600 the .zwc.old files.  How did they end up mode 0400 ?  Does
your umask setting typically cause you to create files you can't write?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "autoload -U" expanding alias
  2004-03-24 18:36 ` Bart Schaefer
@ 2004-03-24 20:41   ` Thorsten Kampe
  2004-03-24 20:53     ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Kampe @ 2004-03-24 20:41 UTC (permalink / raw)
  To: zsh-users

* Bart Schaefer (2004-03-24 19:36 +0100)
> On Mar 23, 10:43pm, Thorsten Kampe wrote:
> } I have a script that zcompiles some rcfiles. It's asking whether to
> } overwrite files:
> } re-compiling /home/thorsten/.zsh/.zlogout.zwc: mv: overwrite
> } `/home/thorsten/.zsh/.zlogout.zwc.old', overriding mode 0400? 
> 
> This message is happening because of the 0400 file mode, not because of
> any option being passed to the "mv" command.  Files that are not writable
> in directories that are writable trigger this behavior unless "mv -f" is
> used.

I see. But these "0400" ".zwc.old" files are created from zrecompile
itself. This happens only on my Linux box. My Cygwin host has no
problems mv a 0400 file.
  
> } What's happening and how can I prevent this question?
> 
> chmod 0600 the .zwc.old files.  How did they end up mode 0400 ?  Does
> your umask setting typically cause you to create files you can't write?

My umask is 077 so the newly created file from zrecompile should be
mode 600 - not 400.

Thorsten


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "autoload -U" expanding alias
  2004-03-24 20:41   ` Thorsten Kampe
@ 2004-03-24 20:53     ` Peter Stephenson
  2004-03-25  3:51       ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2004-03-24 20:53 UTC (permalink / raw)
  To: zsh-users

Thorsten Kampe wrote:
> I see. But these "0400" ".zwc.old" files are created from zrecompile
> itself. This happens only on my Linux box. My Cygwin host has no
> problems mv a 0400 file.

This seems to be deliberate. parse.c line 2631.


    if ((dfd = open(dump, O_WRONLY|O_CREAT, 0444)) < 0) {
	zwarnnam(nam, "can't write zwc file: %s", dump, 0);
	return 1;
    }

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "autoload -U" expanding alias
  2004-03-24 20:53     ` Peter Stephenson
@ 2004-03-25  3:51       ` Bart Schaefer
  2004-03-25 10:13         ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2004-03-25  3:51 UTC (permalink / raw)
  To: zsh-users

On Mar 24,  9:41pm, Thorsten Kampe wrote:
}
} * Bart Schaefer (2004-03-24 19:36 +0100)
} > chmod 0600 the .zwc.old files.  How did they end up mode 0400 ?
} 
} My umask is 077 so the newly created file from zrecompile should be
} mode 600 - not 400.

On Mar 24,  8:53pm, Peter Stephenson wrote:
} 
} This seems to be deliberate. parse.c line 2631.

Hrm.  (I've been saying that a lot lately.)

In that case, I'd say it's zrecompile that's broken.  Should we change
"mv" to "mv -f" throughout?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "autoload -U" expanding alias
  2004-03-25  3:51       ` Bart Schaefer
@ 2004-03-25 10:13         ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2004-03-25 10:13 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer wrote:
> In that case, I'd say it's zrecompile that's broken.  Should we change
> "mv" to "mv -f" throughout?

Sounds reasonable, under the circumstances.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-03-25 10:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-23 21:43 "autoload -U" expanding alias Thorsten Kampe
2004-03-24 18:36 ` Bart Schaefer
2004-03-24 20:41   ` Thorsten Kampe
2004-03-24 20:53     ` Peter Stephenson
2004-03-25  3:51       ` Bart Schaefer
2004-03-25 10:13         ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).