Mailinglist Archive: opensuse-buildservice (339 mails)

< Previous Next >
Re: [opensuse-buildservice] osc on local obs fails at pkg creation
  • From: Marcus Hüwe <suse-tux@xxxxxx>
  • Date: Sat, 29 Mar 2008 16:54:10 +0100
  • Message-id: <20080329155410.GC3705@xxxxxxxxxxxxxxxxxxx>
On 2008-03-29 16:12:00 +0100, Jan-Simon Möller wrote:
Am Samstag, 29. März 2008 15:55:46 schrieb Marcus Hüwe:
[...]

No. I just wanted to point out that the error message is correct in this
case because the authentication was fine. The problem occurs when it tries
to "save" the package in the database because "admin" and "Admin" result in
the same user object (because the query isn't case sensitive), so it'll try
to add the same user 2 times.. and this finally leads to the duplicate key
error.

So why not block access in the first place to avoid this error later in the
process ?
Hmm yes.. I don't know if it is intended to have this part case insensitive.
Anyway I attached a small patch which makes the user lookup case sensitive...

If }Tux{ did not have the right idea i would still bang my head on this
issue ;) .

hehe - yes this bug/feature was quite tricky to hunt down;)


Marcus
Index: lib/active_rbac_mixins/user_mixins.rb
===================================================================
--- lib/active_rbac_mixins/user_mixins.rb (Revision 3592)
+++ lib/active_rbac_mixins/user_mixins.rb (Arbeitskopie)
@@ -296,7 +296,7 @@
def self.find_with_credentials(login, password)
# Find user
user = User.find :first,
- :conditions => [ 'login = ?', login ]
+ :conditions => [ 'login = BINARY ?', login ]

# If the user could be found and the passwords equal then return
the user
if not user.nil? and user.password_equals? password
< Previous Next >