git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tay Ray Chuan <rctay89@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH] use lock token in non-URI form in start_put
Date: Sat, 07 Feb 2009 18:28:06 -0800	[thread overview]
Message-ID: <7vzlgx3bnt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: be6fef0d0902071745r355309c2o76622b3af8df53bc@mail.gmail.com

Tay Ray Chuan <rctay89@gmail.com> writes:

> In section 6.5 which you cite below, the token is unique, and we hold
> the server's word for it.

Are you sure you are not reading too much into that guarantee?

I somehow thought that the natural reading of the guarantee is *not* that
the tokens are unique over the lifetime of the server installation (iow, a
lock token you obtained today will never be used in the future, and it is
a token that the server never has used before), but it merely guarantees
that there are no any two outstanding locks that share the same URI, lest
one client's unlock request breaks the wrong lock.  But I may be wrong here.

>> That is why I asked in my previous question what in the codepath protects
>> ourselves from using problematic characters.
>
> You're right, section 6.5 doesn't enforce that lock tokens are UUIDs.
>
> Any solutions to this? Perhaps one could have a function, say,
> get_unique_remote_postfix, and the function would check for URI
> schemes which we know are safe for use in file names, namely,
> "urn:uuid:" and "opaqulocktoken:". However, if its a URI we are unsure
> of, then it would generate a random string.

Let me show even more ignorance of mine with this codepath.

What breaks and how, if we do not even use a random string but a fixed
suffix ".temp" here?  I am not suggesting we actually do that, but I'd
like to see how important the uniqueness is here to better understand the
issue.

  reply	other threads:[~2009-02-08  2:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 19:27 [PATCH] use lock token in non-URI form in start_put Tay Ray Chuan
2009-02-07 20:20 ` Johannes Schindelin
2009-02-07 20:40   ` Junio C Hamano
2009-02-08  1:45     ` Tay Ray Chuan
2009-02-08  2:28       ` Junio C Hamano [this message]
2009-02-08  3:28         ` Tay Ray Chuan
2009-02-08  1:25   ` Tay Ray Chuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vzlgx3bnt.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=rctay89@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).