- if (!name) {
- log_error("[%s:%u] Lines of type 'm' require a user name in the second field.", fname, line);
- return -EINVAL;
- }
-
- if (!resolved_id) {
- log_error("[%s:%u] Lines of type 'm' require a group name in the third field.", fname, line);
- return -EINVAL;
- }
-
- if (!valid_user_group_name(resolved_id)) {
- log_error("[%s:%u] '%s' is not a valid user or group name.", fname, line, resolved_id);
- return -EINVAL;
- }
-
- if (description || home || shell) {
- log_error("[%s:%u] Lines of type '%c' don't take a %s field.",
- fname, line, action[0],
- description ? "GECOS" : home ? "home directory" : "login shell");
- return -EINVAL;
- }
+ if (!name)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "[%s:%u] Lines of type 'm' require a user name in the second field.",
+ fname, line);
+
+ if (!resolved_id)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "[%s:%u] Lines of type 'm' require a group name in the third field.",
+ fname, line);
+
+ if (!valid_user_group_name(resolved_id))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "[%s:%u] '%s' is not a valid user or group name.",
+ fname, line, resolved_id);
+
+ if (description || home || shell)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "[%s:%u] Lines of type '%c' don't take a %s field.",
+ fname, line, action[0],
+ description ? "GECOS" : home ? "home directory" : "login shell");