unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* File locking and emacs_readlinkat
@ 2013-02-25 17:57 Eli Zaretskii
  2013-02-25 18:14 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2013-02-25 17:57 UTC (permalink / raw)
  To: emacs-devel

On Posix platforms, we use emacs_readlinkat in filelock.c to read
information about a locked file.  That information is encoded as the
name of the target of the symlink, and it has the following format:

    USER@HOST.PID:BOOT-TIME

However, emacs_readlinkat has a special feature up its sleeve intended
to support symlinks to remote files:

  val = build_string (buf);
  if (buf[0] == '/' && strchr (buf, ':'))
    val = concat2 (build_string ("/:"), val);

But since in the case of filelock.c, the target of the symlink is not
a file name at all, couldn't this magic cause surprising effects for
unusual USER names?  Can a user name on a Posix system begin with a
slash?



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

* Re: File locking and emacs_readlinkat
  2013-02-25 17:57 File locking and emacs_readlinkat Eli Zaretskii
@ 2013-02-25 18:14 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2013-02-25 18:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Can a user name on a Posix system begin with a slash?

No.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

end of thread, other threads:[~2013-02-25 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 17:57 File locking and emacs_readlinkat Eli Zaretskii
2013-02-25 18:14 ` Andreas Schwab

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

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).