]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/commonio.c: Diagnose non-text files
authorAlejandro Colomar <alx@kernel.org>
Wed, 11 Mar 2026 22:07:44 +0000 (23:07 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 12 Mar 2026 08:23:57 +0000 (09:23 +0100)
Closes: <https://github.com/shadow-maint/shadow/issues/1581>
Reported-by: Tim Zhou <tizhou@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/commonio.c

index 28dc7324cf10f2dba2ab877ee10b78ba1d481995..88431d20141c083deee5e45de710ecb4d3f4cfa1 100644 (file)
@@ -612,8 +612,10 @@ commonio_open(struct commonio_db *db, int mode)
        while (getline(&buf, &buflen, db->fp) != -1) {
                struct commonio_entry  *p;
 
-               if (stpsep(buf, "\n") == NULL)
+               if (stpsep(buf, "\n") == NULL) {
+                       fprintf(log_get_logfd(), _("%s: Non-text file.\n"), db->filename);
                        goto cleanup_buf;
+               }
 
                line = strdup (buf);
                if (NULL == line) {