On Nov 21 2025, Chet Ramey wrote: > Yes, this defeats the bash check. I tend to agree with kre that this is > a Linux kernel bug, but here we are.
I don't think so. This can happen with any file (even "normal" regular ones) if another process is modifying it just between the stat and the read calls. > *** ../bash-5.3-patched/builtins/evalfile.c Fri Sep 6 15:42:40 2024 > --- builtins/evalfile.c Fri Sep 12 11:38:57 2025 > *************** > *** 161,166 **** > --- 161,168 ---- > if (nr >= 0) > string[nr] = '\0'; > + #if 0 > if (nr != file_size) > nr = -1; /* XXX - didn't get the whole file */ > + #endif A short read is never an error, as you can see from the fact that errno wasn't set. -- Andreas Schwab, [email protected] GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
