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

Add support to get device serial from system BIOS table #258

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

shrikant1407
Copy link
Contributor

Added support to get device serial from system BIOS table.
linux-client required elevated privileges. Use 'sudo' to execute.

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>
KiranSukhavasi
KiranSukhavasi previously approved these changes Nov 10, 2023
…table

Signed-off-by: Shrikant Temburwar <shrikant.temburwar@intel.com>
Signed-off-by: Shrikant Temburwar <shrikant.temburwar@intel.com>
@shrikant1407 shrikant1407 merged commit 1ff59f9 into fido-device-onboard:master Nov 13, 2023
2 checks passed
@shrikant1407 shrikant1407 deleted the get-serial branch November 13, 2023 06:31
@@ -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];
Copy link
Contributor Author

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;

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;

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check other places also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants