From 6a5b803539ca82ab6114e609e99df3b87cb562be Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 15 Sep 2003 14:58:43 +0000 Subject: [PATCH] Don't use !# in randomly-generated uuids. --- lib/uuid/uuid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/uuid/uuid.c b/lib/uuid/uuid.c index 7ff73301a..8083b7abe 100644 --- a/lib/uuid/uuid.c +++ b/lib/uuid/uuid.c @@ -73,8 +73,12 @@ int id_create(struct id *id) } close(randomfile); + /* + * Skip out the last 2 chars in randomized creation for LVM1 + * backwards compatibility. + */ for (i = 0; i < len; i++) - id->uuid[i] = _c[id->uuid[i] % (sizeof(_c) - 1)]; + id->uuid[i] = _c[id->uuid[i] % (sizeof(_c) - 3)]; return 1; }