public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* patch for missing 'chek' prior to edit
@ 2003-03-09  4:42 Mel Hatzis
  2003-03-16 17:48 ` Lars Henriksen
  0 siblings, 1 reply; 3+ messages in thread
From: Mel Hatzis @ 2003-03-09  4:42 UTC (permalink / raw)
  To: Yngve Svendsen; +Cc: 'help-gnats@gnu.org'

Please review the following patch which fixes a bug whereby
a 'chek' is not performed when submitting an edited PR.

I noticed that 'chek initial' is done for submitnewpr but
there's no 'chek' for submitedit. This means that field
validation based on the the field definitions in the dbconfig
is not performed for PR edits.

Here's the patch...

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.120
diff -u -p -r1.120 gnatsweb.pl
--- gnatsweb.pl 8 Jan 2003 13:04:17 -0000       1.120
+++ gnatsweb.pl 9 Mar 2003 04:37:01 -0000
@@ -1808,6 +1808,10 @@ sub submitedit

     # Submit the edits.  We need to unlock the PR even if the edit fails
     local($suppress_client_exit) = 1;
+        client_cmd("chek");
+        last LOCKED if ($client_would_have_exited);
+        client_cmd("$newpr\n.");
+        last LOCKED if ($client_would_have_exited);
        client_cmd("editaddr $db_prefs{'user'}");
        last LOCKED if ($client_would_have_exited);
     client_cmd("edit $pr");

--
Mel Hatzis



_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch for missing 'chek' prior to edit
  2003-03-09  4:42 patch for missing 'chek' prior to edit Mel Hatzis
@ 2003-03-16 17:48 ` Lars Henriksen
  2003-03-16 20:03   ` Mel Hatzis
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Henriksen @ 2003-03-16 17:48 UTC (permalink / raw)
  To: Mel Hatzis; +Cc: 'help-gnats@gnu.org', Yngve Svendsen

On Sat, Mar 08, 2003 at 08:37:22PM -0800, Mel Hatzis wrote:
> Please review the following patch which fixes a bug whereby
> a 'chek' is not performed when submitting an edited PR.

The check is done by gnatsd itself as part of the EDIT command.

> I noticed that 'chek initial' is done for submitnewpr

Yes, I filed this fix with PR 386 some time back:
<http://bugs.gnu.org/cgi-bin/gnatsweb.pl?debug=&database=gnats&cmd=view+audit-trail&cmd=view&pr=386>

This was the easiest way out, but maybe the proper way is to correct
the submit_pr() function to perform the check for the SUBM command
as done by replace_pr() for the EDIT command.

>                                                        but
> there's no 'chek' for submitedit. This means that field
> validation based on the the field definitions in the dbconfig
> is not performed for PR edits.

Did you try? At least validation works for text fields with matching
regexps.

> 
> Here's the patch...
> 
> Index: gnatsweb.pl
> ===================================================================
> RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
> retrieving revision 1.120
> diff -u -p -r1.120 gnatsweb.pl
> --- gnatsweb.pl 8 Jan 2003 13:04:17 -0000       1.120
> +++ gnatsweb.pl 9 Mar 2003 04:37:01 -0000
> @@ -1808,6 +1808,10 @@ sub submitedit
> 
>     # Submit the edits.  We need to unlock the PR even if the edit fails
>     local($suppress_client_exit) = 1;
> +        client_cmd("chek");
> +        last LOCKED if ($client_would_have_exited);
> +        client_cmd("$newpr\n.");
> +        last LOCKED if ($client_would_have_exited);
>        client_cmd("editaddr $db_prefs{'user'}");
>        last LOCKED if ($client_would_have_exited);
>     client_cmd("edit $pr");

Lars Henriksen


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch for missing 'chek' prior to edit
  2003-03-16 17:48 ` Lars Henriksen
@ 2003-03-16 20:03   ` Mel Hatzis
  0 siblings, 0 replies; 3+ messages in thread
From: Mel Hatzis @ 2003-03-16 20:03 UTC (permalink / raw)
  To: Lars Henriksen; +Cc: 'help-gnats@gnu.org', Yngve Svendsen

On 03/16/2003 09:47 AM, Lars Henriksen submitted:

>On Sat, Mar 08, 2003 at 08:37:22PM -0800, Mel Hatzis wrote:
>  
>
>>Please review the following patch which fixes a bug whereby
>>a 'chek' is not performed when submitting an edited PR.
>>    
>>
>
>The check is done by gnatsd itself as part of the EDIT command.
>  
>
You're right....I overlooked this entirely after reviewing the
gnatsweb code and noticing the inconsistency between the 'create'
and the 'edit'.

>  
>
>>I noticed that 'chek initial' is done for submitnewpr
>>    
>>
>
>Yes, I filed this fix with PR 386 some time back:
><http://bugs.gnu.org/cgi-bin/gnatsweb.pl?debug=&database=gnats&cmd=view+audit-trail&cmd=view&pr=386>
>
>This was the easiest way out, but maybe the proper way is to correct
>the submit_pr() function to perform the check for the SUBM command
>as done by replace_pr() for the EDIT command.
>
Agreed.

>
>  
>
>>                                                       but
>>there's no 'chek' for submitedit. This means that field
>>validation based on the the field definitions in the dbconfig
>>is not performed for PR edits.
>>    
>>
>
>Did you try? At least validation works for text fields with matching
>regexps.
>  
>
Apologies for the oversight....it all seems to be working as coded.

--
Mel Hatzis

>  
>
>>Here's the patch...
>>
>>Index: gnatsweb.pl
>>===================================================================
>>RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
>>retrieving revision 1.120
>>diff -u -p -r1.120 gnatsweb.pl
>>--- gnatsweb.pl 8 Jan 2003 13:04:17 -0000       1.120
>>+++ gnatsweb.pl 9 Mar 2003 04:37:01 -0000
>>@@ -1808,6 +1808,10 @@ sub submitedit
>>
>>    # Submit the edits.  We need to unlock the PR even if the edit fails
>>    local($suppress_client_exit) = 1;
>>+        client_cmd("chek");
>>+        last LOCKED if ($client_would_have_exited);
>>+        client_cmd("$newpr\n.");
>>+        last LOCKED if ($client_would_have_exited);
>>       client_cmd("editaddr $db_prefs{'user'}");
>>       last LOCKED if ($client_would_have_exited);
>>    client_cmd("edit $pr");
>>    
>>
>
>Lars Henriksen
>  
>




_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-16 20:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-09  4:42 patch for missing 'chek' prior to edit Mel Hatzis
2003-03-16 17:48 ` Lars Henriksen
2003-03-16 20:03   ` Mel Hatzis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).