Commit bd76f9f0 authored by paz's avatar paz
Browse files

Merge branch 'paz/replace-dependency-on-hostname-exec' into 'main'

Replace `hostname` and `whoami` by method calls

See merge request !383
parents af6642ce 1cf9df9d
Pipeline #62695 passed with stage
in 5 minutes and 12 seconds
......@@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
* Remove the dependency on bigdecimal, since updating activerecord we don't need it anymore.
* Removed the dependency on the executables `hostname` and `whoami`.
## [4.0.1] / 2021-05-18
......
......@@ -6,6 +6,7 @@
Encoding.default_external = Encoding::UTF_8
# Stdlib
require 'etc'
require 'fileutils'
require 'singleton'
require 'yaml'
......@@ -13,6 +14,7 @@ require 'pathname'
require 'syslog/logger'
require 'logger'
require 'open3'
require 'socket'
# Require mandatory libs. The database-layer-lib is required below.
require 'mail-gpg'
......
......@@ -9,7 +9,7 @@ module Schleuder
def initialize
super('Schleuder', Syslog::LOG_MAIL)
# We need some sender-address different from the superadmin-address.
@from = "#{`whoami`.chomp}@#{`hostname`.chomp}"
@from = "#{Etc.getlogin}@#{Socket.gethostname}"
@adminaddresses = Conf.superadmin
@level = ::Logger.const_get(Conf.log_level.upcase)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment