From owner-freebsd-questions@FreeBSD.ORG Fri Jul 16 09:59:58 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78926106566B for ; Fri, 16 Jul 2010 09:59:58 +0000 (UTC) (envelope-from wahjava@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 23D638FC20 for ; Fri, 16 Jul 2010 09:59:57 +0000 (UTC) Received: by pxi8 with SMTP id 8so968827pxi.13 for ; Fri, 16 Jul 2010 02:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:from:to:cc :subject:organization:references:x-face:x-uptime:x-url :x-operating-system:x-openpgp-id:x-openpgp-fingerprint:x-mailer :x-mail-morse:x-attribution:organisation:date:in-reply-to:message-id :user-agent:face:mime-version:content-type; bh=PA7xn5Zv+TJNXZPVj/mdIbBwyqdNWLVQd6H8bYSM3EU=; b=MYUYlfg3NILZet3c/x03oiT7qVgMmBzKT4Gw0Ov4/hG6jaw9WrBlF9RWOq4rxJbK/B Nw7J+LYEWb5xkQhVUXT8aTdhSqwdtld7prPvNDoLe+yyhcjUQeKmVMnTcjDN9+Mnm7Wc aQ+AxssITw1lMkZpRxTUbCVZl7XLFQ+KTiNhw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:organization:references:x-face:x-uptime :x-url:x-operating-system:x-openpgp-id:x-openpgp-fingerprint :x-mailer:x-mail-morse:x-attribution:organisation:date:in-reply-to :message-id:user-agent:face:mime-version:content-type; b=E/D1yGJp+BXcKcwTQ3zwUcoC/JgGRTxXfpbDgTFLTJD+DdNtnBC+G819AwQxMGOB6i 0LNOKSWod0xU/OnkuAFg991Mh4s6VzvDGLkB1VAh3GiTwq3XLIuyr+g4zgGGp0ay9on3 2mualR5K+SwDQ91x20SXLlilt+cydQtyije1g= Received: by 10.142.79.1 with SMTP id c1mr1077973wfb.279.1279274397164; Fri, 16 Jul 2010 02:59:57 -0700 (PDT) Received: from chateau.d.if ([122.163.158.28]) by mx.google.com with ESMTPS id f2sm2427396wfp.11.2010.07.16.02.59.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Jul 2010 02:59:56 -0700 (PDT) Sender: Ashish SHUKLA Received: from chateau.d.if (chateau.d.if [127.0.0.1]) by chateau.d.if (Postfix) with ESMTP id 9AD4C2D8027; Fri, 16 Jul 2010 15:29:47 +0530 (IST) From: ashish@freebsd.org (Ashish SHUKLA) To: Jens Rehsack Organization: The FreeBSD Project References: <20100715172615.GC5485@dan.emsphone.com> <86tyo0qd19.fsf@chateau.d.if> <20100716043056.GF5485@dan.emsphone.com> <86d3unrfgu.fsf@chateau.d.if> <4C401B31.4000402@netbsd.org> <8639vjrdru.fsf@chateau.d.if> <4C402689.7070005@netbsd.org> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 15:26:49 up 7:57, 1 user, load average: 0.06, 0.09, 0.04 X-URL: http://762e5e74.wordpress.com/ X-Operating-System: GNU/Linux/Linux 2.6.34-ARCH/x86_64 X-OpenPGP-ID: E74FA4B0 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Mailer: Gnus v5.13 X-Mail-Morse: .-- .- .... .--- .- ...- .- .--.-. --. -- .- .. .-.. .-.-.- -.-. --- -- X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: The FreeBSD Project Date: Fri, 16 Jul 2010 15:29:44 +0530 In-Reply-To: <4C402689.7070005@netbsd.org> (Jens Rehsack's message of "Fri, 16 Jul 2010 09:29:45 +0000") Message-ID: <86wrsvpx0v.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-unknown-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Cc: Dan Nelson , freebsd-questions@freebsd.org Subject: Re: getpwent bug? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 09:59:58 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jens Rehsack writes: > On 07/16/10 09:12, Ashish SHUKLA wrote: >> Jens Rehsack writes: >>=20 >> [...] >>=20 >>> I cached the entires - I rate setpwent as to dangerous. >>=20 >> dangerous ? why ? > Because it modifies something - and I might not know the source. > getpwent(3) delivers entries from yp, too (or LDAP) etc. - and > when I call setpwent(3) for such an entry, what happens then? > Long explanation for: I do not know the consequences - and that's > why I rate it dangerous as workaround. ,---- an excerpt from getpwent(3) | The setpassent() function accomplishes two purposes. First, it caus= es | getpwent() to ``rewind'' to the beginning of the database. Addition= ally, | if stayopen is non-zero, file descriptors are left open, significant= ly | speeding up subsequent accesses for all of the routines. (This latt= er | functionality is unnecessary for getpwent() as it does not close its= file | descriptors by default.) |=20 | It is dangerous for long-running programs to keep the file descripto= rs | open as the database will become out of date if it is updated while = the | program is running. |=20 | The setpwent() function is identical to setpassent() with an argumen= t of | zero. `---- I can't see anything which says about modifying NSS database. AFAIK none of the NSS routines allow you to write on database, you've to use the database specific method to modify the database. HTH =2D-=20 Ashish SHUKLA | GPG: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 freebsd.org!ashish | http://people.freebsd.org/~ashish/ =E2=80=9CAge is not an accomplishment, and youth is not a sin.=E2=80=9D (Ro= bert A. Heinlein, "Methuselah's Children", 1958) --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iQIcBAEBCgAGBQJMQC2TAAoJEMdGz6nnT6Swv1cQAKFCiOm2ICatdQ1avmI0vfvE IkrDJVYikM7P96TY4Chp30IpiwnMbt+YwR66XKdIr3VJU9PbHAtmfyN9PS8EwbfX O+MeeKNgi946clJtOLJQxoeT3AtSdzmIyX8e4cpGa18FKWOP8I/5hXNSDhtlTAQN gCaD1DhbjbcQihPk4BIiik5/CT59eE155YnukoUQWiH0zmto0PQeHRnK89CaliCN RTkr7V0UAxfqMStcX86C0VgQ/qvQZvSXb7GxtuM1XDVnGZ6SECC85azFvzDmI7De CU1z+Vwa5+T/ZTdHFHTSajpFR/7SP41QhXrgSI330UnxX/cReIyJYTaVA56KXZVX Gy/H385bP1PtWVBK2ADceDTq3Pk3NMEVKDwUpQZSVQuUQreP1ilw6PPZC1h5Vcmv LU0CHePYgdycch3hO7hNr0ZmsQK90Pnt8ScsTEm/psRFccNhhczdc0j1e8gpWlcT 6yc1krDWQloPYKw+lp8YR+stUb+p746CgO8GDJxWilyM1G9PtM4d7tAh15U5XTZN j2Fyffl/d/w3jyqKu+HIj1cc5q64nftLpFg3kM4HdceNEoTB/VwzsHTpZKeI37O6 QwreFnwGeZdpVDszzmJiaqthSMun1iTXNy5nWLS1GfridFXAMSAJhqGv7aaDzfBW S2naKF/5s6QiN6gE5QjR =UlRB -----END PGP SIGNATURE----- --=-=-=--