This commit is contained in:
2024-03-02 20:46:32 -05:00
parent 358997fec1
commit 5d1c324bd7

14
main.c
View File

@@ -30,5 +30,19 @@ int main(int argc, char **argv) {
}
free(filesystems);
guestfs_mount(g, "/dev/sda3", "/");
char *passwd = guestfs_cat(g, "/etc/passwd");
printf("passwd contents:\n\n%s", passwd);
free(passwd);
/* Unmount everything. */
if (guestfs_umount_all(g) == -1)
return EXIT_FAILURE;
guestfs_shutdown(g);
return EXIT_SUCCESS;
}