3 ms·
> Generally, on Unix systems the default is to generate a file named core in the current directory of the crashing process. Sounds like a horrible default. Tha
by CodesInChaos 2y ago
> Generally, on Unix systems the default is to generate a file named core in the current directory of the crashing process.
Sounds like a horrible default. That's a security risk (working directory might be readable by untrusted users), and pollutes a random directory with a file that could cause problems for other applications processing files in that directory.
A fixed location inside the user's home directory feels like a much better choice to me.
- Zacru 2y agoThe running user may not have a home directory.
- inferiorhuman 2y agoThe default on macOS is to chuck them in /cores (which seems quite reasonable to me). Security-wise I wouldn't worry too much about the Solaris/Illumos defaults. There, dumps can be created in up to three contexts: system-wide "global", zone-wide "global", and local. All are created with mode 600 and global dumps are created with owner of uid 0. Local core dumps are owned by user that owns the process unless its uid/gid has changed (e.g. setuid/setgid), then the owner is the superuser like the global dumps. Otherwise yeah I'm not a huge fan of leaving core dumps in the current directory. What if you're doing something on a read-only filesystem?