From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/6712 Path: main.gmane.org!not-for-mail From: Sudish Joseph Newsgroups: gmane.emacs.gnus.general Subject: Re: Is Username Expansion possible in GNUS? Date: 14 Jun 1996 21:44:01 -0400 Sender: sj@atreides.erehwon.org Message-ID: References: <9606142302.AA13351@shadow> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035147128 4520 80.91.224.250 (20 Oct 2002 20:52:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:52:08 +0000 (UTC) Cc: Danny Siu , ding@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id TAA26970 for ; Fri, 14 Jun 1996 19:11:07 -0700 Original-Received: from atreides.erehwon.org (sj@user-168-121-167-78.dialup.mindspring.com [168.121.167.78]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sat, 15 Jun 1996 03:40:46 +0200 Original-Received: (from sj@localhost) by atreides.erehwon.org (8.7.5/8.6.9) id VAA00256; Fri, 14 Jun 1996 21:44:02 -0400 Original-To: Eric Hendrickson In-Reply-To: Eric Hendrickson's message of Fri, 14 Jun 1996 18:02:32 -0500 Original-Lines: 19 X-Mailer: Gnus v5.2.12/Emacs 19.31 Xref: main.gmane.org gmane.emacs.gnus.general:6712 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:6712 Eric Hendrickson writes: > do this anyway). It might be slow if the passwd file is big, though on the > machines where I've seen Pine do this, it is very quick and the passwd file > has about 40000 (yes, 40k) entries.... You don't need to parse the whole file yourself, a getpwnam() call is all that's needed. Unfortunately, Emacs doesn't offer much of an interface to getpw*(). All the functions under user-* operate on your current (r|e)uid, except for user-login name, which lets you specify an arbitrary uid. Useless, without a way to map from a name to a uid. Sucking in the whole password file and using re-search-forward wouldn't be slow in itself, but it might make you thrash on big passwd files and be totally useless in the face of NIS. A subprocess running egrep seems the best bet, if you -really- want to do this. :-) -Sudish