Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551440 - app-crypt/tpm-tools: src/tpm_mgmt/tpm_nvread.c fails to include <sys/stat.h>
Summary: app-crypt/tpm-tools: src/tpm_mgmt/tpm_nvread.c fails to include <sys/stat.h>
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
URL: https://sourceforge.net/p/trousers/bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-07 13:00 UTC by Anthony Basile
Modified: 2015-06-07 15:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2015-06-07 13:00:16 UTC
src/tpm_mgmt/tpm_nvread.c references S_IRUSR and friends but does not include <sys/stat.h> which defines them according to POSIX standards.  It builds on glibc systems because of the way the headers include one another, but on other libc's this fails.  Fixing this is trivial.  I'll inline the patch:

--- tpm_nvread.c.orig	2015-06-07 13:00:30.250314575 +0000
+++ tpm_nvread.c	2015-06-07 12:54:45.590302275 +0000
@@ -23,6 +23,7 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <sys/stat.h>
 
 #include "tpm_nvcommon.h"
 #include "tpm_tspi.h"


For reference, see:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2015-06-07 14:52:09 UTC
Patch submitted upstream at ${UR}.
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2015-06-07 15:16:30 UTC
in future, please attach patches suitable to be applied at package root (-p0..N).
Comment 3 Anthony Basile gentoo-dev 2015-06-07 15:41:36 UTC
(In reply to Alon Bar-Lev from comment #2)
> in future, please attach patches suitable to be applied at package root
> (-p0..N).

i anticipated adding the patch myself to the tree rather than cause more work for people.
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2015-06-07 15:43:40 UTC
(In reply to Anthony Basile from comment #3)
> (In reply to Alon Bar-Lev from comment #2)
> > in future, please attach patches suitable to be applied at package root
> > (-p0..N).
> 
> i anticipated adding the patch myself to the tree rather than cause more
> work for people.

no reason not to attach proper resources.

if you get a go from maintainer you can go ahead and commit, but usually this is not the model we use.