summaryrefslogtreecommitdiff
path: root/lib/ipmi_user.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 22:59:06 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 22:59:06 +0200
commita7c8ed90be739a49937a229828c470f1ad01396e (patch)
tree4cd43ff357d98a1ce5afb3bb9449afcce5a299d1 /lib/ipmi_user.c
parentfa5ac2da06fae952fe1295a1e955bdb35e6d86c4 (diff)
parent342ebce798fe98ede64939a49bbc3770d8214649 (diff)
Merge tag 'upstream/1.8.17'
Upstream version 1.8.17
Diffstat (limited to 'lib/ipmi_user.c')
-rw-r--r--lib/ipmi_user.c15
1 files changed, 13 insertions, 2 deletions
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 <stdlib.h>
#include <string.h>
@@ -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