{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":546532822,"defaultBranch":"main","name":"nsncd","ownerLogin":"nix-community","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2022-10-06T08:22:27.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/33221035?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1706193024.0","currentOid":""},"activityList":{"items":[{"before":"6ba38e9af454e843b09957aa0f8c5ba37de7c9fd","after":null,"ref":"refs/heads/flokli-patch-1","pushedAt":"2024-01-25T14:30:24.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"}},{"before":"d6513421f420e407248c6d0aee39ae2f861a7cec","after":"e20cd397833f880c9135ea5b327b05d59aa17467","ref":"refs/heads/main","pushedAt":"2024-01-25T14:30:20.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Merge pull request #11 from nix-community/flokli-patch-1\n\nREADME.md: update fork status","shortMessageHtmlLink":"Merge pull request #11 from nix-community/flokli-patch-1"}},{"before":null,"after":"6ba38e9af454e843b09957aa0f8c5ba37de7c9fd","ref":"refs/heads/flokli-patch-1","pushedAt":"2024-01-25T13:56:46.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"README.md: update fork status\n\nhttps://github.com/twosigma/nsncd/pull/71 landed upstream, and nixpkgs doesn't point to this fork anymore. Update the readme to reflect this.","shortMessageHtmlLink":"README.md: update fork status"}},{"before":"644e82cb4f5dab055bbd5154921851192fc08d8c","after":null,"ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-11-05T14:16:06.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"}},{"before":"edc146f403c03d2af415d306fbad4d43442a3f9c","after":"644e82cb4f5dab055bbd5154921851192fc08d8c","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-11-04T20:22:52.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyxxx: reflect error kind in type\n\nThere's conceptually 3 kinds of response for a gethostbyxxx request:\n\n1. Success: in that case we proxy the resulting hostent.\n2. Lookup Error: in that case, we proxy the herrno together with a\n \"dummy\" hostent error.\n3. Internal Error: we bail out, don't send back anything and log a\n error message.\n\nHopefully, we'll never use branch 3.\n\nReflecting this to the return type of these functions.","shortMessageHtmlLink":"gethostbyxxx: reflect error kind in type"}},{"before":"2306beecab18949de020fba24ab4fa898775cbab","after":"edc146f403c03d2af415d306fbad4d43442a3f9c","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-11-03T08:44:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"src/ffi.rs: make Hostent hold CStrings\n\nDon't try to do any parsing on the bytes - there's no guarantees they're\nvalid UTF-8 strings. We get C Strings from glibc, we serialize CStrings\nback out.","shortMessageHtmlLink":"src/ffi.rs: make Hostent hold CStrings"}},{"before":"f5f182e681330c215d5f29477a165feb15794bde","after":"2306beecab18949de020fba24ab4fa898775cbab","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-11-02T10:14:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"src/ffi.rs: from_libc_hostent: document why we set herrno to 0","shortMessageHtmlLink":"src/ffi.rs: from_libc_hostent: document why we set herrno to 0"}},{"before":"8e7cb2c166ab187e6eb6453fde8b050431b8dd23","after":"f5f182e681330c215d5f29477a165feb15794bde","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-11-02T10:12:57.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"address review comments","shortMessageHtmlLink":"address review comments"}},{"before":"42a7858cfd300daab17f0872362434ff00e96483","after":"8e7cb2c166ab187e6eb6453fde8b050431b8dd23","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-31T16:16:12.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"serialize_address_info: borrow ai_resp\n\nSaves us a clone() for the canonical name.","shortMessageHtmlLink":"serialize_address_info: borrow ai_resp"}},{"before":"5247a2a3a8de12fbd7bbcee004dc2975219f538b","after":"42a7858cfd300daab17f0872362434ff00e96483","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-31T16:08:16.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"serialize_address_info: borrow ai_resp\n\nSaves us a clone() for the canonical name.","shortMessageHtmlLink":"serialize_address_info: borrow ai_resp"}},{"before":"e2889434178b15bb259554e49d3f9faf407bde98","after":"5247a2a3a8de12fbd7bbcee004dc2975219f538b","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-31T07:26:22.000Z","pushType":"push","commitsCount":4,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"Merge branch 'main' into host-lookup-upstream","shortMessageHtmlLink":"Merge branch 'main' into host-lookup-upstream"}},{"before":"e49382f7bc6d46bed30e78342cb30a47b7c9778f","after":"e2889434178b15bb259554e49d3f9faf407bde98","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-31T07:24:35.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"Getaddrinfo: refactor handler\n\nWe simplify the getaddrinfo logic by refactoring all the logic in two\nbranches:\n\n- a happy path, if we get >0 addrs back\n- an error path, mirroring glibc's behaviour, if we do not get any\n addr back.\n\nCo-Authored-By: Florian Klink ","shortMessageHtmlLink":"Getaddrinfo: refactor handler"}},{"before":"c6282ba0c07a58a8847c568fc15737e585354d05","after":null,"ref":"refs/heads/invalidate-shutdown","pushedAt":"2023-10-31T07:18:17.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"}},{"before":"c739e9babf25fa308ff09fe94e9ebfd3aab297cb","after":"e49382f7bc6d46bed30e78342cb30a47b7c9778f","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-30T15:41:30.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Getaddrinfo: refactor handler\n\nWe simplify the getaddrinfo logic by refactoring all the logic in two\nbranches:\n\n- a happy path, if we get >0 addrs back\n- an error path, mirroring glibc's behaviour, if we do not get any\n addr back.\n\nCo-Authored-By: Florian Klink ","shortMessageHtmlLink":"Getaddrinfo: refactor handler"}},{"before":"4a6112a518b9c2bd1e57992d9af08706fb041749","after":"c739e9babf25fa308ff09fe94e9ebfd3aab297cb","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-30T11:12:06.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Getaddrinfo: refactor handler\n\nWe simplify the getaddrinfo logic by refactoring all the logic in two\nbranches:\n\n- a happy path, if we get >0 addrs back\n- an error path, mirroring glibc's behaviour, if we do not get any\n addr back.\n\nCo-Authored-By: Florian Klink ","shortMessageHtmlLink":"Getaddrinfo: refactor handler"}},{"before":"9334fe506ae6fb603bc65624ec712b33006819da","after":"4a6112a518b9c2bd1e57992d9af08706fb041749","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-30T10:50:47.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Getaddrinfo: refactor handler\n\nWe simplify the getaddrinfo logic by refactoring all the logic in two\nbranches:\n\n- a happy path, if we get >0 addrs back\n- an error path, mirroring glibc's behaviour, if we do not get any\n addr back.\n\nCo-Authored-By: Florian Klink ","shortMessageHtmlLink":"Getaddrinfo: refactor handler"}},{"before":"47755a26ab3a45a47e55785eb112c817ba1e6bed","after":"9334fe506ae6fb603bc65624ec712b33006819da","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-26T21:44:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"Getaddrinfo: always retrieve the canonical name\n\nNscd always sets the AI_CANONNAME flag for a getaddrinfo request. When\nthis flag is on, the canonical name (~ FQDN) for the requested address is\nretrieved.\n\nWe found this issue through the nixosTests.hostname.explicitDomain\nNixOS VM test. It went unnoticed in the wild probably because\nthe nscd client tend to fill canonical name in the request itself\nonce it retrieved it once.\n\nWhile investigating this issue, I realized that setting the\nSOCK_STREAM flag gets rid of the duplicate addrs. Meaning that we do\nnot need to filter them ourselves with a HashSet anymore.","shortMessageHtmlLink":"Getaddrinfo: always retrieve the canonical name"}},{"before":"b48f859a80e4097fdda2f761bf99a049556abebd","after":"d6513421f420e407248c6d0aee39ae2f861a7cec","ref":"refs/heads/main","pushedAt":"2023-10-26T18:17:52.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Merge pull request #10 from picnoir/nin/fix-getai-canonname\n\nGetaddrinfo: always retrieve the canonical name","shortMessageHtmlLink":"Merge pull request #10 from picnoir/nin/fix-getai-canonname"}},{"before":"187c2c709198b717df2d8e10190c31997f2a5160","after":"b48f859a80e4097fdda2f761bf99a049556abebd","ref":"refs/heads/main","pushedAt":"2023-10-26T10:58:32.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Readme: add some notes about the status of this fork.","shortMessageHtmlLink":"Readme: add some notes about the status of this fork."}},{"before":"b714fde7041716ed8bafaeb54d16c14e574d14b7","after":"187c2c709198b717df2d8e10190c31997f2a5160","ref":"refs/heads/main","pushedAt":"2023-10-26T10:55:51.000Z","pushType":"push","commitsCount":57,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Readme: add some notes about the status of this fork.","shortMessageHtmlLink":"Readme: add some notes about the status of this fork."}},{"before":null,"after":"47755a26ab3a45a47e55785eb112c817ba1e6bed","ref":"refs/heads/host-lookup-upstream","pushedAt":"2023-10-25T07:33:41.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"implement host lookup support\n\nThis adds support for the GETAI, GETHOSTBYADDR, GETHOSTBYADDRv6,\nGETHOSTBYNAME, GETHOSTBYNAMEv6 request types.\n\nFor the more complex GETAI lookup, we use the dns_lookup crate.\n\nIn previous iterations of this change, we also used the same underlying\ngetaddrinfo call to respond to the gethostbyname/gethostbyaddr\noperations.\n\nEven though gethostbyname/gethostbyaddr officially are deprecated,\nthere's a lot of tools still using it, and relying on them behaving\ndifferently.\n\nSo it's important to still implement it, with exactly the same\nbehaviour, to prevent some tools from breaking (like `hostname --fqdn`,\nsee https://github.com/nix-community/nsncd/issues/4).\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4\n\nCo-Authored-By: Florian Klink ","shortMessageHtmlLink":"implement host lookup support"}},{"before":"66c79cd04ea7a045b23c2f58d1a45b73c845e1a1","after":null,"ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-24T14:06:31.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"Mic92","name":"Jörg Thalheim","path":"/Mic92","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/96200?s=80&v=4"}},{"before":"94f54bbaee4b2429b4cad86807f20f95c4daaa60","after":"77fd58db23684dc84191d5fef64d88e2bc5dc978","ref":"refs/heads/host-lookups","pushedAt":"2023-10-24T13:35:00.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"flokli","name":"Florian Klink","path":"/flokli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/183879?s=80&v=4"},"commit":{"message":"Merge pull request #9 from nix-community/nin/ghbn\n\nGethostbyname: use proper glibc function","shortMessageHtmlLink":"Merge pull request #9 from nix-community/nin/ghbn"}},{"before":"0d96cf3bc66ab8eaeae75555c9bf04a5dfa36b43","after":"66c79cd04ea7a045b23c2f58d1a45b73c845e1a1","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-20T13:52:02.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyname/gethostbyaddr: use proper glibc function\n\nWe internally used getai to restpond to the\ngethostbyname/gethostbyaddr operations. Sadly, it does not behave as\nexpected and breaks some tools (like hostname --fqdn, see\nhttps://github.com/nix-community/nsncd/issues/4.\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nUsing sockburp, we realized the hostent serialization function was\nbogus: we totally forgot to serialize the aliases. This commit fixes\nthis and makes sure we're producing bit-to-bit identical results with\nNscd for gethostbyname/getaddrinfo.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4","shortMessageHtmlLink":"gethostbyname/gethostbyaddr: use proper glibc function"}},{"before":"3f7da0323bbcb2df26a8f7cf2cdf29c5f3c9dd66","after":"0d96cf3bc66ab8eaeae75555c9bf04a5dfa36b43","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-20T07:04:28.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyname/gethostbyaddr: use proper glibc function\n\nWe internally used getai to restpond to the\ngethostbyname/gethostbyaddr operations. Sadly, it does not behave as\nexpected and breaks some tools (like hostname --fqdn, see\nhttps://github.com/nix-community/nsncd/issues/4.\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nUsing sockburp, we realized the hostent serialization function was\nbogus: we totally forgot to serialize the aliases. This commit fixes\nthis and makes sure we're producing bit-to-bit identical results with\nNscd for gethostbyname/getaddrinfo.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4","shortMessageHtmlLink":"gethostbyname/gethostbyaddr: use proper glibc function"}},{"before":"da1dfa304822fbb6442e38bd3c79820819ca7a40","after":"3f7da0323bbcb2df26a8f7cf2cdf29c5f3c9dd66","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-20T07:00:43.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyname/gethostbyaddr: use proper glibc function\n\nWe internally used getai to restpond to the\ngethostbyname/gethostbyaddr operations. Sadly, it does not behave as\nexpected and breaks some tools (like hostname --fqdn, see\nhttps://github.com/nix-community/nsncd/issues/4.\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nUsing sockburp, we realized the hostent serialization function was\nbogus: we totally forgot to serialize the aliases. This commit fixes\nthis and makes sure we're producing bit-to-bit identical results with\nNscd for gethostbyname/getaddrinfo.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4","shortMessageHtmlLink":"gethostbyname/gethostbyaddr: use proper glibc function"}},{"before":"a2557b5542da2d26c5bc6d645a40f1d095801b43","after":"da1dfa304822fbb6442e38bd3c79820819ca7a40","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-19T17:10:27.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyname/gethostbyaddr: use proper glibc function\n\nWe internally used getai to restpond to the\ngethostbyname/gethostbyaddr operations. Sadly, it does not behave as\nexpected and breaks some tools (like hostname --fqdn, see\nhttps://github.com/nix-community/nsncd/issues/4.\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nUsing sockburp, we realized the hostent serialization function was\nbogus: we totally forgot to serialize the aliases. This commit fixes\nthis and makes sure we're producing bit-to-bit identical results with\nNscd for gethostbyname/getaddrinfo.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4","shortMessageHtmlLink":"gethostbyname/gethostbyaddr: use proper glibc function"}},{"before":"15133dd5bfbbc1111afb929a7005e8f672cdce68","after":"a2557b5542da2d26c5bc6d645a40f1d095801b43","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-19T16:59:50.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"gethostbyname/gethostbyaddr: use proper glibc function\n\nWe internally used getai to restpond to the\ngethostbyname/gethostbyaddr operations. Sadly, it does not behave as\nexpected and breaks some tools (like hostname --fqdn, see\nhttps://github.com/nix-community/nsncd/issues/4.\n\nWe FFI the right Glibc gethostbyname_2r/gethostbyaddr_2r (now\ndeprecated) functions and use it to back the GETHOSTBYNAME,\nGETHOSTBYNAME6, GETHOSTBYADDR, and GETHOSTBYADDR6 Nscd interfaces.\n\nUsing sockburp, we realized the hostent serialization function was\nbogus: we totally forgot to serialize the aliases. This commit fixes\nthis and makes sure we're producing bit-to-bit identical results with\nNscd for gethostbyname/getaddrinfo.\n\nTook me three try to get this right. This is actually the third\nfull rewrite.\n\nThe Nscd behaviour for these two legacy functions is *really*\nconfusing. We're supposed to ignore the herrno (herrno != errno!!) and\nset it to 0 if gethostbyaddr/name returns a non-null hostent. If we\nend up with a null hostent, we return the herrno together with a dummy\nhostent header.\n\nI tried to keep things as safe as possible by extracting the glibc\nhostent to a proper rust structure. This structure mirrors the libc\nhostent in a Rust idiomatic way. We should probably try to upstream\nthe FFI part of this commit to the Nix crate at some point.\n\nFixes https://github.com/nix-community/nsncd/issues/4","shortMessageHtmlLink":"gethostbyname/gethostbyaddr: use proper glibc function"}},{"before":"a8dff2d5d8a0b1c7d38dcfdc856315579b82b334","after":"15133dd5bfbbc1111afb929a7005e8f672cdce68","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-16T18:26:13.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Gethostbyname/Gethostbyaddr: introduce herrno error type\n\ngethostbyname and gethostbyaddr are not using the traditional Errno\nenum for its error return type but rather the \"herrno\" type. This type\nis not mapped to the libc:: crate yet.\n\nMapping the type, writing the associated util functions (desc() and\nfrom_i32()). Finally, using this new error enum to decode the glibc\nfunction error return values.","shortMessageHtmlLink":"Gethostbyname/Gethostbyaddr: introduce herrno error type"}},{"before":"9d227dba1125f436106afa77fdf91dde0fcf64d1","after":"a8dff2d5d8a0b1c7d38dcfdc856315579b82b334","ref":"refs/heads/nin/ghbn","pushedAt":"2023-10-16T07:41:35.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"picnoir","name":"Félix","path":"/picnoir","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1219785?s=80&v=4"},"commit":{"message":"Chore/refactor: get rid of Host struct\n\nWe don't really need this Host struct anymore, it's pretty much a\nduplicate of the Rust Hostent version at this point. Getting rid of\nit, moving the serialization procedure to the Hostent structure.","shortMessageHtmlLink":"Chore/refactor: get rid of Host struct"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD6QSMbwA","startCursor":null,"endCursor":null}},"title":"Activity · nix-community/nsncd"}