git-annex/Utility
Joey Hess 033e4b086f
audit all openFd and dupping for close-on-exec
Made all uses of openFd and dup set the close-on-exec flag, with a few
exceptions when starting a git-annex daemon.

Made openFdWithMode be used everywhere, rather than openFd.
Adding a new parameter to it ensures I checked everything.
And will help to make sure this gets considered in the future when
opening fds.

In lockPidFile, the only thing that keeps the pid file locked, once
daemonize re-runs the command in a new session, is that the fd is
inherited.

In Utility.LogFile.redir, the new fd it dups to does not have the
close-on-exec flag set, because this is used to set up the stdout and
stderr fds, which need to be inherited by child processes.

Same in Assistant.startDaemon where the browser gets started with the
original stdout and stderr.

This does nothing about uses of openFile and similar!

Sponsored-By: mycroft
2025-09-04 16:01:41 -04:00
..
Directory OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
DirWatcher audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
Env
LockFile audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
LockPool more OsPath conversion 2025-01-24 16:31:14 -04:00
Path fix convertToWindowsNativeNameSpace bug 2025-02-11 20:37:40 -08:00
Process fix missing new lines in processTranscript 2021-08-02 13:42:27 -04:00
Scheduled Typo: recurrance -> recurrence 2023-03-17 15:14:54 -04:00
Tmp OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
Url fix build on windows 2023-08-18 13:03:47 -04:00
Aeson.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
Android.hs
Applicative.hs
Attoparsec.hs
AuthToken.hs improve AuthToken display in P2P --debug 2025-08-01 12:58:03 -04:00
Base64.hs simplify base64 to only use ByteString 2023-10-26 13:10:05 -04:00
Batch.hs add searchPathContents 2021-02-02 19:06:15 -04:00
Bloom.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00
CoProcess.hs make commitMigration interuption safe 2023-12-06 16:29:58 -04:00
CopyFile.hs annex.fastcopy 2025-06-03 15:01:38 -04:00
Daemon.hs audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
Data.hs eliminate s2w8 and w82s 2023-10-26 13:12:57 -04:00
DataUnits.hs remove read of the heads 2024-09-26 18:43:59 -04:00
DBus.hs
Debug.hs Revert "use existing debug machinery for explain" 2023-07-25 15:53:50 -04:00
DebugLocks.hs
Directory.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
DirWatcher.hs Fix build without the assistant. 2025-03-26 10:17:03 -04:00
DiskFree.hs
Dot.hs
DottedVersion.hs more RawFilePath conversion 2020-10-29 12:03:50 -04:00
Env.hs
Exception.hs avoid displaying ExitCode exceptions 2023-04-12 17:04:57 -04:00
FileIO.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
FileMode.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
FileSize.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
FileSystemEncoding.hs avoid relatedTemplate ever returning "" 2025-09-04 13:02:46 -04:00
Format.hs find, findkeys, examinekey: escape output to terminal when --format is not used 2023-04-11 15:27:07 -04:00
FreeDesktop.hs optimise literalOsPath 2025-01-27 16:36:29 -04:00
Glob.hs Typo: sansative -> sensitive 2023-03-17 15:14:50 -04:00
Gpg.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
Hash.hs use hmac in balanced preferred content 2024-08-10 16:32:54 -04:00
HtmlDetect.hs more OsPath conversion (639/749) 2025-02-07 16:07:05 -04:00
HumanNumber.hs Fix a rounding bug in display of data sizes 2021-07-30 09:56:04 -04:00
HumanTime.hs avoid parseDuration succeeding on empty string 2020-12-08 12:51:56 -04:00
InodeCache.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
IPAddress.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00
libkqueue.c
libkqueue.h
LinuxMkLibs.hs OsPath conversion of linuxstandalone builder 2025-02-11 12:12:27 -04:00
LockFile.hs
LockPool.hs
LogFile.hs more OsPath conversion 2025-01-25 10:54:51 -04:00
Lsof.hs more OsPath conversion 2025-01-25 10:54:51 -04:00
MagicWormhole.hs fix breakage in wormhole's sendFile 2022-09-26 15:26:29 -04:00
Matcher.hs treat "not present" in preferred content as invalid 2024-09-03 13:50:06 -04:00
MD5.hs
Metered.hs more OsPath conversion 2025-01-29 11:53:20 -04:00
Misc.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
Monad.hs Add git-annex remote refs that are not newer to the merged refs list 2023-08-09 13:31:36 -04:00
MonotonicClock.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Mounts.hs
MoveFile.hs moveFile on windows forgot to delete src file in fallback case 2025-05-30 13:18:26 -04:00
Network.hs
NotificationBroadcaster.hs
OpenFd.hs audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
OpenFile.hs audit all openFd and dupping for close-on-exec 2025-09-04 16:01:41 -04:00
OptParse.hs
OsPath.hs stop exporting RawFilePath 2025-02-12 12:59:30 -04:00
OsString.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
OSX.hs optimise literalOsPath 2025-01-27 16:36:29 -04:00
PartialPrelude.hs remove read of the heads 2024-09-26 18:43:59 -04:00
Path.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
Percentage.hs
PID.hs
Process.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
QuickCheck.hs run codespell throughout fixing typos automagically 2024-05-01 15:46:21 -04:00
RawFilePath.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
ResourcePool.hs use ResourcePool for hash-object handles 2022-07-25 17:32:39 -04:00
Rsync.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
SafeCommand.hs compute: add response to OUTPUT 2025-03-07 14:47:34 -04:00
SafeOutput.hs more OsPath conversion (602/749) 2025-02-07 14:46:11 -04:00
Scheduled.hs Typo: recurrance -> recurrence 2023-03-17 15:14:54 -04:00
Shell.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
ShellEscape.hs improve attribution armoring 2023-11-21 11:34:21 -04:00
SimpleProtocol.hs P2P protocol version 2, adding SUCCESS-PLUS and ALREADY-HAVE-PLUS 2024-06-18 16:21:40 -04:00
Split.hs
SshConfig.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
SshHost.hs
StatelessOpenPGP.hs OsPath transition Windows build fixes 2025-02-11 15:40:53 -04:00
STM.hs Allow enabling the servant build flag with older versions of stm 2024-10-17 20:55:31 -04:00
Su.hs more OsPath conversion 2025-01-24 16:31:14 -04:00
SystemDirectory.hs use to/fromOsPath 2025-02-11 13:54:51 -04:00
Tense.hs
Terminal.hs Windows: Fix escaping output to terminal when using old versions of MinTTY 2024-03-26 13:09:21 -04:00
ThreadLock.hs
ThreadScheduler.hs fix build warnings on windows 2024-03-26 13:11:53 -04:00
TimeStamp.hs bring back OsPath changes 2025-01-30 14:34:21 -04:00
TList.hs remove i386ancient and need at least debian stable to build 2025-01-01 14:15:55 -04:00
Tmp.hs avoid relatedTemplate ever returning "" 2025-09-04 13:02:46 -04:00
Tor.hs remotedaemon support for generic P2P transports 2025-07-31 14:45:32 -04:00
Touch.hs OsPath build flag no longer depends on filepath-bytestring 2025-02-10 16:39:55 -04:00
Tuple.hs
Url.hs more OsPath conversion 2025-01-29 11:53:20 -04:00
UserInfo.hs fix build on windows 2023-08-02 10:43:20 -04:00
Verifiable.hs use hmac in balanced preferred content 2024-08-10 16:32:54 -04:00
WebApp.hs more OsPath conversion (749/749) 2025-02-10 14:59:20 -04:00
Yesod.hs Apply codespell -w throughout 2023-03-17 15:14:58 -04:00