homed: reset HomeSetup.undo_dm field when deactivating home dir the official way
There are two ways to deactivate a home dir: the official way if someone calls "homectl deactivate" or something similar. Or the error-case/side-effect code path, where we unwind exactly what we already set up. The .undo_dm field is supposed to tell us whether we shall still detach the DM device. We forgot to update it in the official code path. Add that. (We did it correctly in the error case codepath already). (The issue is minor: if we forget to reset it in the clean code path, then we'll try to unmount again what is already unmounted in the error code paths, but since we ignore errors there — to not "stack" errors – we never noticed and there's no bad effect of it)
This commit is contained in:
committed by
Yu Watanabe
parent
50e67237a7
commit
228b1decc6
@@ -1509,6 +1509,8 @@ int home_deactivate_luks(UserRecord *h, HomeSetup *setup) {
|
||||
}
|
||||
}
|
||||
|
||||
setup->undo_dm = false;
|
||||
|
||||
if (user_record_luks_offline_discard(h))
|
||||
log_debug("Not allocating on logout.");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user