[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at d5f3455b305d739a63d7d7d5c08544fe895176e8

Michael DeHaan mdehaan at redhat.com
Mon Jun 25 21:40:04 UTC 2007


Hello,

This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.

Updating branch, master,
       via  d5f3455b305d739a63d7d7d5c08544fe895176e8 (commit)
      from  12ba71581085f500cb11afea4c8308dac252493e (commit)

- Log -----------------------------------------------------------------
commit d5f3455b305d739a63d7d7d5c08544fe895176e8
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date:   Mon Jun 25 17:41:30 2007 -0400

    Do not insert a row into the sessions database until the password
    has been checked.
-----------------------------------------------------------------------

Diffstat:
 service/modules/authentication.py |   14 +++++++-------
 service/modules/machine.py        |    1 +
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/service/modules/authentication.py b/service/modules/authentication.py
index 9bb9542..14335ef 100755
--- a/service/modules/authentication.py
+++ b/service/modules/authentication.py
@@ -57,13 +57,6 @@ class Authentication(web_svc.WebSvc):
          try:
              query = session.query(db.User)
              user = query.selectfirst_by(username=username)
-             if user is not None:
-                 ssn = db.Session()
-                 ssn.user_id = user.id
-                 ssn.session_token = token
-                 user.sessions.append(ssn)
-                 session.save(ssn)
-                 session.flush()
          finally:
              session.close()
              
@@ -71,6 +64,13 @@ class Authentication(web_svc.WebSvc):
              raise UserInvalidException(comment=username)
          if password != user.password:
              raise PasswordInvalidException(comment=username)
+          
+         ssn = db.Session()
+         ssn.user_id = user.id
+         ssn.session_token = token
+         user.sessions.append(ssn)
+         session.save(ssn)
+         session.flush()
          
          self.cleanup_old_sessions()
          
diff --git a/service/modules/machine.py b/service/modules/machine.py
index abdbace..47083a0 100755
--- a/service/modules/machine.py
+++ b/service/modules/machine.py
@@ -415,6 +415,7 @@ class Machine(web_svc.AuthWebSvc):
         FieldValidator(args).verify_required(required)
         session = db.open_session()
         try:
+            self.logger.info(args)
             machine = db.Machine.get(session, args['id'])
             return codes.success(machine.get_hash())
         finally:

hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
  12ba71581085f500cb11afea4c8308dac252493e \
  d5f3455b305d739a63d7d7d5c08544fe895176e8




More information about the Et-mgmt-commits-list mailing list