mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-19 09:51:19 +02:00
feat: add config path to PAM module
This commit is contained in:
parent
d0ca17b1ec
commit
a92a3aade2
4 changed files with 10 additions and 7 deletions
|
@ -9,6 +9,8 @@ usermodelsdir = get_option('user_models_dir') != '' ? get_option('user_models_di
|
||||||
datadir = get_option('data_dir') != '' ? get_option('data_dir') : join_paths(get_option('prefix'), get_option('datadir'), 'howdy')
|
datadir = get_option('data_dir') != '' ? get_option('data_dir') : join_paths(get_option('prefix'), get_option('datadir'), 'howdy')
|
||||||
logpath = get_option('log_path')
|
logpath = get_option('log_path')
|
||||||
|
|
||||||
|
config_path = join_paths(confdir, 'config.ini')
|
||||||
|
|
||||||
py_conf = configuration_data({
|
py_conf = configuration_data({
|
||||||
'config_dir': confdir,
|
'config_dir': confdir,
|
||||||
'dlib_data_dir': dlibdatadir,
|
'dlib_data_dir': dlibdatadir,
|
||||||
|
@ -57,7 +59,10 @@ else
|
||||||
pysourcesinstalldir = get_option('py_sources_dir') != '' ? get_option('py_sources_dir') : join_paths(get_option('prefix'), get_option('libdir'), 'howdy')
|
pysourcesinstalldir = get_option('py_sources_dir') != '' ? get_option('py_sources_dir') : join_paths(get_option('prefix'), get_option('libdir'), 'howdy')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
compare_script_path = join_paths(pysourcesinstalldir, 'compare.py')
|
pam_module_conf_data = configuration_data({
|
||||||
|
'compare_script_path': join_paths(pysourcesinstalldir, 'compare.py') ,
|
||||||
|
'config_file_path': config_path,
|
||||||
|
})
|
||||||
subdir('pam')
|
subdir('pam')
|
||||||
|
|
||||||
if get_option('install_in_site_packages')
|
if get_option('install_in_site_packages')
|
||||||
|
@ -81,7 +86,6 @@ endif
|
||||||
install_data('logo.png', install_tag: 'meta')
|
install_data('logo.png', install_tag: 'meta')
|
||||||
|
|
||||||
fs = import('fs')
|
fs = import('fs')
|
||||||
config_path = join_paths(confdir, 'config.ini')
|
|
||||||
if not fs.exists(config_path)
|
if not fs.exists(config_path)
|
||||||
install_data('config.ini', install_dir: confdir, install_mode: 'rwxr--r--', install_tag: 'config')
|
install_data('config.ini', install_dir: confdir, install_mode: 'rwxr--r--', install_tag: 'config')
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -197,7 +197,7 @@ auto check_enabled(const INIReader &config) -> int {
|
||||||
*/
|
*/
|
||||||
auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
|
auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
|
||||||
bool auth_tok) -> int {
|
bool auth_tok) -> int {
|
||||||
INIReader config("/etc/howdy/config.ini");
|
INIReader config(CONFIG_FILE_PATH);
|
||||||
openlog("pam_howdy", 0, LOG_AUTHPRIV);
|
openlog("pam_howdy", 0, LOG_AUTHPRIV);
|
||||||
|
|
||||||
// Error out if we could not read the config file
|
// Error out if we could not read the config file
|
||||||
|
|
|
@ -7,12 +7,10 @@ threads = dependency('threads')
|
||||||
subdir('po')
|
subdir('po')
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
paths = { 'compare_script_path': compare_script_path }
|
|
||||||
|
|
||||||
paths_h = configure_file(
|
paths_h = configure_file(
|
||||||
input: 'paths.hh.in',
|
input: 'paths.hh.in',
|
||||||
output: 'paths.hh',
|
output: 'paths.hh',
|
||||||
configuration: paths,
|
configuration: pam_module_conf_data,
|
||||||
install_dir: get_option('pam_dir')
|
install_dir: get_option('pam_dir')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
const auto COMPARE_PROCESS_PATH = "@compare_script_path@";
|
const auto COMPARE_PROCESS_PATH = "@compare_script_path@";
|
||||||
|
const auto CONFIG_FILE_PATH = "@config_file_path@";
|
Loading…
Reference in a new issue