From owner-svn-src-projects@FreeBSD.ORG Fri Dec 28 20:46:49 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E74EDC9; Fri, 28 Dec 2012 20:46:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73B6B8FC14; Fri, 28 Dec 2012 20:46:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBSKknrh000124; Fri, 28 Dec 2012 20:46:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBSKkns7000121; Fri, 28 Dec 2012 20:46:49 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212282046.qBSKkns7000121@svn.freebsd.org> From: Brooks Davis Date: Fri, 28 Dec 2012 20:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244782 - projects/mtree/tools/build X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2012 20:46:49 -0000 Author: brooks Date: Fri Dec 28 20:46:48 2012 New Revision: 244782 URL: http://svnweb.freebsd.org/changeset/base/244782 Log: Add stub implementations of new pwcache(3) APIs so install(1) can use them. Added: projects/mtree/tools/build/pwcache-stub.c (contents, props changed) Modified: projects/mtree/tools/build/Makefile Modified: projects/mtree/tools/build/Makefile ============================================================================== --- projects/mtree/tools/build/Makefile Fri Dec 28 20:44:23 2012 (r244781) +++ projects/mtree/tools/build/Makefile Fri Dec 28 20:46:48 2012 (r244782) @@ -21,6 +21,11 @@ config.h: ${.CURDIR}/../../lib/libmagic/ grep -v HAVE_GETLINE ${.ALLSRC} > ${.TARGET} .endif +_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/pwd.h || true +.if ${_WITH_PWCACHEDB} == 0 +SRCS+= pwcache-stub.c +.endif + .if empty(SRCS) SRCS= dummy.c .endif Added: projects/mtree/tools/build/pwcache-stub.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mtree/tools/build/pwcache-stub.c Fri Dec 28 20:46:48 2012 (r244782) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +__FBSDID("$FreeBSD$"); + +struct group; +struct passwd; + +int +pwcache_groupdb( + int (*a_setgroupent)(int) __unused, + void (*a_endgrent)(void) __unused, + struct group * (*a_getgrnam)(const char *) __unused, + struct group * (*a_getgrgid)(gid_t) __unused) +{ + + return (-1); +} + +int +pwcache_userdb( + int (*a_setpassent)(int) __unused, + void (*a_endpwent)(void) __unused, + struct passwd * (*a_getpwnam)(const char *) __unused, + struct passwd * (*a_getpwuid)(uid_t) __unused) +{ + + return (-1); +} + +int +gid_from_group(const char *group __unused, gid_t *gid __unused) +{ + + return (-1); +} + +int +uid_from_user(const char *user __unused, uid_t *uid __unused) +{ + + return(-1); +}