tailscale/hostinfo
Anton Tolchanov 2cf6e12790 hostinfo: make lxcfs container check more specific
Instead of treating any lxcfs mount as an indicator that we're running
in a container, check for one of the mounts actually used by LXC
containers.

For reference, here's a list of mounts I am seeing in an LXC container:

```
$ grep lxcfs /proc/mounts
lxcfs /proc/cpuinfo fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/diskstats fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/loadavg fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/meminfo fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/stat fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/swaps fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /proc/uptime fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
lxcfs /sys/devices/system/cpu/online fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
```

Fixes #8444

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2023-06-26 15:34:54 +01:00
..
hostinfo.go hostinfo: make lxcfs container check more specific 2023-06-26 15:34:54 +01:00
hostinfo_darwin.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
hostinfo_freebsd.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
hostinfo_linux.go various: add detection and Taildrop for Unraid 2023-05-04 13:40:13 -07:00
hostinfo_linux_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
hostinfo_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
hostinfo_uname.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
hostinfo_windows.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00