From owner-freebsd-current@FreeBSD.ORG Tue May 27 18:10:36 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A64F37B401 for ; Tue, 27 May 2003 18:10:36 -0700 (PDT) Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA81743F93 for ; Tue, 27 May 2003 18:10:34 -0700 (PDT) (envelope-from yoshint@flab.fujitsu.co.jp) Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail5.fujitsu.co.jp (8.12.9/Fujitsu Gateway) id h4S1AXQU029472 for ; Wed, 28 May 2003 10:10:33 +0900 (envelope-from yoshint@flab.fujitsu.co.jp) Received: from n0.gw.fujitsu.co.jp by m6.gw.fujitsu.co.jp (8.12.9/Fujitsu Domain Master) id h4S1ADea005182 for ; Wed, 28 May 2003 10:10:32 +0900 (envelope-from yoshint@flab.fujitsu.co.jp) Received: from s2.gw.fujitsu.co.jp ([10.0.50.63]) by n0.gw.fujitsu.co.jp (SAVSMTP 3.0.0.44) with SMTP id M2003052810103215254 for ; Wed, 28 May 2003 10:10:32 +0900 Received: from palomino.proc.flab.fujitsu.co.jp (palomino.proc.flab.fujitsu.co.jp [10.25.135.139]) by s2.gw.fujitsu.co.jp (8.12.9) id h4S1AWZe021156 for ; Wed, 28 May 2003 10:10:32 +0900 (envelope-from yoshint@flab.fujitsu.co.jp) Received: from palomino.proc.flab.fujitsu.co.jp (localhost [127.0.0.1]) h4S1AWnF026352 for ; Wed, 28 May 2003 10:10:32 +0900 (JST) (envelope-from yoshint@flab.fujitsu.co.jp) To: freebsd-current@freebsd.org References: From: TOMITA Yoshinori X-Fortune: =?ISO-2022-JP?B?GyRCOiNGfCROJCQkRjpCJE8hIjtFO3YxPyRPOSUbKEI=?= =?ISO-2022-JP?B?GyRCRDQkR0JnJC0kSkk+MkEkLEZAJGkkbCRrRnwhIxsoQg==?= X-Weather: =?ISO-2022-JP?B?GyRCOiNGfCROP0BGYEBuOCkkT0ZeJEckORsoQg==?= X-Face: [|Q@oQ4-)'>a|hK#Wn5u?MMwDs*kTH^u&/.`JOMCIf]22\}]}Fr7`pwbU:1]f>~F(i7vJxW 0JUQD.wjQto]`; 7uMKT\?C<,J~3LpT?c|~&l7kMjEvWhoSNj)oWGORj3R"I\/AGXBkCs(w!+Cx)'Ue n&%HI0W0Dc7>4J"% MIME-Version: 1.0 (generated by WEMIKO 1.14.1 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCNl9KXExTQ24bKEIi?=) Content-Type: text/plain; charset=US-ASCII Date: Wed, 28 May 2003 10:10:32 +0900 In-Reply-To: (TOMITA Yoshinori's message of "Tue, 27 May 2003 21:46:04 +0900") Message-ID: User-Agent: T-gnus/6.16.2 (based on Gnus v5.10.2) Mule-UCS/0.84 (=?ISO-2022-JP?B?S09VR0VUU1VEQUk6GyRCOH43bkJmGyhC?=) WEMIKO/1.14.1 (=?ISO-2022-JP?B?GyRCNl9KXExTQ24bKEI=?=) SLIM/1.14.7 (=?ISO-2022-JP?B?GyRCPHIwZjpMTD4bKEI=?=) APEL/10.3 MULE XEmacs/21.4 (patch 12) (Portable Code) (i386-unknown-freebsd5.0) Subject: Re: passwd NIS+ YP compat mode X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2003 01:10:36 -0000 >> On Tue, 27 May 2003 21:46:04 +0900, TOMITA Yoshinori >> said: T> Hello all, T> After cvsup-ed today 2003-5-27 and make buildworld and so on, T> NIS passwd database are completely ignored. T> But NIS group database seems to be used as usual. T> Out NIS server is actually NIS+ in YP comaptible mode. T> I traced the function getpwnam() and reached following code. T> What can I do ? T> ==[getpwent.c]============================================================= T> static int T> nis_map(char *domain, enum nss_lookup_type how, char *buffer, size_t bufsize, T> int *master) T> ... T> rv = yp_order(domain, buffer, &order); <------ this returns YPERR_YPERR T> if (rv == 0) T> return (NS_SUCCESS); T> ==[yplib.c]================================================================= T> int T> yp_order(char *indomain, char *inmap, int *outorder) T> ... T> /* T> * NIS+ in YP compat mode doesn't support the YPPROC_ORDER T> * procedure. T> */ T> if (r == RPC_PROCUNAVAIL) { T> return(YPERR_YPERR); <------- Here T> } T> ============================================================================ I hope this patch will solve this problem for users living under NIS+ servers. I guess yp_order() is used to check masswd.by* or master.passwd.by* databese really exists. yp_master() can be used for this purpose. But I do not know the cost of yp_master() compared to yp_order(). --- /usr/src/lib/libc/gen/getpwent.c.bak Tue May 27 08:47:24 2003 +++ /usr/src/lib/libc/gen/getpwent.c Wed May 28 09:35:50 2003 @@ -938,14 +938,15 @@ nis_map(char *domain, enum nss_lookup_type how, char *buffer, size_t bufsize, int *master) { - int rv, order; + int rv; + char *outname; *master = 0; if (geteuid() == 0) { if (snprintf(buffer, bufsize, "master.passwd.by%s", (how == nss_lt_id) ? "uid" : "name") >= bufsize) return (NS_UNAVAIL); - rv = yp_order(domain, buffer, &order); + rv = yp_master(domain, buffer, &outname); if (rv == 0) { *master = 1; return (NS_SUCCESS); @@ -954,7 +955,7 @@ if (snprintf(buffer, bufsize, "passwd.by%s", (how == nss_lt_id) ? "uid" : "name") >= bufsize) return (NS_UNAVAIL); - rv = yp_order(domain, buffer, &order); + rv = yp_master(domain, buffer, &outname); if (rv == 0) return (NS_SUCCESS); return (NS_UNAVAIL); -- --- TOMITA Yoshinori