[26251] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25472 - in trunk/third/moira: clients/mailmaint

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Thu May 3 16:02:04 2012

Date: Thu, 3 May 2012 13:02:02 -0700 (PDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: Jonathan Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <59FE1018-293E-4FE3-AF41-30C83372BAA9@mit.edu>
Message-ID: <alpine.DEB.2.00.1205031300310.2871@dr-wily.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

Well, the first change is unnecessary because it's a constant string, and 
in the other ones, the use of sprintf to generate input to an sprintf-y 
function seems unneeded -- just pass the format string and arguments to 
com_err directly.

-- 
Geoffrey Thomas
geofft@mit.edu

On Thu, 3 May 2012, Jonathan Reed wrote:

> I'm not sure what you're objecting to, or what your alternative suggesting for fixing the error is.  I may well be wrong, but this is unclear.
>
> And yes, obviously I'm going to try and get this upstream, and will send it Garry once it's acked.  But I'm not going to block the release on it.  Or are you suggesting I should go drink the quilt koolaid?
>
> -Jon
>
>
> On May 3, 2012, at 3:43 PM, Geoffrey Thomas wrote:
>
>> On Thu, 3 May 2012, Jonathan D Reed wrote:
>>
>>> Modified: trunk/third/moira/clients/moira/main.c
>>> ===================================================================
>>> --- trunk/third/moira/clients/moira/main.c	2012-05-03 17:15:39 UTC (rev 25471)
>>> +++ trunk/third/moira/clients/moira/main.c	2012-05-03 19:38:03 UTC (rev 25472)
>>> @@ -116,7 +116,7 @@
>>> 	if (status == MR_USER_AUTH)
>>> 	  {
>>> 	    char buf[BUFSIZ];
>>> -	    com_err(program_name, status, "\nPress [RETURN] to continue");
>>> +	    com_err(program_name, status, "%s", "\nPress [RETURN] to continue");
>>> 	    fgets(buf, BUFSIZ, stdin);
>>> 	  }
>>> 	else
>>
>> Huh?
>>
>>> Modified: trunk/third/moira/clients/mrtest/mrtest.c
>>> ===================================================================
>>> --- trunk/third/moira/clients/mrtest/mrtest.c	2012-05-03 17:15:39 UTC (rev 25471)
>>> +++ trunk/third/moira/clients/mrtest/mrtest.c	2012-05-03 19:38:03 UTC (rev 25472)
>>> @@ -373,7 +373,7 @@
>>>  if (!inp)
>>>    {
>>>      sprintf(input, "Cannot open input file %s", argv[1]);
>>> -      com_err("moira (script)", 0, input);
>>> +      com_err("moira (script)", 0, "%s", input);
>>>      return;
>>>    }
>>
>> This seems a little redundant...
>>
>>> @@ -390,7 +390,7 @@
>>> 	  dup2(oldstdout, 1);
>>> 	  argc = 2;
>>> 	  sprintf(input, "Unable to redirect output to %s\n", argv[2]);
>>> -	  com_err("moira (script)", errno, input);
>>> +	  com_err("moira (script)", errno, "%s", input);
>>> 	}
>>>      else
>>> 	{
>>>
>>
>> As does this
>>
>>> Modified: trunk/third/moira/debian/changelog
>>> ===================================================================
>>> --- trunk/third/moira/debian/changelog	2012-05-03 17:15:39 UTC (rev 25471)
>>> +++ trunk/third/moira/debian/changelog	2012-05-03 19:38:03 UTC (rev 25472)
>>> @@ -1,3 +1,9 @@
>>> +debathena-moira (4.0.0-r4073-0debathena2) unstable; urgency=low
>>> +
>>> +  * Make -Werror=format-security happy
>>> +
>>> + -- Jonathan Reed <jdreed@mit.edu>  Thu, 03 May 2012 15:37:54 -0400
>>> +
>>> debathena-moira (4.0.0-r4073-0debathena1) unstable; urgency=low
>>>
>>>  * Re-snapshot moira at r4073 to pick up new changes to clients; the
>>>
>>
>> BTW, I'm not thrilled about modifying files outside of debian/. If you can get this upstream before next time we snapshot, that's fine; otherwise we risk these changes ending up in an orig tarball.
>>
>> --
>> Geoffrey Thomas
>> geofft@mit.edu
>
>

home help back first fref pref prev next nref lref last post