Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2012 20:46:49 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244782 - projects/mtree/tools/build
Message-ID:  <201212282046.qBSKkns7000121@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/cdefs.h>
+#include <pwd.h>
+
+__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);
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212282046.qBSKkns7000121>