From owner-freebsd-bugs Mon Jan 22 10:30:23 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2681737B402 for ; Mon, 22 Jan 2001 10:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0MIU1870485; Mon, 22 Jan 2001 10:30:01 -0800 (PST) (envelope-from gnats) Received: from electron.databits.net (dialup1.databits.net [207.29.204.16]) by hub.freebsd.org (Postfix) with ESMTP id 7E90D37B400 for ; Mon, 22 Jan 2001 10:21:46 -0800 (PST) Received: (from petef@localhost) by electron.databits.net (8.11.1/8.9.3) id f0MIL8250925; Mon, 22 Jan 2001 13:21:08 -0500 (EST) (envelope-from petef) Message-Id: <200101221821.f0MIL8250925@electron.databits.net> Date: Mon, 22 Jan 2001 13:21:08 -0500 (EST) From: petef@databits.net Reply-To: petef@databits.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/24540: add '-c' flag to src/bin/domainname to clear domainname Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24540 >Category: bin >Synopsis: add '-c' flag to src/bin/domainname to clear domainname >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jan 22 10:30:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Pete Fritchman >Release: FreeBSD 5.0-CURRENT i386 >Organization: Databits Network Services, Inc. >Environment: FreeBSD 5.0-CURRENT >Description: Add the "-c" flag to domainname to allow clearing of the current YP/NIS domain. >How-To-Repeat: Set a domainname with domainname(1) and try to clear it using domainname(1). >Fix: Index: domainname.1 =================================================================== RCS file: /home/ncvs/src/bin/domainname/domainname.1,v retrieving revision 1.11 diff -u -r1.11 domainname.1 --- domainname.1 2000/12/14 11:39:33 1.11 +++ domainname.1 2001/01/22 18:17:47 @@ -40,6 +40,7 @@ .Nd set or print name of current YP/NIS domain .Sh SYNOPSIS .Nm +.Op Fl c .Op Ar ypdomain .Sh DESCRIPTION .Nm Domainname @@ -49,6 +50,13 @@ .Pa /etc/rc.network , normally run at boot time. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c +Clear the current YP/NIS domain. Note that programs accessing +the password database cache the domain, and will need to be +restarted to see the change. .Sh NOTA BENE The YP/NIS (formerly ``Yellow Pages'' but renamed for legal reasons) domain name does not necessarily have anything to do with the Domain Index: domainname.c =================================================================== RCS file: /home/ncvs/src/bin/domainname/domainname.c,v retrieving revision 1.12 diff -u -r1.12 domainname.c --- domainname.c 1999/08/27 23:14:08 1.12 +++ domainname.c 2001/01/22 18:17:49 @@ -63,8 +63,13 @@ int ch; char domainname[MAXHOSTNAMELEN]; - while ((ch = getopt(argc, argv, "")) != -1) + while ((ch = getopt(argc, argv, "c")) != -1) switch (ch) { + case 'c': + if (setdomainname("", 1)) + err(1, "setdomainname"); + exit(0); + break; default: usage(); } @@ -88,6 +93,6 @@ void usage() { - (void)fprintf(stderr, "usage: domainname [ypdomain]\n"); + (void)fprintf(stderr, "usage: domainname [-c] [ypdomain]\n"); exit(1); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message