Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • slapos slapos
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 122
    • Merge requests 122
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slaposslapos
  • Merge requests
  • !1113

Merged
Created Jan 06, 2022 by Jérome Perrin@jeromeOwner

component/userhosts: use github.com/figiel/hosts for compatibility with recent libc

  • Overview 6
  • Commits 1
  • Pipelines 4
  • Changes 6

In ubuntu 21.04 (libc6 2.33-0ubuntu5) or current debian testing (libc6 2.32-5) no longer use open to open /etc/hosts, but what appears as "openat" in strace output - but can not be replaced by defining an openat function.

This uses https://github.com/figiel/hosts which uses another approach of replacing getaddrinfo, gethostbyname* and inet_aton.

Users have been updated a bit, because there are some small differences:

  • the /etc/hosts replacement file is defined by HOSTS_FILE environment variable, not HOSTS
  • the library name is libuserhosts.so, not userhosts.so

Other notable differences, for which we did not need code change are:

  • the new library also try to load a file when HOSTS_FILE is not set
  • the new library still use original /etc/hosts file
  • the new library supports aliases to hostnames, not only ip addresses
Edited Jan 06, 2022 by Jérome Perrin
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix/userhosts-new-glibc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7