Revert "Only open with O_CREAT if we're not using EFI_VARIABLE_APPEND_WRITE."

This reverts commit 7153d0dbb7d1d36b1712dfa91e2e62043880fdfa.
License metadata fix in the spec file.

Use the new format for license in %files

Signed-off-by: Peter Jones <pjones@redhat.com>
Remove variables we've failed to create.

Since creation happens in the firmware only when SetVariable() has
succeeded, but that happens on write(2) not on creat(2), if write()
fails, we leave empty and confusing files in the filesystem.  Remove
them in that case.

Signed-off-by: Peter Jones <pjones@redhat.com>
Just some whitespace cleanup.

Signed-off-by: Peter Jones <pjones@redhat.com>
Excise read_fd() since we've got read_file(), plus cleanups.

We don't need two of this, and we especially don't need two of it with
memory leaks or read loop bugs.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make get_random_bytes() something covscan can reasonably grok as alloc.

Hopefully.

Signed-off-by: Peter Jones <pjones@redhat.com>
covscan doesn't like memcmp() of NULL even with size of 0.

*sigh*.

Signed-off-by: Peter Jones <pjones@redhat.com>
Notice if chmod doesn't work.

Not that there's anything we could do about it, mind you.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make "wrong size" test more verbose.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make the generic append actually work for vars.

Signed-off-by: Peter Jones <pjones@redhat.com>
Don't leak a file descriptor in the efivar utility.

Doesn't really matter, but I'd like smaller covscan results.

Signed-off-by: Peter Jones <pjones@redhat.com>
Bit test has | instead of & .

Dunno what I was thinking that day.

Signed-off-by: Peter Jones <pjones@redhat.com>
Error check fcntl.

Covscan again.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make CCLD overrideable.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make it so CC=clang and CCLD=clang (independently) work.

If you just do CC=clang you'll get CCLD=clang by default, so if for some
reason you want CC=clang CCLD=gcc, specify that manually.

Signed-off-by: Peter Jones <pjones@redhat.com>