Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
hawk2.17671
0001-Improve-controllers.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Improve-controllers.patch of Package hawk2.17671
From 2522460e50f61333cc8a940a385b2c77a7f4f301 Mon Sep 17 00:00:00 2001 From: dmaiocchi <dmaiocchi@suse.com> Date: Tue, 15 Dec 2020 17:44:37 +0100 Subject: [PATCH] Improve controllers --- hawk/app/controllers/application_controller.rb | 3 ++- hawk/app/controllers/sessions_controller.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hawk/app/controllers/application_controller.rb b/hawk/app/controllers/application_controller.rb index fd1f2527..259a2a0d 100644 --- a/hawk/app/controllers/application_controller.rb +++ b/hawk/app/controllers/application_controller.rb @@ -185,11 +185,12 @@ class ApplicationController < ActionController::Base not_authenticated unless logged_in? end + def login_from_cookie user = cookies['hawk_remember_me_id'] return if user.nil? # read from attrd - values = %x[/usr/sbin/attrd_updater -R -Q -A -n "hawk_session_#{user}"].scan(/value=\"(.*)\"/).flatten(1) + values = system("/usr/sbin/attrd_updater", "-R", "-Q","-A", "-n", "hawk_session_#{user}").scan(/value=\"(.*)\"/).flatten(1) user if values.include? cookies['hawk_remember_me_key'] end diff --git a/hawk/app/controllers/sessions_controller.rb b/hawk/app/controllers/sessions_controller.rb index 614fcb1b..f38de314 100644 --- a/hawk/app/controllers/sessions_controller.rb +++ b/hawk/app/controllers/sessions_controller.rb @@ -62,7 +62,7 @@ class SessionsController < ApplicationController end # delete remember-me keys from cluster nodes by overwriting them with a random number random_value = SecureRandom.hex(128) - system("/usr/sbin/attrd_updater -R -p -n \"hawk_session_#{cookies['hawk_remember_me_id']}\" -U \"#{random_value}\"") + system("/usr/sbin/attrd_updater", "-R", "-p", "-n", "hawk_session_#{cookies['hawk_remember_me_id']}", "-U", "#{random_value}") cookies.delete :hawk_remember_me_id cookies.delete :hawk_remember_me_key session[:username] = nil -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor