homed: return a better error when a home has no authentication information defined
We can't log into home entries that have no password or PKCS#11 token. Return a proper, useful error in that case. See: #15178
This commit is contained in:
@@ -471,6 +471,8 @@ static int convert_worker_errno(Home *h, int e, sd_bus_error *error) {
|
||||
return sd_bus_error_setf(error, BUS_ERROR_HOME_NOT_ACTIVE, "Home %s is currently not active", h->user_name);
|
||||
case -ENOSPC:
|
||||
return sd_bus_error_setf(error, BUS_ERROR_NO_DISK_SPACE, "Not enough disk space for home %s", h->user_name);
|
||||
case -EKEYREVOKED:
|
||||
return sd_bus_error_setf(error, BUS_ERROR_HOME_CANT_AUTHENTICATE, "Home %s has no password or other authentication mechanism defined.", h->user_name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1489,6 +1489,7 @@ static int run(int argc, char *argv[]) {
|
||||
* EBUSY → file system is currently active
|
||||
* ENOEXEC → file system is currently not active
|
||||
* ENOSPC → not enough disk space for operation
|
||||
* EKEYREVOKED → user record has not suitable hashed password or pkcs#11 entry, we cannot authenticate
|
||||
*/
|
||||
|
||||
if (streq(argv[1], "activate"))
|
||||
|
||||
Reference in New Issue
Block a user