-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
Deprecate CentralProcessor's getSystemSerialNumber method #307
Conversation
duplicated ComputerSystem's getSerialNumber method.
What is supposed to be used instead? |
I think it's: |
@Qiu1024 Indeed. Thanks |
@Qiu1024 The problem with cs.getSerialNumber() is, that it returns "unkown" on two different Ubuntu systems, hence it cannot be used for generating keys. What else do you have? :) |
@neilyoung On which Ubuntu versions is this failing? Are you running the code under root privileges? |
Ubuntu 17.10 on a 10 years old 32 bit Samsung R509 laptop EDIT: If I run as sudo, the correct serial number appears. Is root required? |
@neilyoung Then that's where it's failing. For older versions of Linux, the code defaults to HAL (and equivalent) tables. For newer versions, we check values that can only be accessed by root. Sadly, hardware info at this level can only be accessed by root users in Linux |
Sadly for OSHI. Happily for privacy advocates who won this particular battle in Linux. But yes... for full functionality on Linux (and many Unix features) part of your implementation plan needs to be running OSHI (or the program you import it into) with elevated privileges. |
@dbwiddis Strange enough, the same code doesn't need to have root on MacOSX. Cannot believe Apple to be less restrictive here :), but it seems to be the case |
There are workarounds besides root.... for example, installing Not sure why Apple makes it easy. :) |
@dbwiddis What are the other fallbacks? There is no HAL installer any longer for Ubuntu since 10.something |
It duplicated ComputerSystem's getSerialNumber method. See #296