all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19858: 25.0.50; Docstring bug in make-temp-name
@ 2015-02-13 21:57 Marcin Borkowski
  2015-02-14  4:07 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Marcin Borkowski @ 2015-02-13 21:57 UTC (permalink / raw)
  To: 19858

The docstring for `make-temp-file' says (among other things):

"For that reason, you should
probably use `make-temp-file' instead, except in three circumstances:

* If you are creating the file in the user's home directory.
* If you are creating a directory rather than an ordinary file."

However, `make-temp-file' actually can create directories, so the second
point in the above quote is unnecessary and misleading.

Best regards,

Version info:

In GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ Version 3.10.8)
 of 2015-01-02 on aga-netbook
Repository revision: 11ee7d8bf16b8ee4fcb3659e4b09686ed8b10590
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University





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

* bug#19858: 25.0.50; Docstring bug in make-temp-name
  2015-02-13 21:57 bug#19858: 25.0.50; Docstring bug in make-temp-name Marcin Borkowski
@ 2015-02-14  4:07 ` Stefan Monnier
  2015-02-17 22:33   ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-02-14  4:07 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: 19858

> The docstring for `make-temp-file' says (among other things):
> "For that reason, you should
> probably use `make-temp-file' instead, except in three circumstances:

> * If you are creating the file in the user's home directory.
> * If you are creating a directory rather than an ordinary file."

> However, `make-temp-file' actually can create directories, so the second
> point in the above quote is unnecessary and misleading.

make-temp-file can also create a temp file in the user's home directory
(so your criticism also applies to the first point).

The issue is simply that in cases other than the above two, using
make-temp-name is *dangerous*.


        Stefan





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

* bug#19858: 25.0.50; Docstring bug in make-temp-name
  2015-02-14  4:07 ` Stefan Monnier
@ 2015-02-17 22:33   ` Glenn Morris
  2015-02-18  3:46     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2015-02-17 22:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19858, Marcin Borkowski

Stefan Monnier wrote:

> make-temp-file can also create a temp file in the user's home directory
> (so your criticism also applies to the first point).
>
> The issue is simply that in cases other than the above two, using
> make-temp-name is *dangerous*.

Why's it not dangerous in HOME?





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

* bug#19858: 25.0.50; Docstring bug in make-temp-name
  2015-02-17 22:33   ` Glenn Morris
@ 2015-02-18  3:46     ` Stefan Monnier
  2015-02-20  5:42       ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-02-18  3:46 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 19858, Marcin Borkowski

>> make-temp-file can also create a temp file in the user's home directory
>> (so your criticism also applies to the first point).
>> The issue is simply that in cases other than the above two, using
>> make-temp-name is *dangerous*.
> Why's it not dangerous in HOME?

Presumably, HOME is only writable by yourself, so you can presume that
there's no attacker trying play race-condition tricks on you in there to
try and get to run code under your UID.


        Stefan





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

* bug#19858: 25.0.50; Docstring bug in make-temp-name
  2015-02-18  3:46     ` Stefan Monnier
@ 2015-02-20  5:42       ` Glenn Morris
  2015-02-20 17:15         ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2015-02-20  5:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19858, Marcin Borkowski

Stefan Monnier wrote:

> Presumably, HOME is only writable by yourself, so you can presume that
> there's no attacker trying play race-condition tricks on you in there to
> try and get to run code under your UID.

If it meant "it's safe so long as no-one else can write to the
containing directory", then I think it should have said that rather than
making assumptions about the permissions of HOME.

Anyway, I don't think those various qualifications were helpful, so I
basically removed them from the doc.






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

* bug#19858: 25.0.50; Docstring bug in make-temp-name
  2015-02-20  5:42       ` Glenn Morris
@ 2015-02-20 17:15         ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2015-02-20 17:15 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 19858, Marcin Borkowski

> Anyway, I don't think those various qualifications were helpful, so I
> basically removed them from the doc.

Agreed, thanks,


        Stefan





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

end of thread, other threads:[~2015-02-20 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 21:57 bug#19858: 25.0.50; Docstring bug in make-temp-name Marcin Borkowski
2015-02-14  4:07 ` Stefan Monnier
2015-02-17 22:33   ` Glenn Morris
2015-02-18  3:46     ` Stefan Monnier
2015-02-20  5:42       ` Glenn Morris
2015-02-20 17:15         ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.