aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstore/filetransfer.cc1
-rw-r--r--src/libutil/args.cc8
-rw-r--r--src/libutil/unix-domain-socket.cc11
3 files changed, 12 insertions, 8 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index 76da8e415..fd341b2f0 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -196,7 +196,6 @@ struct curlFileTransfer : public FileTransfer
result.immutableUrl = match.str(1);
else
debug("got invalid link header '%s'", value);
- warn("foo %s", value);
}
}
}
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 4983e49af..655b3e82f 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -93,7 +93,6 @@ void RootArgs::parseCmdline(const Strings & _cmdline)
verbosity = lvlError;
}
- bool argsSeen = false;
for (auto pos = cmdline.begin(); pos != cmdline.end(); ) {
auto arg = *pos;
@@ -122,10 +121,6 @@ void RootArgs::parseCmdline(const Strings & _cmdline)
throw UsageError("unrecognised flag '%1%'", arg);
}
else {
- if (!argsSeen) {
- argsSeen = true;
- initialFlagsProcessed();
- }
pos = rewriteArgs(cmdline, pos);
pendingArgs.push_back(*pos++);
if (processArgs(pendingArgs, false))
@@ -135,8 +130,7 @@ void RootArgs::parseCmdline(const Strings & _cmdline)
processArgs(pendingArgs, true);
- if (!argsSeen)
- initialFlagsProcessed();
+ initialFlagsProcessed();
/* Now that we are done parsing, make sure that any experimental
* feature required by the flags is enabled */
diff --git a/src/libutil/unix-domain-socket.cc b/src/libutil/unix-domain-socket.cc
index a9a2a415a..a6e46ca50 100644
--- a/src/libutil/unix-domain-socket.cc
+++ b/src/libutil/unix-domain-socket.cc
@@ -37,6 +37,17 @@ AutoCloseFD createUnixDomainSocket(const Path & path, mode_t mode)
return fdSocket;
}
+/**
+ * Workaround for the max length of Unix socket names being between 102
+ * (darwin) and 108 (Linux), which is extremely short. This limitation is
+ * caused by historical restrictions on sizeof(struct sockaddr):
+ * https://unix.stackexchange.com/a/367012.
+ *
+ * Our solution here is to start a process inheriting the socket, chdir into
+ * the directory of the socket, then connect with just the filename. This is
+ * rather silly but it works around working directory being process-wide state,
+ * and is as clearly sound as possible.
+ */
static void bindConnectProcHelper(
std::string_view operationName, auto && operation,
int fd, const std::string & path)