zsh-users
 help / color / mirror / code / Atom feed
* umask for process substitution
@ 2003-02-20 22:41 Paul Lew
  2003-02-22 23:36 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Lew @ 2003-02-20 22:41 UTC (permalink / raw)
  To: zsh-users

Is there a way to set umask for temporary file created with =(cmd)?  I
am running a setuid program which failed to read the =(cmd) because it
use mode 600:

> ls =(echo foo)
-rw-------    1 root  other    4 Feb 20 13:32 /tmp/zsh8PayQ4

> umask
002

TIA.


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

* Re: umask for process substitution
  2003-02-20 22:41 umask for process substitution Paul Lew
@ 2003-02-22 23:36 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2003-02-22 23:36 UTC (permalink / raw)
  To: zsh-users

On Feb 20,  2:41pm, Paul Lew wrote:
}
} Is there a way to set umask for temporary file created with =(cmd)?

No, there isn't.

However, because of the order in which zsh creates/removes those temp
files, you can do something like this:

    { f==(cmd); chmod a+r $f; suidprog $f }

That is, the file will persist until the end of the braces (and maybe
longer, depending on the structure of the command).

If your operating system supports /dev/fd/, you might be able to do this:

    suidprog =(chmod a+r /dev/fd/1; cmd)

It depends on the implementation of /dev/fd ... it works on Linux, but I
doubt it works on Solaris.


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

end of thread, other threads:[~2003-02-22 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-20 22:41 umask for process substitution Paul Lew
2003-02-22 23:36 ` Bart Schaefer

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).