Fix critical bug

This commit is contained in:
topjohnwu 2017-12-05 05:32:15 +08:00
parent 4672a5fad6
commit 39a6bd33ce
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ int cpio_commands(const char *command, int argc, char *argv[]) {
parse_cpio(&v, incpio); parse_cpio(&v, incpio);
if (strcmp(command, "test") == 0) { if (strcmp(command, "test") == 0) {
return cpio_test(&v); exit(cpio_test(&v));
} else if (strcmp(command, "restore") == 0) { } else if (strcmp(command, "restore") == 0) {
ret = cpio_restore(&v); ret = cpio_restore(&v);
} else if (strcmp(command, "stocksha1") == 0) { } else if (strcmp(command, "stocksha1") == 0) {

View File

@ -260,7 +260,7 @@ int getattrat(int dirfd, const char *pathname, struct file_attr *a) {
} }
int fgetattr(int fd, struct file_attr *a) { int fgetattr(int fd, struct file_attr *a) {
#ifndef NO_SELINUX #ifdef SELINUX
char path[PATH_MAX]; char path[PATH_MAX];
fd_getpath(fd, path, sizeof(path)); fd_getpath(fd, path, sizeof(path));
return getattr(path, a); return getattr(path, a);