zcalusic / sysinfo

Sysinfo is a Go library providing Linux OS / kernel / hardware system information.
MIT License
517 stars 91 forks source link

Do not write files in user system #43

Closed Itxaka closed 3 months ago

Itxaka commented 7 months ago

This stops sysinfo from writing files in the running system without telling the user about it.

A system with no machine-id is a completely valid system and can be like that at different times, like inside a container, on a first boot, in immutable systems, etc...

We should not write files in teh user system without informing them and not having a machine-id is a valid state.

Fixes: https://github.com/zcalusic/sysinfo/issues/42

Itxaka commented 5 months ago

@zcalusic any comment on this?

zcalusic commented 3 months ago

I agree that nowadays we probably should not tamper with the machine ID. This was added a long time ago to better support some ancient distributions that were unaware of the machine ID. However, in the meantime, we have dropped support for those, so it's okay if this workaround is removed as well.

Thank you for your contribution @Itxaka!