)]}'
{"third_party/nix/src/nix-daemon/nix-daemon-main.cc":[{"author":{"_account_id":1000002,"name":"kanepyork","email":"rikingcoding@gmail.com","username":"riking"},"change_message_id":"902f90b0fad9b3c66e519f3db77e3808040cbbc1","unresolved":true,"context_lines":[{"line_number":42,"context_line":"  if (socketName.size() + 1 \u003e\u003d sizeof(addr.sun_path)) {"},{"line_number":43,"context_line":"    throw Error(format(\"socket name %1% is too long\") % socketName);"},{"line_number":44,"context_line":"  }"},{"line_number":45,"context_line":"  strcpy(addr.sun_path, socketName.c_str());"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"  if (connect(s, (struct sockaddr*)\u0026addr, sizeof(addr)) \u003d\u003d -1) {"},{"line_number":48,"context_line":"    throw SysError(format(\"cannot connect to daemon at %1%\") % socket_path);"}],"source_content_type":"text/x-c","patch_set":4,"id":"42058fa9_cc407d19","line":45,"range":{"start_line":45,"start_character":2,"end_line":45,"end_character":8},"updated":"2020-07-24 00:16:18.000000000","message":"/build/nix/src/nix-daemon/nix-daemon-main.cc:45:3: error: Call to function \u0027strcpy\u0027 is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as \u0027strlcpy\u0027. CWE-119 [clang-analyzer-security.insecureAPI.strcpy,-warnings-as-errors]\n\nPlease fix.","commit_id":"c99e6ac1c0162144084e08305cbb4026619eaf0f"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"60ba890ff262a7070a4b5b069540dc9ac9785197","unresolved":false,"context_lines":[{"line_number":42,"context_line":"  if (socketName.size() + 1 \u003e\u003d sizeof(addr.sun_path)) {"},{"line_number":43,"context_line":"    throw Error(format(\"socket name %1% is too long\") % socketName);"},{"line_number":44,"context_line":"  }"},{"line_number":45,"context_line":"  strcpy(addr.sun_path, socketName.c_str());"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"  if (connect(s, (struct sockaddr*)\u0026addr, sizeof(addr)) \u003d\u003d -1) {"},{"line_number":48,"context_line":"    throw SysError(format(\"cannot connect to daemon at %1%\") % socket_path);"}],"source_content_type":"text/x-c","patch_set":4,"id":"5fd5b3a9_9b33bf4e","line":45,"range":{"start_line":45,"start_character":2,"end_line":45,"end_character":8},"in_reply_to":"42058fa9_cc407d19","updated":"2020-07-24 15:54:03.000000000","message":"Done","commit_id":"c99e6ac1c0162144084e08305cbb4026619eaf0f"},{"author":{"_account_id":1000002,"name":"kanepyork","email":"rikingcoding@gmail.com","username":"riking"},"change_message_id":"2bfd235566ca48cd71eb562e921600cf74dab748","unresolved":true,"context_lines":[{"line_number":26,"context_line":"// verbatim from the old daemon implementation without much critical evaluation."},{"line_number":27,"context_line":"static int ForwardToSocket(nix::Path socket_path) {"},{"line_number":28,"context_line":"  // Forward on this connection to the real daemon"},{"line_number":29,"context_line":"  auto s \u003d socket(PF_UNIX, SOCK_STREAM, 0);"},{"line_number":30,"context_line":"  if (s \u003d\u003d -1) {"},{"line_number":31,"context_line":"    throw SysError(\"creating Unix domain socket\");"},{"line_number":32,"context_line":"  }"}],"source_content_type":"text/x-c","patch_set":11,"id":"73e7a89a_1c6b6e4e","line":29,"range":{"start_line":29,"start_character":2,"end_line":29,"end_character":8},"updated":"2020-07-25 02:12:51.000000000","message":"int sockfd, please 😊","commit_id":"b0981a9dce4f0f2e058e856677ad3092d8ca5621"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"b0e05d54ca16dcba6d06f2aeedbc7ee14f0f7df6","unresolved":false,"context_lines":[{"line_number":26,"context_line":"// verbatim from the old daemon implementation without much critical evaluation."},{"line_number":27,"context_line":"static int ForwardToSocket(nix::Path socket_path) {"},{"line_number":28,"context_line":"  // Forward on this connection to the real daemon"},{"line_number":29,"context_line":"  auto s \u003d socket(PF_UNIX, SOCK_STREAM, 0);"},{"line_number":30,"context_line":"  if (s \u003d\u003d -1) {"},{"line_number":31,"context_line":"    throw SysError(\"creating Unix domain socket\");"},{"line_number":32,"context_line":"  }"}],"source_content_type":"text/x-c","patch_set":11,"id":"02cc913d_f75c0482","line":29,"range":{"start_line":29,"start_character":2,"end_line":29,"end_character":8},"in_reply_to":"73e7a89a_1c6b6e4e","updated":"2020-07-25 02:37:55.000000000","message":"Done","commit_id":"b0981a9dce4f0f2e058e856677ad3092d8ca5621"},{"author":{"_account_id":1000002,"name":"kanepyork","email":"rikingcoding@gmail.com","username":"riking"},"change_message_id":"2bfd235566ca48cd71eb562e921600cf74dab748","unresolved":true,"context_lines":[{"line_number":44,"context_line":"  }"},{"line_number":45,"context_line":"  strncpy(addr.sun_path, socketName.c_str(), sizeof(addr.sun_family));"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"  if (connect(s, (struct sockaddr*)\u0026addr, sizeof(addr)) \u003d\u003d -1) {"},{"line_number":48,"context_line":"    throw SysError(format(\"cannot connect to daemon at %1%\") % socket_path);"},{"line_number":49,"context_line":"  }"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-c","patch_set":11,"id":"98e89cd9_011281b4","line":47,"range":{"start_line":47,"start_character":18,"end_line":47,"end_character":33},"updated":"2020-07-25 02:12:51.000000000","message":"reinterpret_cast","commit_id":"b0981a9dce4f0f2e058e856677ad3092d8ca5621"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"b0e05d54ca16dcba6d06f2aeedbc7ee14f0f7df6","unresolved":false,"context_lines":[{"line_number":44,"context_line":"  }"},{"line_number":45,"context_line":"  strncpy(addr.sun_path, socketName.c_str(), sizeof(addr.sun_family));"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"  if (connect(s, (struct sockaddr*)\u0026addr, sizeof(addr)) \u003d\u003d -1) {"},{"line_number":48,"context_line":"    throw SysError(format(\"cannot connect to daemon at %1%\") % socket_path);"},{"line_number":49,"context_line":"  }"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-c","patch_set":11,"id":"82df7218_d370ad11","line":47,"range":{"start_line":47,"start_character":18,"end_line":47,"end_character":33},"in_reply_to":"98e89cd9_011281b4","updated":"2020-07-25 02:37:55.000000000","message":"Done","commit_id":"b0981a9dce4f0f2e058e856677ad3092d8ca5621"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"d3330ebaef74abc2c9ab207d6e112a4dd7302052","unresolved":true,"context_lines":[{"line_number":116,"context_line":"                   // systemd unit for nix passes --daemon to the daemon. It"},{"line_number":117,"context_line":"                   // would be nice to get rid of that eventually -  perhaps"},{"line_number":118,"context_line":"                   // once we start distributing tvix we can do so as a nixos"},{"line_number":119,"context_line":"                   // module that also removes the arg from the systemd unit"},{"line_number":120,"context_line":"                 } else if (*arg \u003d\u003d \"--help\") {"},{"line_number":121,"context_line":"                   showManPage(\"nix-daemon\");"},{"line_number":122,"context_line":"                 } else if (*arg \u003d\u003d \"--version\") {"}],"source_content_type":"text/x-c","patch_set":13,"id":"c7a51a88_fe7fc076","line":119,"range":{"start_line":119,"start_character":0,"end_line":119,"end_character":76},"updated":"2020-07-25 03:01:18.000000000","message":"this same CL also gets rid of the daemon arg in the unit - outdated comment?","commit_id":"9318919b96f5c080ee31251938f714f4a06a2451"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"4ec797d9e5f6a7aa5e5a213e8871b034b6510e76","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                   // systemd unit for nix passes --daemon to the daemon. It"},{"line_number":117,"context_line":"                   // would be nice to get rid of that eventually -  perhaps"},{"line_number":118,"context_line":"                   // once we start distributing tvix we can do so as a nixos"},{"line_number":119,"context_line":"                   // module that also removes the arg from the systemd unit"},{"line_number":120,"context_line":"                 } else if (*arg \u003d\u003d \"--help\") {"},{"line_number":121,"context_line":"                   showManPage(\"nix-daemon\");"},{"line_number":122,"context_line":"                 } else if (*arg \u003d\u003d \"--version\") {"}],"source_content_type":"text/x-c","patch_set":13,"id":"dd833ec5_d8742cd5","line":119,"range":{"start_line":119,"start_character":0,"end_line":119,"end_character":76},"in_reply_to":"c7a51a88_fe7fc076","updated":"2020-07-25 15:19:26.000000000","message":"Done","commit_id":"9318919b96f5c080ee31251938f714f4a06a2451"}],"third_party/nix/src/nix-daemon/nix-daemon-proto.cc":[{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"d3330ebaef74abc2c9ab207d6e112a4dd7302052","unresolved":true,"context_lines":[{"line_number":287,"context_line":"};"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"std::unique_ptr\u003cWorkerService::Service\u003e NewWorkerService(nix::Store* store) {"},{"line_number":290,"context_line":"  return std::make_unique\u003cWorkerServiceImpl\u003e(store);"},{"line_number":291,"context_line":"}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"}  // namespace nix::daemon"}],"source_content_type":"text/x-c","patch_set":13,"id":"16f0c2c5_7152505b","side":"PARENT","line":290,"range":{"start_line":290,"start_character":9,"end_line":290,"end_character":25},"updated":"2020-07-25 03:01:18.000000000","message":"hm, why this change?","commit_id":"2f85dfe50c1eb9622a1b409de95629bcced0992f"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"4ec797d9e5f6a7aa5e5a213e8871b034b6510e76","unresolved":true,"context_lines":[{"line_number":287,"context_line":"};"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"std::unique_ptr\u003cWorkerService::Service\u003e NewWorkerService(nix::Store* store) {"},{"line_number":290,"context_line":"  return std::make_unique\u003cWorkerServiceImpl\u003e(store);"},{"line_number":291,"context_line":"}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"}  // namespace nix::daemon"}],"source_content_type":"text/x-c","patch_set":13,"id":"35e6f0c1_5d61f624","side":"PARENT","line":290,"range":{"start_line":290,"start_character":9,"end_line":290,"end_character":25},"in_reply_to":"16f0c2c5_7152505b","updated":"2020-07-25 15:19:26.000000000","message":"ServerBuilder::RegisterService takes a *Service - passing it a unique_ptr didn\u0027t typecheck. Leaking the service for the duration of the daemon felt fine, too, since the service *is* the daemon. If there\u0027s a better way to do this that typechecks I\u0027m happy to do that instead though.","commit_id":"2f85dfe50c1eb9622a1b409de95629bcced0992f"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"42f902531c399f36044c6028d96920d2155f0c34","unresolved":false,"context_lines":[{"line_number":287,"context_line":"};"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"std::unique_ptr\u003cWorkerService::Service\u003e NewWorkerService(nix::Store* store) {"},{"line_number":290,"context_line":"  return std::make_unique\u003cWorkerServiceImpl\u003e(store);"},{"line_number":291,"context_line":"}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"}  // namespace nix::daemon"}],"source_content_type":"text/x-c","patch_set":13,"id":"02224a01_376e814c","side":"PARENT","line":290,"range":{"start_line":290,"start_character":9,"end_line":290,"end_character":25},"in_reply_to":"35e6f0c1_5d61f624","updated":"2020-07-25 20:09:36.000000000","message":"Ack","commit_id":"2f85dfe50c1eb9622a1b409de95629bcced0992f"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"d3330ebaef74abc2c9ab207d6e112a4dd7302052","unresolved":true,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class WorkerServiceImpl final : public WorkerService::Service {"},{"line_number":28,"context_line":" public:"},{"line_number":29,"context_line":"  WorkerServiceImpl(std::shared_ptr\u003cnix::Store\u003e store) : store_(store) {}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"  Status IsValidPath(grpc::ServerContext* context, const StorePath* request,"},{"line_number":32,"context_line":"                     nix::proto::IsValidPathResponse* response) override {"}],"source_content_type":"text/x-c","patch_set":13,"id":"97ae2d5a_83912a55","line":29,"range":{"start_line":29,"start_character":20,"end_line":29,"end_character":35},"updated":"2020-07-25 03:01:18.000000000","message":"calling this increments the refcount, but it does not actually store the shared_ptr - is that intentional?","commit_id":"9318919b96f5c080ee31251938f714f4a06a2451"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"4ec797d9e5f6a7aa5e5a213e8871b034b6510e76","unresolved":true,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class WorkerServiceImpl final : public WorkerService::Service {"},{"line_number":28,"context_line":" public:"},{"line_number":29,"context_line":"  WorkerServiceImpl(std::shared_ptr\u003cnix::Store\u003e store) : store_(store) {}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"  Status IsValidPath(grpc::ServerContext* context, const StorePath* request,"},{"line_number":32,"context_line":"                     nix::proto::IsValidPathResponse* response) override {"}],"source_content_type":"text/x-c","patch_set":13,"id":"cd1b78af_7e3cbe48","line":29,"range":{"start_line":29,"start_character":20,"end_line":29,"end_character":35},"in_reply_to":"97ae2d5a_83912a55","updated":"2020-07-25 15:19:26.000000000","message":"It stores it as a member","commit_id":"9318919b96f5c080ee31251938f714f4a06a2451"},{"author":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"change_message_id":"f9c4a49d5d99cc72146cbdb2c5bc9b97b02478b3","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class WorkerServiceImpl final : public WorkerService::Service {"},{"line_number":28,"context_line":" public:"},{"line_number":29,"context_line":"  WorkerServiceImpl(std::shared_ptr\u003cnix::Store\u003e store) : store_(store) {}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"  Status IsValidPath(grpc::ServerContext* context, const StorePath* request,"},{"line_number":32,"context_line":"                     nix::proto::IsValidPathResponse* response) override {"}],"source_content_type":"text/x-c","patch_set":13,"id":"7b8b44bd_ccbade2f","line":29,"range":{"start_line":29,"start_character":20,"end_line":29,"end_character":35},"in_reply_to":"cd1b78af_7e3cbe48","updated":"2020-07-25 17:54:41.000000000","message":"Done","commit_id":"9318919b96f5c080ee31251938f714f4a06a2451"}]}
