Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: using hostname to identify the host on macos allows DHCP servers to change content of "HOST" history search with default macos setup #2391

Open
1 task done
codyps opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@codyps
Copy link

codyps commented Sep 20, 2024

What did you expect to happen?

Consistent hostname is assigned to commands executed on a given computer so that the HOST history search shows a growing list of history regardless of what network I'm connected to.

What happened?

Depending on what network I connect to (and what version of macos I'm using, as this changes the hostname sent to DHCP), I get different history from atuin.

For example, now that I'm running macos 15.0, my system sends a MacBookPro hostname to the DHCP server, and this DHCP server uses adds a suffix (.foo.example.com), causing the hostname (as returned via the hostname command, for example) to be MacBookPro.foo.example.com. This ends up in the history.db history table's hostname column.

If I connect to another network that has DHCP set to assign a different domain, that also is used by atuin, and the host search only shows the current understanding of the hostname (dependent on the network).

One can examine the "Local hostname" configured in the macos settings with scutil --get LocalHostName. On systems with macos prior to 15.0, this hostname is sent to the DHCP server, and in many cases means we would (prior to macos 15.0) get a hostname that looked somewhat right and often functioned correctly.

One can also use the command scutil --set HostName bar to set a fixed hostname, which the hostname command then returns. This is not exposed anywhere in the user interface for macos and is by default unset, meaning most users are likely to have their hostname change depending on dhcp settings today.

Atuin doctor output

Atuin Doctor
Checking for diagnostics


Please include the output below with any bug reports or issues

atuin:
  version: 18.2.0
  sync:
    cloud: true
    records: true
    auto_sync: true
    last_sync: 2024-09-20 3:57:49.643217 +00:00:00
shell:
  name: zsh
  default: zsh
  plugins:
  - atuin
system:
  os: Darwin
  arch: x86_64
  version: '10.16'
  disks:
  - name: Macintosh HD
    filesystem: apfs
  - name: Macintosh HD
    filesystem: apfs
  - name: dev
    filesystem: apfs

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant