From 342ebce798fe98ede64939a49bbc3770d8214649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 8 May 2016 22:59:02 +0200 Subject: Imported Upstream version 1.8.17 --- lib/ipmi_user.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/ipmi_user.c') diff --git a/lib/ipmi_user.c b/lib/ipmi_user.c index 6074209..2780e61 100644 --- a/lib/ipmi_user.c +++ b/lib/ipmi_user.c @@ -29,6 +29,10 @@ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#define _BSD_SOURCE || \ + (_XOPEN_SOURCE >= 500 || \ + _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \ + !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) #include #include @@ -590,7 +594,7 @@ ipmi_user_priv(struct ipmi_intf *intf, int argc, char **argv) user_access.user_id); return (-1); } else { - printf("Set Privilege Level command successful (user %d)", + printf("Set Privilege Level command successful (user %d)\n", user_access.user_id); return 0; } @@ -602,6 +606,7 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv) /* Disable / Enable */ uint8_t user_id; uint8_t operation; + uint8_t ccode; if (argc != 2) { print_user_usage(); @@ -613,8 +618,14 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv) operation = (strncmp(argv[0], "disable", 7) == 0) ? IPMI_PASSWORD_DISABLE_USER : IPMI_PASSWORD_ENABLE_USER; - return _ipmi_set_user_password(intf, user_id, operation, + ccode = _ipmi_set_user_password(intf, user_id, operation, (char *)NULL, 0); + if (eval_ccode(ccode) != 0) { + lprintf(LOG_ERR, "Set User Password command failed (user %d)", + user_id); + return (-1); + } + return 0; } int -- cgit v1.2.3