Bug 40095 - webkit-patch apply-from-bug / apply-attachment should not ask for credentials if none are required
Summary: webkit-patch apply-from-bug / apply-attachment should not ask for credentials...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 18:30 PDT by James Robinson
Modified: 2015-07-06 12:07 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.57 KB, patch)
2014-07-01 05:12 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2010-06-02 18:30:05 PDT
Currently when running webkit-patch apply-from-bug or apply-attachment I am always prompted for access to bugzilla credentials.  These are not needed to simply download a patch unless the bug is restricted and so the default should be to not prompt unless webkit-patch gets a 403 when trying to fetch the patch or attachment.
Comment 1 youenn fablet 2014-07-01 05:12:55 PDT
Created attachment 234158 [details]
Patch
Comment 2 Csaba Osztrogonác 2014-07-01 07:52:25 PDT
Comment on attachment 234158 [details]
Patch

It was so annoying for me to, r=me.
Comment 3 WebKit Commit Bot 2014-07-01 08:23:08 PDT
Comment on attachment 234158 [details]
Patch

Clearing flags on attachment: 234158

Committed r170639: <http://trac.webkit.org/changeset/170639>
Comment 4 WebKit Commit Bot 2014-07-01 08:23:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Daniel Bates 2015-07-06 09:59:12 PDT
(In reply to comment #3)
> Comment on attachment 234158 [details]
> Patch
> 
> Clearing flags on attachment: 234158
> 
> Committed r170639: <http://trac.webkit.org/changeset/170639>

This patch broke using webkit-patch apply-attachment to apply an attachment from a security bug:

dbates2-ruby:OpenSource dbates$ Tools/Scripts/webkit-patch apply-attachment --no-update 255825
Fetching: https://bugs.webkit.org/attachment.cgi?id=255825&action=edit
Traceback (most recent call last):
  File "Tools/Scripts/webkit-patch", line 84, in <module>
    main()
  File "Tools/Scripts/webkit-patch", line 79, in main
    WebKitPatch(os.path.abspath(__file__)).main()
  File "/Volumes/Data/WebKitDevGit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 305, in main
    result = command.check_arguments_and_execute(options, args, self)
  File "/Volumes/Data/WebKitDevGit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 123, in check_arguments_and_execute
    return self.execute(options, args, tool) or 0
  File "/Volumes/Data/WebKitDevGit/OpenSource/Tools/Scripts/webkitpy/tool/commands/download.py", line 173, in execute
    bugs_to_patches = self._collect_patches_by_bug(patches)
  File "/Volumes/Data/WebKitDevGit/OpenSource/Tools/Scripts/webkitpy/tool/commands/download.py", line 165, in _collect_patches_by_bug
    bugs_to_patches[patch.bug_id()] = bugs_to_patches.get(patch.bug_id(), []) + [patch]
AttributeError: 'NoneType' object has no attribute 'bug_id'
Comment 6 Daniel Bates 2015-07-06 10:05:58 PDT
The patch (attachment #234158 [details]) assumes that Bugzilla will return a web page with a non-HTTP 200 status code when authentication is required. Bugzilla always returns a page with an HTTP 200 status code regardless of whether authentication is required.
Comment 7 Daniel Bates 2015-07-06 10:06:14 PDT
Will rollout patch.
Comment 8 Daniel Bates 2015-07-06 10:11:18 PDT
Reverted r170639 for reason:

Broke using webkit-patch apply-attachment to apply an attachment from a security bug. The patch incorrectly assumed that Bugzilla returns a non-HTTP 200 status code in its HTTP response when authentication is required.

Committed r186356: <http://trac.webkit.org/changeset/186356>
Comment 9 youenn fablet 2015-07-06 10:46:43 PDT
(In reply to comment #8)
> Reverted r170639 for reason:
> 
> Broke using webkit-patch apply-attachment to apply an attachment from a
> security bug. The patch incorrectly assumed that Bugzilla returns a non-HTTP
> 200 status code in its HTTP response when authentication is required.
> 
> Committed r186356: <http://trac.webkit.org/changeset/186356>

With the last bugzilla bump revision, credentials are actually needed for these requests. I guess this bug could be marked as WONTFIX.
Comment 10 Csaba Osztrogonác 2015-07-06 12:07:15 PDT
Unfortunately credentials are always needed with the new bugzilla,
so let's close it as wontfix.