Project

General

Profile

Actions

Bug #30064

closed

RootRepository password length too short

Added by Partha Aji over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

The upstream_password in the root repository table was created to hold auto generated keys of 760 characters and above 1024. However check the code here

[1] pry(main)> a = Katello::RootRepository.last
=> #<Katello::RootRepository:0x0000000010baad50
 id: 5,
 ....
 ....
 http_proxy_id: nil>

[4] pry(main)> a.upstream_password = "A"*500
=> "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" 
[5] pry(main)> a.save!
ActiveRecord::ValueTooLong: PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1024)

from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
Caused by PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1024)

from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'

  • Create a root repository and give it an upstream password > 500 characters.

Expected:
Works well

Actual:
Fails with "value too long for type character varying(1024)" error

Note:
password in the http_proxies table does not have a limit
password | character varying | | |

While root repository does.

upstream_password | character varying(1024) | | |
h


Related issues 1 (0 open1 closed)

Related to Katello - Bug #29931: Root repository upstream password saved in clear textClosedPiyush TiwariActions
Actions

Also available in: Atom PDF