Hello community, here is the log from the commit of package efivar for openSUSE:Factory checked in at 2015-12-23 08:48:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/efivar (Old) and /work/SRC/openSUSE:Factory/.efivar.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "efivar" Changes: -------- --- /work/SRC/openSUSE:Factory/efivar/efivar.changes 2015-06-30 10:14:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.efivar.new/efivar.changes 2015-12-23 08:48:18.000000000 +0100 @@ -1,0 +2,14 @@ +Tue Dec 1 09:08:28 UTC 2015 - [email protected] + +- Update the source link + +------------------------------------------------------------------- +Fri Nov 27 10:23:58 UTC 2015 - [email protected] + +- Update to 0.21 +- Add efivar-fix-initializer.patch to initialize ifreq properly +- Drop patches + + efivar-fix-vars_del_variable.patch: upstreamed + + efivar-revert-linker-order.patch: not necessary + +------------------------------------------------------------------- Old: ---- efivar-0.20.tar.bz2 efivar-fix-vars_del_variable.patch efivar-revert-linker-order.patch New: ---- efivar-0.21.tar.bz2 efivar-fix-initializer.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ efivar.spec ++++++ --- /var/tmp/diff_new_pack.ebMhPk/_old 2015-12-23 08:48:19.000000000 +0100 +++ /var/tmp/diff_new_pack.ebMhPk/_new 2015-12-23 08:48:19.000000000 +0100 @@ -17,15 +17,14 @@ Name: efivar -Version: 0.20 +Version: 0.21 Release: 0 Summary: Tools to manage UEFI variables License: LGPL-2.1 Group: Development/Libraries/Other -Url: https://github.com/vathpela/efivar -Source0: https://github.com/vathpela/efivar/releases/download/%{version}/%{name}-%{version}.tar.bz2 -Patch1: efivar-revert-linker-order.patch -Patch2: efivar-fix-vars_del_variable.patch +Url: https://github.com/rhinstaller/efivar +Source0: https://github.com/rhinstaller/efivar/releases/download/%{version}/%{name}-%{version}.tar.bz2 +Patch1: efivar-fix-initializer.patch BuildRequires: fdupes BuildRequires: pkg-config BuildRequires: popt-devel @@ -52,7 +51,6 @@ %prep %setup -q %patch1 -p1 -%patch2 -p1 %build export CFLAGS="%{optflags}" ++++++ efivar-0.20.tar.bz2 -> efivar-0.21.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/.gitignore new/efivar-0.21/.gitignore --- old/efivar-0.20/.gitignore 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/.gitignore 2015-07-13 22:00:06.000000000 +0200 @@ -7,7 +7,7 @@ *.S !src/guids.S *.so -*.so.? +*.so.* *.tar.* .*.c.P .*.h.P diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/Make.defaults new/efivar-0.21/Make.defaults --- old/efivar-0.20/Make.defaults 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/Make.defaults 2015-07-13 22:00:06.000000000 +0200 @@ -6,13 +6,14 @@ PCDIR ?= $(libdir)/pkgconfig/ CC := $(if $(filter default,$(origin CC)),gcc,$(CC)) CCLD := $(if $(filter undefined,$(origin CCLD)),$(CC),$(CCLD)) -CFLAGS ?= -O0 -g +CFLAGS ?= -O2 -g ARCH = $(shell uname -m) clang_cflags = gcc_cflags = -Wmaybe-uninitialized cflags := $(CFLAGS) \ - -Wall -Wsign-compare -std=gnu11 -fshort-wchar -fPIC \ + -Werror -Wall -Wsign-compare -Wstrict-aliasing \ + -std=gnu11 -fshort-wchar -fPIC \ -fvisibility=hidden \ -D_GNU_SOURCE -I${TOPDIR}/src/include/efivar/ \ $(if $(filter $(CC),clang),$(clang_cflags),) \ @@ -23,5 +24,3 @@ $(if $(filter $(CCLD),clang),$(clang_ccldflags),) \ $(if $(filter $(CCLD),gcc),$(gcc_ccldflags),) LIBFLAGS += -shared - -SONAME_VERSION := 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/Make.rules new/efivar-0.21/Make.rules --- old/efivar-0.20/Make.rules 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/Make.rules 2015-07-13 22:00:06.000000000 +0200 @@ -4,11 +4,14 @@ % : %.o $(CCLD) $(ccldflags) -o $@ $^ $(foreach lib,$(LIBS),-l$(lib)) -%.so.$(SONAME_VERSION) : - $(CCLD) $(cflags) -Wl,-soname,$@ $(ccldflags) $(LIBFLAGS) $^ -o $@ $(foreach lib,$(LIBS),-l$(lib)) +%.so.$(VERSION) : + $(CCLD) $(cflags) -Wl,-soname,$(patsubst %.so.$(VERSION),%.so.$(MAJOR_VERSION),$@) $(ccldflags) $(LIBFLAGS) $^ -o $@ $(foreach lib,$(LIBS),-l$(lib)) -%.so : %.so.$(SONAME_VERSION) - ln -sf $^ $@ +%.so : %.so.$(VERSION) + ln -sf $< $@ + +%.so.$(MAJOR_VERSION) : %.so.$(VERSION) + ln -sf $< $@ %.o: %.c $(CC) $(cflags) $(CPPFLAGS) -c -o $@ $< diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/Make.version new/efivar-0.21/Make.version --- old/efivar-0.20/Make.version 1970-01-01 01:00:00.000000000 +0100 +++ new/efivar-0.21/Make.version 2015-07-13 22:00:06.000000000 +0200 @@ -0,0 +1,3 @@ +MAJOR_VERSION = 0 +MINOR_VERSION = 21 +VERSION = $(MAJOR_VERSION).$(MINOR_VERSION) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/Makefile new/efivar-0.21/Makefile --- old/efivar-0.20/Makefile 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/Makefile 2015-07-13 22:00:06.000000000 +0200 @@ -1,27 +1,34 @@ TOPDIR = $(shell echo $$PWD) +include $(TOPDIR)/Make.version + SUBDIRS := src docs -VERSION := 0.20 all : $(SUBDIRS) efivar.spec efivar efivar-static : - $(MAKE) -C src TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) VERSION=$(VERSION) $@ + $(MAKE) -C src TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ $(SUBDIRS) : - $(MAKE) -C $@ TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) VERSION=$(VERSION) + $(MAKE) -C $@ TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) clean : @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done @rm -vf efivar.spec install : - @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) VERSION=$(VERSION) DESTDIR=$(DESTDIR) includedir=$(includedir) bindir=$(bindir) libdir=$(libdir) PCDIR=$(PCDIR) $@ ; done + @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) DESTDIR=$(DESTDIR) includedir=$(includedir) bindir=$(bindir) libdir=$(libdir) PCDIR=$(PCDIR) $@ ; done -test : all - @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done +brick : all + @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) test ; done + +a : + @if [ $${EUID} != 0 ]; then \ + echo no 1>&2 ; \ + exit 1 ; \ + fi -.PHONY: $(SUBDIRS) all clean install test +.PHONY: $(SUBDIRS) all clean install a brick include $(TOPDIR)/Make.defaults include $(TOPDIR)/Make.rules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/README new/efivar-0.21/README --- old/efivar-0.20/README 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -efivar -========= - -Tools and library to manipulate EFI variables. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; version 2.1 -of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see <http://www.gnu.org/licenses/>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/README.md new/efivar-0.21/README.md --- old/efivar-0.20/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/efivar-0.21/README.md 2015-07-13 22:00:06.000000000 +0200 @@ -0,0 +1,26 @@ +efivar +====== + +Tools and libraries to manipulate EFI variables +--------------------------------------------- + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; version 2.1 +of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see [http://www.gnu.org/licenses/]. + +[http://www.gnu.org/licenses/]: http://www.gnu.org/licenses/ + +WARNING +======= +You should probably not run "make a brick" *ever*, unless you're already +reasonably sure it won't permanently corrupt your firmware. This is not a +joke. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/docs/Makefile new/efivar-0.21/docs/Makefile --- old/efivar-0.20/docs/Makefile 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/docs/Makefile 2015-07-13 22:00:06.000000000 +0200 @@ -2,6 +2,7 @@ TOPDIR = $(SRCDIR)/.. include $(TOPDIR)/Make.defaults +include $(TOPDIR)/Make.version MAN1TARGETS = efivar.1 MAN3TARGETS = efi_append_variable.3 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/efivar.spec new/efivar-0.21/efivar.spec --- old/efivar-0.20/efivar.spec 2015-06-02 20:36:37.000000000 +0200 +++ new/efivar-0.21/efivar.spec 2015-07-13 22:00:38.000000000 +0200 @@ -1,5 +1,5 @@ Name: efivar -Version: 0.20 +Version: 0.21 Release: 1%{?dist} Summary: Tools to manage UEFI variables License: LGPLv2.1 @@ -54,7 +54,7 @@ %files %{!?_licensedir:%global license %%doc} %license COPYING -%doc README +%doc README.md %{_bindir}/efivar %{_mandir}/man1/* @@ -68,6 +68,17 @@ %{_libdir}/*.so.* %changelog +* Mon Jul 13 2015 Peter Jones <[email protected]> - 0.21-1 +- Rename "make test" so packagers don't think it's a good idea to run it + during builds. +- Error check sizes in vars_get_variable() +- Fix some file size comparisons +- make SONAME reflect the correct values. +- Fix some uses of "const" +- Compile with -O2 by default +- Fix some strict-aliasing violations +- Fix some of the .pc files and how we do linking to work better. + * Tue Jun 02 2015 Peter Jones <[email protected]> - 0.20-1 - Update to 0.20 - Make sure tester is build with the right link order for libraries. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/efivar.spec.in new/efivar-0.21/efivar.spec.in --- old/efivar-0.20/efivar.spec.in 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/efivar.spec.in 2015-07-13 22:00:06.000000000 +0200 @@ -54,7 +54,7 @@ %files %{!?_licensedir:%global license %%doc} %license COPYING -%doc README +%doc README.md %{_bindir}/efivar %{_mandir}/man1/* @@ -68,6 +68,17 @@ %{_libdir}/*.so.* %changelog +* Mon Jul 13 2015 Peter Jones <[email protected]> - 0.21-1 +- Rename "make test" so packagers don't think it's a good idea to run it + during builds. +- Error check sizes in vars_get_variable() +- Fix some file size comparisons +- make SONAME reflect the correct values. +- Fix some uses of "const" +- Compile with -O2 by default +- Fix some strict-aliasing violations +- Fix some of the .pc files and how we do linking to work better. + * Tue Jun 02 2015 Peter Jones <[email protected]> - 0.20-1 - Update to 0.20 - Make sure tester is build with the right link order for libraries. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/Makefile new/efivar-0.21/src/Makefile --- old/efivar-0.20/src/Makefile 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/Makefile 2015-07-13 22:00:06.000000000 +0200 @@ -2,12 +2,14 @@ TOPDIR = $(realpath ..) include $(TOPDIR)/Make.defaults +include $(TOPDIR)/Make.version -LIBTARGETS = libefivar.so.$(SONAME_VERSION) libefiboot.so.$(SONAME_VERSION) +LIBTARGETS = $(foreach x,libefivar libefiboot,$(x).so.$(VERSION) $(x).so.$(MAJOR_VERSION)) PCTARGETS = efivar.pc efiboot.pc BINTARGETS = efivar INCTARGETS = include/efivar/efivar-guids.h -all : $(LIBTARGETS) $(PCTARGETS) $(BINTARGETS) $(INCTARGETS) libefiboot.so +all : $(EFIVAR_DEPS) $(INCTARGETS) deps +all : $(LIBTARGETS) $(PCTARGETS) $(BINTARGETS) libefiboot.so @$(MAKE) -C test TOPDIR=$(TOPDIR) SRCDIR=$(SRCDIR)/test $@ EFIVAR_OBJECTS = dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o \ @@ -22,23 +24,22 @@ include/efivar/.efivar-guids.h.P EFIVAR_LIBS = dl -MAKEGUIDS_DEPS = .makeguids.c.P .efivar.h.P .util.h.P .guid.h.P +MAKEGUIDS_DEPS = .makeguids.c.P include/efivar/.efivar.h.P .util.h.P .guid.h.P EFIBOOT_OBJECTS = \ crc32.o creator.o disk.o gpt.o linux.o loadopt.o EFIBOOT_DEPS = \ .crc32.c.P .crc32.h.P .creator.c.P .disk.c.P .disk.h.P \ .gpt.c.P .gpt.h.P .linux.c.P .linux.h.P .loadopt.c.P \ - include/efivar/.efivar-creator.h.P \ - include/efivar/.efivar-loadopt.h.P + include/efivar/.efiboot-creator.h.P \ + include/efivar/.efiboot-loadopt.h.P libefivar.a :: $(EFIVAR_OBJECTS) - -libefivar.so.$(SONAME_VERSION) :: $(EFIVAR_OBJECTS) +libefivar.so.$(VERSION) : LIBS = $(EFIVAR_LIBS) +libefivar.so.$(VERSION) : $(EFIVAR_OBJECTS) libefiboot.a :: $(EFIBOOT_OBJECTS) - -libefiboot.so.$(SONAME_VERSION) :: $(EFIBOOT_OBJECTS) +libefiboot.so.$(VERSION) : $(EFIBOOT_OBJECTS) libefivar.so efivar : efivar.o libefivar.so $(CCLD) $(ccldflags) -L. -lefivar -o $@ $^ \ @@ -56,10 +57,10 @@ include/efivar/efivar.h : include/efivar/efivar-guids.h fakeguid.o : guid.c - $(CC) $(cflags) -DEFIVAR_BUILD_ENVIRONMENT -c -o $@ $^ + $(CC) $(cflags) -DEFIVAR_BUILD_ENVIRONMENT -c -o $@ $< makeguids.o : makeguids.c - $(CC) $(cflags) -DEFIVAR_BUILD_ENVIRONMENT -c -o $@ $^ + $(CC) $(cflags) -DEFIVAR_BUILD_ENVIRONMENT -c -o $@ $< makeguids : makeguids.o fakeguid.o $(CC) $(cflags) -o $@ $^ -ldl @@ -67,7 +68,7 @@ include/efivar/efivar-guids.h : makeguids guids.txt ./makeguids guids.txt guids.bin names.bin guid-symbols.S $@ -guidlist.o : include/efivar/efivar-guids.h +guidlist.o : guids.S include/efivar/efivar-guids.h $(CC) $(cflags) -c -o guidlist.o guids.S guid-symbols.o : guid-symbols.S @@ -82,7 +83,7 @@ -include $(MAKEGUIDS_DEPS) clean : - @rm -rfv *~ *.o *.a *.so *.so.$(SONAME_VERSION) .*.c.P .*.h.P $(PCTARGETS) $(BINTARGETS) $(INCTARGETS) *.bin guid-symbols.S makeguids include/efivar/.*.h.P $(LIBTARGETS) + @rm -rfv *~ *.o *.a *.so *.so.$(MAJOR_VERSION) *.so.$(VERSION) .*.c.P .*.h.P $(PCTARGETS) $(BINTARGETS) $(INCTARGETS) *.bin guid-symbols.S makeguids include/efivar/.*.h.P $(LIBTARGETS) @$(MAKE) -C test TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/src/ $@ install : all @@ -94,7 +95,8 @@ $(foreach x, $(wildcard $(TOPDIR)/src/include/efivar/*.h), $(INSTALL) -m 644 $(x) $(DESTDIR)$(includedir)/efivar/$(notdir $(x));) $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(foreach x, $(BINTARGETS), $(INSTALL) -m 755 $(x) $(DESTDIR)$(bindir);) - $(foreach x, $(wildcard *.so.$(SONAME_VERSION)), ln -fs $(x) $(patsubst %.so.$(SONAME_VERSION),%.so,$(DESTDIR)$(libdir)/$(x));) + $(foreach x, $(wildcard *.so.$(VERSION)), ln -fs $(x) $(patsubst %.so.$(VERSION),%.so,$(DESTDIR)$(libdir)/$(x));) + $(foreach x, $(wildcard *.so.$(VERSION)), ln -fs $(x) $(patsubst %.so.$(VERSION),%.so.$(MAJOR_VERSION),$(DESTDIR)$(libdir)/$(x));) test :all $(MAKE) -C test TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/src/ $@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/creator.c new/efivar-0.21/src/creator.c --- old/efivar-0.20/src/creator.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/creator.c 2015-07-13 22:00:06.000000000 +0200 @@ -40,7 +40,7 @@ static int __attribute__((__nonnull__ (1,2,3))) -find_file(const char const *filepath, char **devicep, char **relpathp) +find_file(const char * const filepath, char **devicep, char **relpathp) { struct stat fsb = { 0, }; int rc; @@ -289,7 +289,7 @@ __attribute__((__nonnull__ (3))) __attribute__((__visibility__ ("default"))) efi_generate_file_device_path(uint8_t *buf, ssize_t size, - const char const *filepath, + const char * const filepath, uint32_t options, ...) { int rc; @@ -327,8 +327,8 @@ static ssize_t __attribute__((__nonnull__ (3,4,5,6))) make_ipv4_path(uint8_t *buf, ssize_t size, - const char const *local_addr, const char const *remote_addr, - const char const *gateway_addr, const char const *netmask, + const char * const local_addr, const char * const remote_addr, + const char * const gateway_addr, const char * const netmask, uint16_t local_port, uint16_t remote_port, uint16_t protocol, uint8_t addr_origin) { @@ -346,11 +346,11 @@ __attribute__((__nonnull__ (3,4,5,6,7))) __attribute__((__visibility__ ("default"))) efi_generate_ipv4_device_path(uint8_t *buf, ssize_t size, - const char const *ifname, - const char const *local_addr, - const char const *remote_addr, - const char const *gateway_addr, - const char const *netmask, + const char * const ifname, + const char * const local_addr, + const char * const remote_addr, + const char * const gateway_addr, + const char * const netmask, uint16_t local_port, uint16_t remote_port, uint16_t protocol, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/dp-media.c new/efivar-0.21/src/dp-media.c --- old/efivar-0.20/src/dp-media.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/dp-media.c 2015-07-13 22:00:06.000000000 +0200 @@ -36,7 +36,7 @@ case EFIDP_HD_SIGNATURE_MBR: off += format(buf, size, off, "MBR,0x%"PRIu32",0x%"PRIx64",0x%"PRIx64")", - *(uint32_t *)dp->hd.signature, + *(char *)dp->hd.signature, dp->hd.start, dp->hd.size); break; case EFIDP_HD_SIGNATURE_GUID: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/dp-message.c new/efivar-0.21/src/dp-message.c --- old/efivar-0.20/src/dp-message.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/dp-message.c 2015-07-13 22:00:06.000000000 +0200 @@ -138,7 +138,7 @@ format_sas(char *buf, size_t size, const_efidp dp) { size_t off = 0; - const efidp_sas const *s = &dp->sas; + const efidp_sas * const s = &dp->sas; int more_info = 0; int sassata = 0; @@ -146,9 +146,9 @@ int connect = 0; int drive_bay = -1; - const char const *sassata_label[] = {"NoTopology", "SAS", "SATA"}; - const char const *location_label[] = {"Internal", "External" }; - const char const *connect_label[] = {"Direct", "Expanded" }; + const char * const sassata_label[] = {"NoTopology", "SAS", "SATA"}; + const char * const location_label[] = {"Internal", "External" }; + const char * const connect_label[] = {"Direct", "Expanded" }; more_info = s->device_topology_info & EFIDP_SAS_TOPOLOGY_MASK; @@ -547,7 +547,7 @@ ssize_t __attribute__((__visibility__ ("default"))) efidp_make_mac_addr(uint8_t *buf, ssize_t size, uint8_t if_type, - const uint8_t const *mac_addr, ssize_t mac_addr_size) + const uint8_t * const mac_addr, ssize_t mac_addr_size) { efidp_mac_addr *mac = (efidp_mac_addr *)buf; @@ -574,16 +574,16 @@ EFIDP_MSG_IPv4, sizeof (*ipv4)); ssize_t req = sizeof (*ipv4); if (size && sz == req) { - *((uint32_t *)ipv4->local_ipv4_addr) = htonl(local); - *((uint32_t *)ipv4->remote_ipv4_addr) = htonl(remote); + *((char *)ipv4->local_ipv4_addr) = htonl(local); + *((char *)ipv4->remote_ipv4_addr) = htonl(remote); ipv4->local_port = htons(local_port); ipv4->remote_port = htons(remote_port); ipv4->protocol = htons(protocol); ipv4->static_ip_addr = 0; if (is_static) ipv4->static_ip_addr = 1; - *((uint32_t *)ipv4->gateway) = htonl(gateway); - *((uint32_t *)ipv4->netmask) = htonl(netmask); + *((char *)ipv4->gateway) = htonl(gateway); + *((char *)ipv4->netmask) = htonl(netmask); } return sz; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/dp.c new/efivar-0.21/src/dp.c --- old/efivar-0.20/src/dp.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/dp.c 2015-07-13 22:00:06.000000000 +0200 @@ -155,7 +155,7 @@ int rc; if (!dp && !dn) - return efidp_duplicate_path((const_efidp)(const efidp_header const *)&end_entire, out); + return efidp_duplicate_path((const_efidp)(const efidp_header * const)&end_entire, out); if (dp && !dn) return efidp_duplicate_path(dp, out); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/dp.h new/efivar-0.21/src/dp.h --- old/efivar-0.20/src/dp.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/dp.h 2015-07-13 22:00:06.000000000 +0200 @@ -65,14 +65,14 @@ static inline ssize_t __attribute__((__unused__)) -format_hex_helper(char *buf, size_t size, const void const *addr, +format_hex_helper(char *buf, size_t size, const void * const addr, const size_t len) { ssize_t off = 0; ssize_t sz; for (size_t i = 0; i < len; i++) { sz = format(buf, size, off, "%02x", - *((const unsigned char const *)addr+i)); + *((const unsigned char * const )addr+i)); if (sz < 0) return -1; off += sz; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/efiboot.pc.in new/efivar-0.21/src/efiboot.pc.in --- old/efivar-0.20/src/efiboot.pc.in 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/efiboot.pc.in 2015-07-13 22:00:06.000000000 +0200 @@ -6,6 +6,6 @@ Name: efiboot Description: UEFI Boot variable support Version: @@VERSION@@ -Requires: -Libs: -L${libdir} -ldl -lefivar -lefiboot +Requires.private: efivar +Libs: -L${libdir} -lefiboot Cflags: -I${includedir}/efivar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/efivar.pc.in new/efivar-0.21/src/efivar.pc.in --- old/efivar-0.20/src/efivar.pc.in 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/efivar.pc.in 2015-07-13 22:00:06.000000000 +0200 @@ -6,6 +6,6 @@ Name: efivar Description: UEFI Variable Management Version: @@VERSION@@ -Requires: -Libs: -L${libdir} -ldl -lefivar +Libs: -L${libdir} -lefivar +Libs.private: -ldl Cflags: -I${includedir}/efivar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/generics.h new/efivar-0.21/src/generics.h --- old/efivar-0.20/src/generics.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/generics.h 2015-07-13 22:00:06.000000000 +0200 @@ -34,12 +34,6 @@ return -1; } - /* if they're both NULL, we're starting over */ - if (guid == NULL && dir != NULL) { - closedir(dir); - dir = NULL; - } - /* if dir is NULL, we're also starting over */ if (!dir) { dir = opendir(path); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/guid.c new/efivar-0.21/src/guid.c --- old/efivar-0.20/src/guid.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/guid.c 2015-07-13 22:00:06.000000000 +0200 @@ -117,7 +117,7 @@ { struct guidname *result; int rc = _get_common_guidname(guid, &result); - if (rc < 0) { + if (rc >= 0) { *name = strndup(result->name, sizeof (result->name) -1); return *name ? (int)strlen(*name) : -1; } @@ -131,7 +131,7 @@ { struct guidname *result; int rc = _get_common_guidname(guid, &result); - if (rc < 0) { + if (rc >= 0) { *symbol = strndup(result->symbol, sizeof (result->symbol) -1); return *symbol ? (int)strlen(*symbol) : -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/include/efivar/efiboot-creator.h new/efivar-0.21/src/include/efivar/efiboot-creator.h --- old/efivar-0.20/src/include/efivar/efiboot-creator.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/include/efivar/efiboot-creator.h 2015-07-13 22:00:06.000000000 +0200 @@ -28,7 +28,7 @@ #define EFIBOOT_OPTIONS_IGNORE_PMBR_ERR 0x00000040 extern ssize_t efi_generate_file_device_path(uint8_t *buf, ssize_t size, - const char const *filepath, + const char * const filepath, uint32_t options, ...) __attribute__((__nonnull__ (3))); @@ -43,11 +43,11 @@ extern ssize_t efi_generate_ipv4_device_path(uint8_t *buf, ssize_t size, - const char const *ifname, - const char const *local_addr, - const char const *remote_addr, - const char const *gateway_addr, - const char const *netmask, + const char * const ifname, + const char * const local_addr, + const char * const remote_addr, + const char * const gateway_addr, + const char * const netmask, uint16_t local_port, uint16_t remote_port, uint16_t protocol, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/include/efivar/efiboot-loadopt.h new/efivar-0.21/src/include/efivar/efiboot-loadopt.h --- old/efivar-0.20/src/include/efivar/efiboot-loadopt.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/include/efivar/efiboot-loadopt.h 2015-07-13 22:00:06.000000000 +0200 @@ -30,7 +30,7 @@ extern efidp efi_loadopt_path(efi_load_option *opt) __attribute__((__nonnull__ (1))); -extern const unsigned char const *efi_loadopt_desc(efi_load_option *opt) +extern const unsigned char * const efi_loadopt_desc(efi_load_option *opt) __attribute__((__visibility__ ("default"))) __attribute__((__nonnull__ (1))); extern uint32_t efi_loadopt_attrs(efi_load_option *opt) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/include/efivar/efivar-dp.h new/efivar-0.21/src/include/efivar/efivar-dp.h --- old/efivar-0.20/src/include/efivar/efivar-dp.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/include/efivar/efivar-dp.h 2015-07-13 22:00:06.000000000 +0200 @@ -284,7 +284,7 @@ } efidp_mac_addr; extern ssize_t efidp_make_mac_addr(uint8_t *buf, ssize_t size, uint8_t if_type, - const uint8_t const *mac_addr, + const uint8_t * const mac_addr, ssize_t mac_addr_size); #define EFIDP_MSG_IPv4 0x0c @@ -687,7 +687,7 @@ efidp_bios_boot bios_boot; } efidp_data; typedef efidp_data *efidp; -typedef const efidp_data const *const_efidp; +typedef const efidp_data *const_efidp; extern int efidp_set_node_data(const_efidp dn, void *buf, size_t bufsize); extern int efidp_duplicate_path(const_efidp dp, efidp *out); @@ -740,7 +740,7 @@ return -1; /* I love you gcc. */ - *out = (const_efidp)(const efidp_header const *)((uint8_t *)in + sz); + *out = (const_efidp)(const efidp_header *)((uint8_t *)in + sz); return 0; } @@ -757,7 +757,7 @@ return -1; /* I love you gcc. */ - *out = (const_efidp)(const efidp_header const *)((uint8_t *)in + sz); + *out = (const_efidp)(const efidp_header *)((uint8_t *)in + sz); return 0; } @@ -793,7 +793,7 @@ if (sz < 0) break; - in = (const_efidp)(const efidp_header const *)((uint8_t *)in + sz); + in = (const_efidp)(const efidp_header *)((uint8_t *)in + sz); } return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/linux.c new/efivar-0.21/src/linux.c --- old/efivar-0.20/src/linux.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/linux.c 2015-07-13 22:00:06.000000000 +0200 @@ -813,7 +813,7 @@ } static ssize_t -make_net_pci_path(uint8_t *buf, ssize_t size, const char const *ifname) +make_net_pci_path(uint8_t *buf, ssize_t size, const char * const ifname) { char *linkbuf = NULL; ssize_t off=0, sz=0, loff=0; @@ -845,7 +845,7 @@ ssize_t __attribute__((__visibility__ ("hidden"))) -make_mac_path(uint8_t *buf, ssize_t size, const char const *ifname) +make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname) { struct ifreq ifr = { 0, }; struct ethtool_drvinfo drvinfo = { 0, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/linux.h new/efivar-0.21/src/linux.h --- old/efivar-0.20/src/linux.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/linux.h 2015-07-13 22:00:06.000000000 +0200 @@ -99,7 +99,7 @@ __attribute__((__visibility__ ("hidden"))); extern ssize_t make_mac_path(uint8_t *buf, ssize_t size, - const char const *ifname) + const char * const ifname) __attribute__((__visibility__ ("hidden"))); #endif /* _EFIBOOT_LINUX_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/loadopt.c new/efivar-0.21/src/loadopt.c --- old/efivar-0.20/src/loadopt.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/loadopt.c 2015-07-13 22:00:06.000000000 +0200 @@ -36,12 +36,7 @@ efidp dp, ssize_t dp_size, unsigned char *description, uint8_t *optional_data, size_t optional_data_size) { - if (!description || (!optional_data && optional_data_size != 0)) { - errno = EINVAL; - return -1; - } - - if (!dp && dp_size == 0) { + if (!description) { errno = EINVAL; return -1; } @@ -57,6 +52,16 @@ return -1; } + if (!optional_data && optional_data_size != 0) { + errno = EINVAL; + return -1; + } + + if (!dp && dp_size == 0) { + errno = EINVAL; + return -1; + } + uint8_t *pos = buf; *(uint32_t *)pos = attributes; @@ -293,7 +298,7 @@ __attribute__((__nonnull__ (1))) __attribute__((__visibility__ ("default"))) -const unsigned char const * +const unsigned char * const efi_loadopt_desc(efi_load_option *opt) { if (last_desc) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/test/Makefile new/efivar-0.21/src/test/Makefile --- old/efivar-0.20/src/test/Makefile 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/test/Makefile 2015-07-13 22:00:06.000000000 +0200 @@ -2,6 +2,7 @@ TOPDIR = $(realpath $(SRCDIR)/../..) include $(TOPDIR)/Make.defaults +include $(TOPDIR)/Make.version ccldflags += -L$(TOPDIR)/src/ -Wl,-rpath=$(TOPDIR)/src/ LIBS=efivar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/ucs2.h new/efivar-0.21/src/ucs2.h --- old/efivar-0.20/src/ucs2.h 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/ucs2.h 2015-07-13 22:00:06.000000000 +0200 @@ -6,7 +6,7 @@ static inline size_t __attribute__((__unused__)) -ucs2len(const uint16_t const *s, ssize_t limit) +ucs2len(const uint16_t * const s, ssize_t limit) { ssize_t i; for (i = 0; i < (limit >= 0 ? limit : i+1) && s[i] != L'\0'; i++) @@ -16,7 +16,7 @@ static inline size_t __attribute__((__unused__)) -ucs2size(const uint16_t const *s, ssize_t limit) +ucs2size(const uint16_t * const s, ssize_t limit) { size_t rc = ucs2len(s, limit); rc *= sizeof (uint16_t); @@ -58,7 +58,7 @@ static inline unsigned char * __attribute__((__unused__)) -ucs2_to_utf8(const uint16_t const *chars, ssize_t limit) +ucs2_to_utf8(const uint16_t * const chars, ssize_t limit) { ssize_t i, j; unsigned char *ret; @@ -76,6 +76,13 @@ } else if (chars[i] > 0x7f && chars[i] <= 0x7ff) { ret[j++] = 0xc0 | ev_bits(chars[i], 0x1f, 6); ret[j] = 0x80 | ev_bits(chars[i], 0x3f, 0); +#if 1 + } else if (chars[i] > 0x7ff) { + ret[j++] = 0xe0 | ev_bits(chars[i], 0xf, 12); + ret[j++] = 0x80 | ev_bits(chars[i], 0x3f, 6); + ret[j] = 0x80| ev_bits(chars[i], 0x3f, 0); + } +#else } else if (chars[i] > 0x7ff && chars[i] < 0x10000) { ret[j++] = 0xe0 | ev_bits(chars[i], 0xf, 12); ret[j++] = 0x80 | ev_bits(chars[i], 0x3f, 6); @@ -99,6 +106,7 @@ ret[j++] = 0x80 | ev_bits(chars[i], 0x3f, 6); ret[j] = 0x80 | ev_bits(chars[i], 0x3f, 0); } +#endif } ret[j] = '\0'; return (unsigned char *)strdup((char *)ret); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/efivar-0.20/src/vars.c new/efivar-0.21/src/vars.c --- old/efivar-0.20/src/vars.c 2015-06-02 20:32:44.000000000 +0200 +++ new/efivar-0.21/src/vars.c 2015-07-13 22:00:06.000000000 +0200 @@ -285,10 +285,17 @@ if (rc < 0) goto err; + bufsize -= 1; /* read_file pads out 1 extra byte to NUL it */ if (is_64bit()) { - efi_kernel_variable_64_t *var64 = (void *)buf; + efi_kernel_variable_64_t *var64; + if (bufsize != sizeof(efi_kernel_variable_64_t)) { + errno = EFBIG; + goto err; + } + + var64 = (void *)buf; *data = malloc(var64->DataSize); if (!*data) goto err; @@ -296,8 +303,14 @@ *data_size = var64->DataSize; *attributes = var64->Attributes; } else { - efi_kernel_variable_32_t *var32 = (void *)buf; + efi_kernel_variable_32_t *var32; + + if (bufsize != sizeof(efi_kernel_variable_32_t)) { + errno = EFBIG; + goto err; + } + var32 = (void *)buf; *data = malloc(var32->DataSize); if (!*data) goto err; @@ -344,9 +357,15 @@ goto err; rc = read_file(fd, &buf, &buf_size); - if (rc < 0 || (buf_size != sizeof(efi_kernel_variable_64_t) && - buf_size != sizeof(efi_kernel_variable_32_t))) + buf_size -= 1; /* read_file pads out 1 extra byte to NUL it */ + if (rc < 0) + goto err; + + if (buf_size != sizeof(efi_kernel_variable_64_t) && + buf_size != sizeof(efi_kernel_variable_32_t)) { + errno = EFBIG; goto err; + } close(fd); fd = open(VARS_PATH "del_var", O_WRONLY); ++++++ efivar-fix-initializer.patch ++++++ >From a3606c02fd271d32e364fcc540e34ba1899309f6 Mon Sep 17 00:00:00 2001 From: Peter Jones <[email protected]> Date: Tue, 14 Jul 2015 09:33:54 -0400 Subject: [PATCH] Sometimes the compiler doesn't like { 0, } as an initializer... Because it really wants to be { {0, },} or something, and sometimes the compiler, knowing full well what we're trying to do, likes to complain about the rigor applied to our technique in doing it. memset() the struct ifreq to 0 instead so I don't need to figure out its internal structure just to zero it out. Resolves #28 Signed-off-by: Peter Jones <[email protected]> --- src/linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/linux.c b/src/linux.c index 57f71f3..817b8e6 100644 --- a/src/linux.c +++ b/src/linux.c @@ -847,12 +847,13 @@ ssize_t __attribute__((__visibility__ ("hidden"))) make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname) { - struct ifreq ifr = { 0, }; + struct ifreq ifr; struct ethtool_drvinfo drvinfo = { 0, }; int fd, rc; ssize_t ret = -1, sz, off=0; char busname[PATH_MAX+1] = ""; + memset(&ifr, 0, sizeof (ifr)); strncpy(ifr.ifr_name, ifname, IF_NAMESIZE); drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (caddr_t)&drvinfo; -- 2.6.3
