Open madduck opened 1 year ago
Your file is probably unreadable by Teedy. I will need a reproducer if possible (other people use the importer with no issue).
It's readable, assuming the importer is actually running as root and doesn't drop privileges, which I can't see the code doing:
~ # ps aux
PID USER TIME COMMAND
1 root 0:10 /teedy-importer -d
43 root 0:00 ash
75 root 0:00 ps aux
~ # ls -ld /proc/1
dr-xr-xr-x 9 root root 0 Sep 7 07:12 /proc/1
As root myself, I can read the file and manipulate the directory just fine:
~ # cd /import/
/import # ls -l
total 412
-rw-r----- 1 1000 root 420317 Sep 7 16:16 2023.07.25 Saturn 143054.pdf
/import # id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
/import # md5sum 2023.07.25\ Saturn\ 143054.pdf
592df2ef2c2fa9f21e6744714469a531 2023.07.25 Saturn 143054.pdf
/import # rm 2023.07.25\ Saturn\ 143054.pdf
/import # ls -l
total 0
I just put a PDF file into the imoprter directory (which has permissions 1777), but the file itself only had 0640. Since both the importer as well as Jetty run as root (ugh!), I didn't think this was going to be a problem. But that is the issue, changing permissions to 0644 makes it all work.
However, here is what happened while permissions were at 0640:
Here are the logs from the server:
The importer did not log anything.
And here is what the result looks like after 2 minutes (3 polls):