continue;
if (!(u = normalize_env_assignment(p))) {
- log_error("Out of memory");
+ log_error("Out of memory.");
r = -ENOMEM;
goto finish;
}
free(u);
if (!t) {
- log_error("Out of memory");
+ log_error("Out of memory.");
r = -ENOMEM;
goto finish;
}
continue;
if (asprintf(&path, "%s/%s", directory, de->d_name) < 0) {
- log_error("Out of memory");
+ log_error("Out of memory.");
continue;
}
return 0;
}
-int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) {
+int get_user_creds(
+ const char **username,
+ uid_t *uid, gid_t *gid,
+ const char **home,
+ const char **shell) {
+
struct passwd *p;
uid_t u;
if (home)
*home = "/root";
+
+ if (shell)
+ *shell = "/bin/sh";
+
return 0;
}
if (home)
*home = p->pw_dir;
+ if (shell)
+ *shell = p->pw_shell;
+
return 0;
}