From owner-freebsd-ports Fri Oct 26 7:40: 7 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 25CE337B405 for ; Fri, 26 Oct 2001 07:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9QEe2499924; Fri, 26 Oct 2001 07:40:02 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4765437B406 for ; Fri, 26 Oct 2001 07:35:03 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9QEZ3699367; Fri, 26 Oct 2001 07:35:03 -0700 (PDT) (envelope-from nobody) Message-Id: <200110261435.f9QEZ3699367@freefall.freebsd.org> Date: Fri, 26 Oct 2001 07:35:03 -0700 (PDT) From: Alan Eldridge To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: ports/31508: Coding error in py-4suite: Ft/Lib/Uuid.py throws away half of generated UUID Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31508 >Category: ports >Synopsis: Coding error in py-4suite: Ft/Lib/Uuid.py throws away half of generated UUID >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 26 07:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Alan Eldridge >Release: 4.4-RELEASE >Organization: >Environment: FreeBSD wwweasel.geeksrus.net 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Mon Oct 22 16:59:49 EDT 2001 root@wwweasel.geeksrus.net:/usr/src/sys/compile/WWWEASEL i386 >Description: There's a typo (?) in Ft.Lib.Uuid.UuidAsString(uuid), where a loop to convert an integer to a string of bytes is only picking up the lower 4 bits of each byte. This results in half of the bits of the UUID being thrown away in the conversion to string. I have not yet checked, but this is probably fixed in the newest version of the the 4suite code. >How-To-Repeat: [alane@wwweasel ~/sw/ftom/linkman]$ python Python 2.1.1 (#1, Sep 13 2001, 18:12:15) [GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4 Type "copyright", "credits" or "license" for more information. >Fix: Make this fix (changing 0xF to 0xFF). [alane@wwweasel ~/sw/ftom/linkman]$ diff -u Uuid.py.or Uuid.py --- Uuid.py.or Sun Dec 3 05:52:27 2000 +++ Uuid.py Fri Oct 26 10:27:41 2001 @@ -64,7 +64,7 @@ newUuid = '' curUuid = uuid for ctr in range(16): - num = int(curUuid & 0xF) + num = int(curUuid & 0xFF) newChar = chr(num) curUuid = curUuid >> 8 newUuid = newChar + newUuid [alane@wwweasel ~/sw/ftom/linkman]$ >Release-Note: >Audit-Trail: >Unformatted: >>> import Uuid >>> u = Uuid.GenerateUuid() >>> u 293274167793379733969387239632193121121L >>> hex(u) '0xDCA28CD7BC1B44DDB23830439C76EB61L' >>> Uuid.UuidAsString(u) 'c020c07-c0b-40d-208-30c06b01' >>> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message