プロジェクト

全般

プロフィール

Vote #72477

完了

Redmine.pm fails when permissions are NULL

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM extra_46
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
46
version_id:
47
issue_org_id:
11818
author_id:
23638
assigned_to_id:
1
comments:
5
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Steps to reproduce:

1) Setup SVN access using this guid http://www.redmine.org/projects/redmine/wiki/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl
2) Create a public project "FOO" and a corresponding svn repo
3) Remove all permissions from anonymous user
4) Add user "BAR" as a member of "FOO" project with read svn permissions
5) Execute this SQL query:

SELECT hashed_password, salt, auth_source_id, permissions
FROM projects, users, roles
WHERE users.login='BAR'
AND projects.identifier='FOO'
AND users.status=1
AND
(
  roles.id IN (
                 SELECT member_roles.role_id
                 FROM members, member_roles
                 WHERE members.user_id = users.id
                    AND members.project_id = projects.id
                    AND members.id = member_roles.member_id
              )
  OR   (
           roles.builtin=1 AND
           cast(projects.is_public as CHAR) IN ('t', '1') AND
       )
);

6) Login to http://svn_server/FOO using user "BAR" credentials

Expected behavior:

1) result of query in step 5 has 1 line with non-null permissions
2) I can browse svn via browser

Actual behavior:

1) result of query in step 5 has 2 lines one of which has null permissions
2) I see error 500 in the browser

A patch to fix this problem is attached


journals

Remove redundant "AND" in the SQL query
--------------------------------------------------------------------------------
The error before the patch was:
@Use of uninitialized value $permissions in pattern match (m//) at /usr/lib/perl5/Apache/Redmine.pm line 359, <DATA> line 522.\n@

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fix committed in r10375, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリSCM extra_46 にセット
  • 対象バージョン2.1.0_47 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0