From owner-svn-src-all@freebsd.org Tue Aug 4 02:34:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32629AFCF9; Tue, 4 Aug 2015 02:34:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 890BF864; Tue, 4 Aug 2015 02:34:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t742YqVg045449; Tue, 4 Aug 2015 02:34:52 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t742YqQA045448; Tue, 4 Aug 2015 02:34:52 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508040234.t742YqQA045448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 4 Aug 2015 02:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286266 - head/usr.bin/ypmatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 02:34:52 -0000 Author: araujo (ports committer) Date: Tue Aug 4 02:34:51 2015 New Revision: 286266 URL: https://svnweb.freebsd.org/changeset/base/286266 Log: Remove the 3rd clause of BSD LICENSE. Sync the code with the OpenBSD version. Differential Revision: D3213 Reviewed by: rodrigc, bapt Obtained from: OpenBSD Sponsored by: gandi.net Modified: head/usr.bin/ypmatch/ypmatch.c Modified: head/usr.bin/ypmatch/ypmatch.c ============================================================================== --- head/usr.bin/ypmatch/ypmatch.c Tue Aug 4 00:11:39 2015 (r286265) +++ head/usr.bin/ypmatch/ypmatch.c Tue Aug 4 02:34:51 2015 (r286266) @@ -1,5 +1,8 @@ +/* $OpenBSD: ypmatch.c,v 1.16 2015/02/08 23:40:35 deraadt Exp $ */ +/* $NetBSD: ypmatch.c,v 1.8 1996/05/07 01:24:52 jtc Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt + * Copyright (c) 1992, 1993, 1996 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,9 +13,6 @@ * 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. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,18 +34,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +void usage(void); static const struct ypalias { char *alias, *name; @@ -62,30 +63,37 @@ static const struct ypalias { { "ethers", "ethers.byname" }, }; -static void +void usage(void) { - fprintf(stderr, "%s\n%s\n", - "usage: ypmatch [-kt] [-d domainname] key ... mapname", - " ypmatch -x"); + fprintf(stderr, + "usage: ypmatch [-kt] [-d domain] key ... mapname\n" + " ypmatch -x\n"); + fprintf(stderr, + "where\n" + "\tmapname may be either a mapname or a nickname for a map.\n" + "\t-k prints keys as well as values.\n" + "\t-t inhibits map nickname translation.\n" + "\t-x dumps the map nickname translation table.\n"); exit(1); } int main(int argc, char *argv[]) { - char *domainname = NULL; - char *inkey, *inmap, *outbuf; - int outbuflen, key, notrans; + char *domainname, *inkey, *inmap, *outbuf; + extern char *optarg; + extern int optind; + int outbuflen, key, notrans, rval; int c, r; u_int i; + domainname = NULL; notrans = key = 0; - - while ((c = getopt(argc, argv, "xd:kt")) != -1) + while ((c=getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i = 0; i