From owner-p4-projects Mon Oct 7 14:40:58 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 19A9537B404; Mon, 7 Oct 2002 14:40:54 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BD1937B401; Mon, 7 Oct 2002 14:40:53 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6454B43E6A; Mon, 7 Oct 2002 14:40:52 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g97LdVOo099938; Mon, 7 Oct 2002 17:39:31 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 7 Oct 2002 17:39:30 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brian Feldman Cc: Perforce Change Reviews Subject: Re: PERFORCE change 18877 for review In-Reply-To: <200210072021.g97KLeWX044851@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Please feed all changes to the extattr utilities back through phk as appropriate. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories On Mon, 7 Oct 2002, Brian Feldman wrote: > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18877 > > Change 18877 by green@green_laptop_2 on 2002/10/07 13:20:39 > > Correct crashes related to not knowing what the correct minimum > argc is. > > Affected files ... > > .. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#4 edit > > Differences ... > > ==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#4 (text+ko) ==== > > @@ -102,7 +102,8 @@ > char *buf, *visbuf, *p; > > const char *options, *attrname; > - int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace; > + int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace, > + minargc; > > int flag_force = 0; > int flag_quiet = 0; > @@ -118,15 +119,19 @@ > if (!strcmp(p, "getextattr")) { > what = EAGET; > options = "fqsx"; > + minargc = 3; > } else if (!strcmp(p, "setextattr")) { > what = EASET; > options = "fq"; > + minargc = 4; > } else if (!strcmp(p, "rmextattr")) { > what = EARM; > options = "fq"; > + minargc = 3; > } else if (!strcmp(p, "lsextattr")) { > what = EALS; > options = "fq"; > + minargc = 2; > } else { > usage(); > } > @@ -154,7 +159,7 @@ > argc -= optind; > argv += optind; > > - if (argc < 2) > + if (argc < minargc) > usage(); > > error = extattr_string_to_namespace(argv[0], &attrnamespace); > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message