From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/35033 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: `user-mail-address' for message-ids Date: 27 Feb 2001 14:15:31 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: <20010223133030.B14991@mastaler.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035170842 846 80.91.224.250 (21 Oct 2002 03:27:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:27:22 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id CDB39D049D for ; Tue, 27 Feb 2001 15:19:40 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAB22969; Tue, 27 Feb 2001 13:16:01 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 27 Feb 2001 13:15:12 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA14116 for ; Tue, 27 Feb 2001 13:15:02 -0600 (CST) Original-Received: from multivac.cwru.edu (multivac.STUDENT.CWRU.Edu [129.22.96.25]) by mailhost.sclp.com (Postfix) with SMTP id 0EDB9D049F for ; Tue, 27 Feb 2001 14:15:33 -0500 (EST) Original-Received: (qmail 30320 invoked by uid 500); 27 Feb 2001 19:15:53 -0000 Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org In-Reply-To: (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "27 Feb 2001 19:22:38 +0100") User-Agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 38 Xref: main.gmane.org gmane.emacs.gnus.general:35033 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:35033 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) writes: > On a single machine, Gnus can write `fsf' into the lhs and hope that > no other client is going to use that string. Actually, Gnus already does better than this, by encoding the uid into the lhs. But this doesn't protect against two Gnusae running as the same user at the same time. Should we be worried? It's an easy fix; here's a patch, along with some comment cleanups. ChangeLog: * message.el (message-unique-id): Even uniquer! Use (emacs-pid). --- message.el~ Tue Feb 27 14:04:55 2001 +++ message.el Tue Feb 27 14:10:00 2001 @@ -3158,11 +3158,11 @@ ;; or string boundary), or modify the "fsf" string. (defun message-unique-id () ;; Don't use microseconds from (current-time), they may be unsupported. - ;; Instead we use this randomly inited counter. + ;; Instead we use this randomly initialized counter. (setq message-unique-id-char (% (1+ (or message-unique-id-char (logand (random t) (1- (lsh 1 20))))) ;; (current-time) returns 16-bit ints, - ;; and 2^16*25 just fits into 4 digits i base 36. + ;; and 2^16*25 just fits into 4 digits in base 36. (* 25 25))) (let ((tm (current-time))) (concat @@ -3176,6 +3176,8 @@ (lsh (% message-unique-id-char 25) 16)) 4) (message-number-base36 (+ (nth 1 tm) (lsh (/ message-unique-id-char 25) 16)) 4) + "-" + (message-number-base36 (emacs-pid) -1) ;; Append the newsreader name, because while the generated ;; ID is unique to this newsreader, other newsreaders might ;; otherwise generate the same ID via another algorithm. paul