~ubuntu-branches/ubuntu/wily/fwts/wily

« back to all changes in this revision

Viewing changes to src/uefi/uefibootpath/uefibootpath.c

  • Committer: Package Import Robot
  • Author(s): Ivan Hu, Alex Hung, Colin Ian King, Ivan Hu, Naresh Bhat
  • Date: 2015-01-21 10:39:00 UTC
  • mfrom: (34.2.23)
  • Revision ID: package-import@ubuntu.com-20150121103900-eozocxj45stjs43n
Tags: 15.01.00-0ubuntu0
[Alex Hung]
* live-image/fwts-frontend-text: skip moving and avoid overwritting
  results.html (LP: #1322520)
* acpi: method: add check for _PSD
* acpi: method: add check for _PRW

[Colin Ian King]
* acpi: acpidump: reduce scope of variables
* acpi: battery: reduce scope of variables
* acpi: brightness: reduce scope of variables
* acpi: brightness: reduce scope of variables
* acpi: crsdump: reduce scope of variables
* acpi: lid: reduce scope of variables
* utilities: kernelscan: reduce scope of variables
* uefi: uefirtvariable: reduce scope of variables
* acpi: dmar: reduce scope of variables
* acpi: pcc: reduce scope of variables
* acpi: method: reduce scope of variables
* acpi: s3: reduce scope of variables
* acpi: s3power: reduce scope of variables
* acpi: s4: reduce scope of variables
* bios: hdaaudio: reduce scope of variables
* bios: mtrr: reduce scope of variables
* bios: multiproc: reduce scope of variables
* cpu: cpufreq: reduce scope of variables
* cpu: maxfreq: reduce scope of variables
* cpu: microcode: reduce scope of variables
* cpu: msr: reduce scope of variables
* cpu: nx: reduce scope of variables
* hotkey: reduce scope of variables
* hpet: hpet_check: reduce scope of variables
* lib: fwts_acpi_tables: reduce scope of variables
* lib: fwts_backtrace: reduce scope of variables
* lib: fwts_battery: reduce scope of variables
* lib: fwts_dump: replace asctime with strftime
* lib: fwts_efi_module: reduce scope of variable
* cmos: cmosdump: clarify precedence for & and ?
* lib: fwts_framework: fix some minor style warnings from cppcheck
* lib: fwts_gpe: reduce scope of variables
* lib: fwts_memorymap: fix typo on memory comparison sort
* lib: fwts_memorymap: reduce scope of variables
* lib: fwts_log: reduce scope of variables
* lib: fwts_pm_method: reduce scope of variables
* reduce scope of variables
* lib: fwts_uefi: reduce scope of variables
* pci: aspm: reduce scope of variables
* lib: klog: reduce scope of variables
* uefi: uefibootpath: reduce scope of variables
* uefi: securebootcert: reduce scope of variables
* uefi: uefidump: reduce scope of variables
* uefi: uefirtauthvar: reduce scope of variables
* uefi: uefirtmisc: reduce scope of variables
* uefi: uefivarinfo: reduce scope of variables

[Ivan Hu]
* uefibootpath: include the null-terminated space in device path length
* fwts-test: update fwts tests to sync with method tests

[Naresh Bhat]
* makefile.am : Use sysroot path for json

Show diffs side-by-side

added added

removed removed

Lines of Context:
606
606
                                        "The length of File Path Media Device Path is %" PRIu16 " bytes "
607
607
                                        "is not matching with adding the length of Path String %" PRIu16 " bytes.",
608
608
                                        len,
609
 
                                        (uint16_t)(sizeof(fwts_uefi_file_path_dev_path) + (fwts_uefi_str16len(f->path_name) * sizeof(uint16_t))));
 
609
                                        (uint16_t)(sizeof(fwts_uefi_file_path_dev_path) + ((fwts_uefi_str16len(f->path_name) + 1) * sizeof(uint16_t))));
610
610
                                errors++;
611
611
                                break;
612
612
                        }
660
660
                                break;
661
661
                        }
662
662
                        fwts_uefi_bios_dev_path *b = (fwts_uefi_bios_dev_path *)dev_path;
663
 
                        if (len != (sizeof(fwts_uefi_bios_dev_path) + strlen(b->description))) {
 
663
                        if (len != (sizeof(fwts_uefi_bios_dev_path) + strlen(b->description) + 1)) {
664
664
                                fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBiosBootDevPathLength",
665
665
                                        "The length of BIOS Boot Specification Device Path is %" PRIu16 " bytes "
666
666
                                        "is not matching with adding the length of Description String %" PRIu16 " bytes.",
667
667
                                        len,
668
 
                                        (uint16_t)(sizeof(fwts_uefi_bios_dev_path) + strlen(b->description)));
 
668
                                        (uint16_t)(sizeof(fwts_uefi_bios_dev_path) + strlen(b->description) + 1));
669
669
                                errors++;
670
670
                        }
671
671
                        break;
734
734
static void uefibootpath_var(fwts_framework *fw, fwts_uefi_var *var)
735
735
{
736
736
        char varname[512];
737
 
        int ret;
738
737
 
739
738
        fwts_uefi_get_varname(varname, sizeof(varname), var);
740
739
 
742
741
        if ((strlen(varname) == 8) && (strncmp(varname, "Boot", 4) == 0)
743
742
                        && isxdigit(varname[4]) && isxdigit(varname[5])
744
743
                        && isxdigit(varname[6]) && isxdigit(varname[7])) {
 
744
                int ret;
 
745
 
745
746
                fwts_log_info_verbatum(fw, "Name: %s", varname);
746
747
                errors = 0;
747
748
                ret = uefibootpath_info_bootdev(fw, var);