This is in the git sources release-4-0-0alpha7-2044-gecd1fe2,
but release-3-4-0pre2 has the same code.
I began looking through samba sources for unchecked close calls.
The one at the end of check_magic in source3/smbd/close.c looks significant:
The problem is that close(outfd) is documented to be able to fail (indicating a write failure) even when all "write" syscalls have succeeded, and that is not detected.
Created attachment 4253 [details]
Attached find a set of two patches. Does that fix the error for you?
BTW, this "magic script" thing is sooo deprecated.. :-)
Created attachment 4254 [details]
Crap, forgot --stdout last time :-)
Pushed to master - thanks Volker !
Should this one be included in 3.4.0?
No, I don't think so.
I don't think this is important enough to go into 3.4. As it's fixed in master, closing the bug.