diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-05-08 22:59:02 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-05-08 22:59:02 +0200 |
commit | 342ebce798fe98ede64939a49bbc3770d8214649 (patch) | |
tree | b55927f05ec0d294ababcb2b4519b7e1a628d5f8 /lib/ipmi_user.c | |
parent | 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a (diff) |
Imported Upstream version 1.8.17upstream/1.8.17
Diffstat (limited to 'lib/ipmi_user.c')
-rw-r--r-- | lib/ipmi_user.c | 15 |
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 |