diff --git a/nlplug-findfs.c b/nlplug-findfs.c index b11b7b8..fd8f18f 100644 --- a/nlplug-findfs.c +++ b/nlplug-findfs.c @@ -527,6 +527,7 @@ static int find_apkovl(const char *dir, const char *outfile) char pattern[PATH_MAX]; glob_t gl; int r, fd; + int rc = 0; if (outfile == NULL) return 0; @@ -542,13 +543,21 @@ static int find_apkovl(const char *dir, const char *outfile) err(1, "%s", outfile); for (r = 0; r < gl.gl_pathc; r++) { - dbg("Found apkovl: %s", gl.gl_pathv[r]); - write(fd, gl.gl_pathv[r], strlen(gl.gl_pathv[r])); + const char *filename = gl.gl_pathv[r]; + int len = strlen(filename); + dbg("Found apkovl: %s", filename); + write(fd, filename, len); write(fd, "\n", 1); + /* we don't indicate that apkovl was found if we find + encrypted apkovls, because we need load keyboard drivers + before we exit + */ + if (len>=7 && strcmp(&filename[len - 7], ".tar.gz") == 0) + rc = FOUND_APKOVL; } close(fd); globfree(&gl); - return FOUND_APKOVL; + return rc; } static int find_bootrepos(const char *devnode, const char *type,