Changeset 56540 in webkit


Ignore:
Timestamp:
Mar 25, 2010 7:13:56 AM (14 years ago)
Author:
jchaffraix@webkit.org
Message:

commit-log-editor can call itself in an infinite loop
https://bugs.webkit.org/show_bug.cgi?id=35291

Reviewed by Kenneth Rohde Christiansen.

if $editor ends up being commit-log-editor, the script will exec itself
in an infinite loop.

To avoid this, we now check that the $editor variable is not
commit-log-editor to avoid this case.

  • Scripts/commit-log-editor: Added an isCommitLogEditor method and

reworked the $editor setting to add this check.

Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r56539 r56540  
     12010-03-25  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        commit-log-editor can call itself in an infinite loop
     6        https://bugs.webkit.org/show_bug.cgi?id=35291
     7
     8        if $editor ends up being commit-log-editor, the script will exec itself
     9        in an infinite loop.
     10
     11        To avoid this, we now check that the $editor variable is not
     12        commit-log-editor to avoid this case.
     13
     14        * Scripts/commit-log-editor: Added an isCommitLogEditor method and
     15        reworked the $editor setting to add this check.
     16
    1172010-03-25  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    218
  • trunk/WebKitTools/Scripts/commit-log-editor

    r56484 r56540  
    4141sub normalizeLineEndings($$);
    4242sub removeLongestCommonPrefixEndingInDoubleNewline(\%);
     43sub isCommitLogEditor($);
    4344
    4445sub usage
     
    6263
    6364my $editor = $ENV{SVN_LOG_EDITOR};
    64 if (!$editor) {
     65if (!$editor || isCommitLogEditor($editor)) {
    6566    $editor = $ENV{CVS_LOG_EDITOR};
    6667}
    67 if (!$editor) {
     68if (!$editor || isCommitLogEditor($editor)) {
    6869    my $builtEditorApplication = "$baseDir/Release/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
    6970    $editor = $builtEditorApplication if -x $builtEditorApplication;
    7071}
    71 if (!$editor) {
     72if (!$editor || isCommitLogEditor($editor)) {
    7273    my $builtEditorApplication = "$baseDir/Debug/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
    7374    $editor = $builtEditorApplication if -x $builtEditorApplication;
    7475}
    75 if (!$editor) {
     76if (!$editor || isCommitLogEditor($editor)) {
    7677    my $installedEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
    7778    $editor = $installedEditorApplication if -x $installedEditorApplication;
    7879}
    79 if (!$editor) {
    80     $editor = $ENV{EDITOR} || "/usr/bin/vi";
     80if (!$editor || isCommitLogEditor($editor)) {
     81    $editor = $ENV{EDITOR};
     82}
     83if (!$editor || isCommitLogEditor($editor)) {
     84    $editor = "/usr/bin/vi";
    8185}
    8286
     
    308312    return substr($prefix, 0, $lastDoubleNewline + 2);
    309313}
     314
     315sub isCommitLogEditor($)
     316{
     317    my $editor = shift;
     318    printf $editor . "\n";
     319    return $editor =~ m/commit-log-editor/;
     320}
Note: See TracChangeset for help on using the changeset viewer.