From owner-cvs-all Fri Jan 5 10:15:21 2001 From owner-cvs-all@FreeBSD.ORG Fri Jan 5 10:15:18 2001 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4A09937B404; Fri, 5 Jan 2001 10:15:18 -0800 (PST) Received: (from will@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f05IFIc47753; Fri, 5 Jan 2001 10:15:18 -0800 (PST) (envelope-from will) Message-Id: <200101051815.f05IFIc47753@freefall.freebsd.org> From: Will Andrews Date: Fri, 5 Jan 2001 10:15:18 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/apply apply.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG will 2001/01/05 10:15:18 PST Modified files: usr.bin/apply apply.c Log: Reinstate revision 1.11: BDECFLAGS; ANSIfy; use EXEC instead of "exec " where appropriate; use proper types (size_t, int); use proper variable names for certain things; get rid of static 'cache' style stuff by moving and sanitizing the original SHELL checking code to main(), this also makes it easier to free() the string; rename file-scope system() to exec_shell(); use snprintf() everywhere instead of sprintf(); actually remember to free() other malloc()'d char pointers in main(). I left out the -s option in this revision along with getusershell() checking because of objections made by Warner Losh and Garrett Wollman . I agreed with their assertions that such code was unnecessary in a program like this. I dare people to make this coredump now. Some suggestions: nectar (snprintf() truncate checking) Reviewed by: markm, eivind, jedgar Tortured by: examples in apply(1), fuzz(1), and a lot of random ideas I came up with Revision Changes Path 1.13 +63 -38 src/usr.bin/apply/apply.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message