-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support to get device serial from system BIOS table #258
Add support to get device serial from system BIOS table #258
Conversation
Added support to get device serial from system BIOS table. linux-client required elevated privileges. Use 'sudo' to execute. Signed-off-by: Shrikant Temburwar <shrikant.temburwar@intel.com>
…table Signed-off-by: Shrikant Temburwar <shrikant.temburwar@intel.com>
Signed-off-by: Shrikant Temburwar <shrikant.temburwar@intel.com>
@@ -69,20 +69,73 @@ static int read_fill_modelserial(void) | |||
uint8_t def_model_sz = 0; | |||
size_t fsize = 0; | |||
|
|||
#if defined(GET_DEV_SERIAL) | |||
int strcmp_res = -1; | |||
char temp_device_serial[MAX_DEV_SERIAL_SZ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TO-DO: make it const
// Get device serial number | ||
int get_device_serial(char *serial_buff) | ||
{ | ||
FILE *fp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do input check for serial_buff before using it. Do it every place
{ | ||
FILE *fp; | ||
char *cmd = "dmidecode -s system-serial-number"; | ||
int out_sz; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add const for cmd variable ..As this value wouldnt change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check other places also
Added support to get device serial from system BIOS table.
linux-client required elevated privileges. Use 'sudo' to execute.