Bug 7836 - options structure considered harmful
options structure considered harmful
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: tmpwatch (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-16 07:22 EST by David Lawrence
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-18 11:59:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Derek Tattersall 1999-12-16 07:22:33 EST
The following mail appeared on devel-list.  I am including it here because
it exhibits a bug and part of the fix.

Notice the spelling of the option "mtiem" should be "mtime".

To: redhat-devel-list@redhat.com
Subject: tmpwatch 2.0 patch
From: Vandoorselaere Yoann <yoann@mandrakesoft.com>
Date: 15 Dec 1999 18:17:18 +0100 (Wed 12:17 EST)

Hi,

When passing an unknow option to tmpwatch it sigsegv,
this is due to the struct options used by getopt_long not terminated by
NULL;

Here is the patch :

--- tmpwatch.c.orig     Wed Dec 15 16:26:00 1999
+++ tmpwatch.c  Wed Dec 15 16:26:31 1999
@@ -271,6 +271,7 @@
     { "quiet", 0, 0, 'q' },
     { "atime", 0, 0, GETOPT_ATIME },
     { "mtiem", 0, 0, GETOPT_MTIME },
+    { 0, 0, 0, 0 }
   };

   if (argc == 1) usage();



see you

--
                   -- Yoann,  http://www.security-addict.org
Comment 1 Preston Brown 2000-01-18 11:59:59 EST
fixed in next release.

Note You need to log in before you can comment on or make changes to this bug.