Fix login.
This commit is contained in:
@@ -1488,7 +1488,7 @@ static vfs_file_t *ext2_open(const char *path, int flags, mode_t mode)
|
||||
}
|
||||
ext2_dirent_t direntry;
|
||||
memset(&direntry, 0, sizeof(ext2_dirent_t));
|
||||
if (ext2_resolve_path(sb_root, absolute_path, &direntry)) {
|
||||
if (ext2_resolve_path(sb_root, absolute_path, &direntry) == -1) {
|
||||
pr_err("ext2_open(%s): Failed to find path `%s`.\n", path, absolute_path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ static inline int setup_env(passwd_t *pwd)
|
||||
printf( "Failed to set env: `SHELL`\n");
|
||||
return 0;
|
||||
}
|
||||
sprintf(env_buffer, "/home/%s", pwd->pw_name);
|
||||
if (setenv("HOME", env_buffer, 0) == -1) {
|
||||
// Set the HOME.
|
||||
if (setenv("HOME", pwd->pw_dir, 0) == -1) {
|
||||
printf("Failed to set env: `HOME`\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -332,7 +332,7 @@ static int __cd(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
// Set current working directory.
|
||||
fchdir(fd);
|
||||
chdir(path);
|
||||
close(fd);
|
||||
// Get the updated working directory.
|
||||
char cwd[PATH_MAX];
|
||||
|
||||
Reference in New Issue
Block a user