From: Andreas Steffen Date: Sun, 26 Jul 2015 09:38:06 +0000 (+0200) Subject: Add default password determination capability to os_info X-Git-Tag: 5.3.3dr6~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b68719dd359b8ea8d068f40db4191c64af7f3cb;p=thirdparty%2Fstrongswan.git Add default password determination capability to os_info --- diff --git a/src/libimcv/imc/imc_os_info.c b/src/libimcv/imc/imc_os_info.c index 47697f1a3a..e0579b4d9d 100644 --- a/src/libimcv/imc/imc_os_info.c +++ b/src/libimcv/imc/imc_os_info.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Andreas Steffen + * Copyright (C) 2012-2015 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -196,6 +196,14 @@ METHOD(imc_os_info_t, get_fwd_status, os_fwd_status_t, return fwd_status; } +METHOD(imc_os_info_t, get_default_pwd_status, bool, + private_imc_os_info_t *this) +{ + /* As an option the default password status can be configured manually */ + return lib->settings->get_bool(lib->settings, + "%s.imcv.os_info.default_password_enabled", FALSE, lib->ns); +} + METHOD(imc_os_info_t, get_uptime, time_t, private_imc_os_info_t *this) { @@ -618,6 +626,7 @@ imc_os_info_t *imc_os_info_create(void) .get_numeric_version = _get_numeric_version, .get_version = _get_version, .get_fwd_status = _get_fwd_status, + .get_default_pwd_status = _get_default_pwd_status, .get_uptime = _get_uptime, .get_setting = _get_setting, .create_package_enumerator = _create_package_enumerator, diff --git a/src/libimcv/imc/imc_os_info.h b/src/libimcv/imc/imc_os_info.h index 6bb0e960cd..ef7fb6d435 100644 --- a/src/libimcv/imc/imc_os_info.h +++ b/src/libimcv/imc/imc_os_info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Andreas Steffen + * Copyright (C) 2012-2015 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -71,6 +71,13 @@ struct imc_os_info_t { */ os_fwd_status_t (*get_fwd_status)(imc_os_info_t *this); + /** + * Get the default password status + * + * @return TRUE if enabled, FALSE otherwise + */ + bool (*get_default_pwd_status)(imc_os_info_t *this); + /** * Get the OS uptime in seconds *