MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / daxFifoDir

Function daxFifoDir

src/core/PipeWireAudioBridge.cpp:30–48  ·  view source on GitHub ↗

Resolve the per-user DAX FIFO directory. Creates it 0700 if missing. Returns empty QString on irrecoverable failure (caller logs and bails). Path precedence: $XDG_RUNTIME_DIR → /run/user/ / → /tmp/aethersdr- /. See GHSA-x8xf-4g5v-ppf9 — pre-fix code created world-writable FIFOs in /tmp/aethersdr-dax-*.pipe, exposing the operator's TX path to local-user audio injection (an FCC liability fo

Source from the content-addressed store, hash-verified

28// /tmp/aethersdr-dax-*.pipe, exposing the operator's TX path to local-user
29// audio injection (an FCC liability for licensed stations).
30QString daxFifoDir()
31{
32 QString base = QString::fromLocal8Bit(qgetenv("XDG_RUNTIME_DIR"));
33 if (base.isEmpty()) {
34 const QString runUser = QStringLiteral("/run/user/%1").arg(::getuid());
35 base = QDir(runUser).exists()
36 ? runUser
37 : QStringLiteral("/tmp/aethersdr-%1").arg(::getuid());
38 }
39 const QString dir = base + QStringLiteral("/aethersdr");
40 if (::mkdir(dir.toUtf8().constData(), 0700) != 0 && errno != EEXIST) {
41 qCWarning(lcDax) << "PipeWireAudioBridge: mkdir failed for"
42 << dir << ":" << strerror(errno);
43 return {};
44 }
45 // Tighten perms in case the dir pre-existed with looser settings.
46 ::chmod(dir.toUtf8().constData(), 0700);
47 return dir;
48}
49
50// Atomic-ish owner-only FIFO creation. Tries mkfifo(0600) first; on EEXIST,
51// verifies the existing entry is our FIFO before unlinking and retrying.

Callers 2

loadPipeSourceMethod · 0.85
loadPipeSinkMethod · 0.85

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected