summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-12-31 08:06:54 +0000
committerRoland McGrath <roland@gnu.org>2001-12-31 08:06:54 +0000
commit0f4cf9877fb21c58a50823d223faface53e96719 (patch)
treefad8bc1169bc8ba933b0c68070d1c4465e267b04
parentc3d6922bba033c655008534f29ee92ecfc97f022 (diff)
2001-12-31 Roland McGrath <roland@frob.com>
* nbd.c (store_nbd_open): Make sure the store's name always starts with the "nbd://" prefix.
-rw-r--r--libstore/nbd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libstore/nbd.c b/libstore/nbd.c
index ad19af6b..326544d8 100644
--- a/libstore/nbd.c
+++ b/libstore/nbd.c
@@ -512,7 +512,10 @@ store_nbd_open (const char *name, int flags, struct store **store)
err = _store_nbd_create (sock, flags, blocksize, &run, 1, store);
if (! err)
{
- err = store_set_name (*store, name);
+ if (!strncmp (name, url_prefix, sizeof url_prefix - 1))
+ err = store_set_name (*store, name);
+ else
+ asprintf (&(*store)->name, "%s%s", url_prefix, name);
if (err)
store_free (*store);
}