diff options
author | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:01:03 +0900 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:01:03 +0900 |
commit | 9e02a7ee2335ba91e5bd0cbb79ab8a5a58f57bde (patch) | |
tree | c41616f855d66609896236dfefb63defcff53f33 /device-functions.c | |
parent | 5d5d9873f31ae857e0cd713f529f12407a6936a1 (diff) |
file root normally read-only now, for safe power-off. Major OS changes too.INSTRUMENT_6_2_00
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/device-functions.c b/device-functions.c index ac4a9b4..061f759 100644 --- a/device-functions.c +++ b/device-functions.c @@ -4492,25 +4492,32 @@ int change_password(gchar *old_password, gchar *new_password) struct lu_error *error = NULL; struct lu_ent *ent; + int result; + result = OK; + + remount_root_as_writeable (); + ctx = lu_start(user, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (ctx == NULL ) { - return password_change_error; + result = password_change_error; } ent = lu_ent_new(); - if (lu_user_lookup_name(ctx, user, ent, &error) == FALSE) { - return password_change_error; // user doesn't exist + if (!result && (lu_user_lookup_name(ctx, user, ent, &error) == FALSE)) { + result = password_change_error; // user doesn't exist } - if (lu_user_setpass(ctx, ent, new_password, FALSE, &error) == FALSE) { - return password_change_error; + if (!result && (lu_user_setpass(ctx, ent, new_password, FALSE, &error) == FALSE)) { + result = password_change_error; } lu_end(ctx); - return OK; + remount_root_as_not_writeable (); + + return result; } else { return password_change_error; } |