mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-25 17:30:56 +08:00
fix(server): skip named pipes and sockets when packing a task archive
writeTaskArchivePackage opened every entry of the staged workspace that is not a directory. Opening a FIFO blocks until a writer appears, so a named pipe left by a command (mkfifo backpipe for an nc relay) stopped the single archive worker in openat for good, with the task files already moved to staging and every later archive, restore and delete job queued behind it. A Unix socket failed the archive instead, and a device file was packed but refused by extractTaskArchivePackage on restore. Skip every entry that is neither a directory nor a regular file, as is already done for symlinks.
This commit is contained in:
@@ -639,6 +639,12 @@ func writeTaskArchivePackage(path, payloadDir string, snapshot *pgdb.TaskArchive
|
||||
log.Printf("[task-archive] skipping symlink (unsupported by the archive, other files unaffected): %s", current)
|
||||
return nil
|
||||
}
|
||||
if !entry.IsDir() && !info.Mode().IsRegular() {
|
||||
// A named pipe, socket or device left by a command: opening a pipe blocks until
|
||||
// a writer appears, tar refuses a socket, and the unpacker refuses the rest.
|
||||
log.Printf("[task-archive] skipping a file that is not regular (unsupported by the archive): %s", current)
|
||||
return nil
|
||||
}
|
||||
header, err := tar.FileInfoHeader(info, "")
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user