* label_file.c:434: error: implicit declaration of function 'fstat'
@ 2010-02-15 22:19 Justin Mattock
2010-02-16 3:34 ` [refpolicy] " Justin P. mattock
2010-02-16 14:29 ` Stephen Smalley
0 siblings, 2 replies; 5+ messages in thread
From: Justin Mattock @ 2010-02-15 22:19 UTC (permalink / raw)
To: SE-Linux
this is new:
make[2]: Leaving directory `/home/kernel/selinux/libselinux/include'
make -C src install
make[2]: Entering directory `/home/kernel/selinux/libselinux/src'
cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn
-Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c
cc1: warnings being treated as errors
label_file.c: In function 'init':
label_file.c:434: error: implicit declaration of function 'fstat'
label_file.c:436: error: implicit declaration of function 'S_ISREG'
make[2]: *** [label_file.o] Error 1
make[2]: Leaving directory `/home/kernel/selinux/libselinux/src'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/kernel/selinux/libselinux'
make: *** [install] Error 1
three areas where this could of been created
update glibc
updated kernel
update userspace(altohugh there was not vary many commits in the pull).
--
Justin P. Mattock
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: label_file.c:434: error: implicit declaration of function 'fstat'
2010-02-15 22:19 label_file.c:434: error: implicit declaration of function 'fstat' Justin Mattock
@ 2010-02-16 3:34 ` Justin P. mattock
2010-02-16 14:29 ` Stephen Smalley
1 sibling, 0 replies; 5+ messages in thread
From: Justin P. mattock @ 2010-02-16 3:34 UTC (permalink / raw)
To: SE-Linux; +Cc: libc-help, refpolicy
On 02/15/2010 02:19 PM, Justin Mattock wrote:
> this is new:
>
>
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/include'
> make -C src install
> make[2]: Entering directory `/home/kernel/selinux/libselinux/src'
> cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn
> -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c
> cc1: warnings being treated as errors
> label_file.c: In function 'init':
> label_file.c:434: error: implicit declaration of function 'fstat'
> label_file.c:436: error: implicit declaration of function 'S_ISREG'
> make[2]: *** [label_file.o] Error 1
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/src'
> make[1]: *** [install] Error 2
> make[1]: Leaving directory `/home/kernel/selinux/libselinux'
> make: *** [install] Error 1
>
> three areas where this could of been created
> update glibc
> updated kernel
> update userspace(altohugh there was not vary many commits in the pull).
>
>
>
looking more into this error by selinux userspace tools(libselinux),
seems there was a change in libc which breaks libselinux.
I've started the bisect with libc but could not go any further because
libc fails to build. The positive side is I'm only about 15 or so
commits from the last good commit I had, which gets libselinux to build.
heres the last bad commit and last good commit with libc(I'm trying to
narrow this down, but libc breaks).
last bad commit: 7b4715c5362319e1ff2f9555d17133146e16081a
(bisect is broken by this point).
last good commit: d5ea695b42aecd48a329756a8e93228d64714d17
I added some CC's to hopefully the appropriate
people.
As a workaround I can compile libselinux with the last good commit,
then update libc, but know that's not the right way.
Justin P. Mattock
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [refpolicy] label_file.c:434: error: implicit declaration of function 'fstat'
@ 2010-02-16 3:34 ` Justin P. mattock
0 siblings, 0 replies; 5+ messages in thread
From: Justin P. mattock @ 2010-02-16 3:34 UTC (permalink / raw)
To: refpolicy
On 02/15/2010 02:19 PM, Justin Mattock wrote:
> this is new:
>
>
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/include'
> make -C src install
> make[2]: Entering directory `/home/kernel/selinux/libselinux/src'
> cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn
> -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c
> cc1: warnings being treated as errors
> label_file.c: In function 'init':
> label_file.c:434: error: implicit declaration of function 'fstat'
> label_file.c:436: error: implicit declaration of function 'S_ISREG'
> make[2]: *** [label_file.o] Error 1
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/src'
> make[1]: *** [install] Error 2
> make[1]: Leaving directory `/home/kernel/selinux/libselinux'
> make: *** [install] Error 1
>
> three areas where this could of been created
> update glibc
> updated kernel
> update userspace(altohugh there was not vary many commits in the pull).
>
>
>
looking more into this error by selinux userspace tools(libselinux),
seems there was a change in libc which breaks libselinux.
I've started the bisect with libc but could not go any further because
libc fails to build. The positive side is I'm only about 15 or so
commits from the last good commit I had, which gets libselinux to build.
heres the last bad commit and last good commit with libc(I'm trying to
narrow this down, but libc breaks).
last bad commit: 7b4715c5362319e1ff2f9555d17133146e16081a
(bisect is broken by this point).
last good commit: d5ea695b42aecd48a329756a8e93228d64714d17
I added some CC's to hopefully the appropriate
people.
As a workaround I can compile libselinux with the last good commit,
then update libc, but know that's not the right way.
Justin P. Mattock
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: label_file.c:434: error: implicit declaration of function 'fstat'
2010-02-15 22:19 label_file.c:434: error: implicit declaration of function 'fstat' Justin Mattock
2010-02-16 3:34 ` [refpolicy] " Justin P. mattock
@ 2010-02-16 14:29 ` Stephen Smalley
2010-02-16 15:58 ` Justin P. mattock
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Smalley @ 2010-02-16 14:29 UTC (permalink / raw)
To: Justin Mattock; +Cc: SE-Linux, Joshua Brindle, Chad Sellers, Eamon Walsh
On Mon, 2010-02-15 at 14:19 -0800, Justin Mattock wrote:
> this is new:
>
>
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/include'
> make -C src install
> make[2]: Entering directory `/home/kernel/selinux/libselinux/src'
> cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn
> -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c
> cc1: warnings being treated as errors
> label_file.c: In function 'init':
> label_file.c:434: error: implicit declaration of function 'fstat'
> label_file.c:436: error: implicit declaration of function 'S_ISREG'
> make[2]: *** [label_file.o] Error 1
> make[2]: Leaving directory `/home/kernel/selinux/libselinux/src'
> make[1]: *** [install] Error 2
> make[1]: Leaving directory `/home/kernel/selinux/libselinux'
> make: *** [install] Error 1
>
> three areas where this could of been created
> update glibc
> updated kernel
> update userspace(altohugh there was not vary many commits in the pull).
Newer glibc headers expose a failure to #include the required headers
for stat(2). Also exposes a conflict in redefining close() in that
file. Patch below should fix.
diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index b5e904f..509b033 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -17,6 +17,9 @@
#include <errno.h>
#include <limits.h>
#include <regex.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "callbacks.h"
#include "label_internal.h"
@@ -545,7 +548,7 @@ finish:
/*
* Backend interface routines
*/
-static void close(struct selabel_handle *rec)
+static void closef(struct selabel_handle *rec)
{
struct saved_data *data = (struct saved_data *)rec->data;
struct spec *spec;
@@ -666,7 +669,7 @@ int selabel_file_init(struct selabel_handle *rec, struct selinux_opt *opts,
memset(data, 0, sizeof(*data));
rec->data = data;
- rec->func_close = &close;
+ rec->func_close = &closef;
rec->func_stats = &stats;
rec->func_lookup = &lookup;
--
Stephen Smalley
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: label_file.c:434: error: implicit declaration of function 'fstat'
2010-02-16 14:29 ` Stephen Smalley
@ 2010-02-16 15:58 ` Justin P. mattock
0 siblings, 0 replies; 5+ messages in thread
From: Justin P. mattock @ 2010-02-16 15:58 UTC (permalink / raw)
To: Stephen Smalley; +Cc: SE-Linux, Joshua Brindle, Chad Sellers, Eamon Walsh
On 02/16/2010 06:29 AM, Stephen Smalley wrote:
> On Mon, 2010-02-15 at 14:19 -0800, Justin Mattock wrote:
>> this is new:
>>
>>
>> make[2]: Leaving directory `/home/kernel/selinux/libselinux/include'
>> make -C src install
>> make[2]: Entering directory `/home/kernel/selinux/libselinux/src'
>> cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn
>> -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE
>> -D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c
>> cc1: warnings being treated as errors
>> label_file.c: In function 'init':
>> label_file.c:434: error: implicit declaration of function 'fstat'
>> label_file.c:436: error: implicit declaration of function 'S_ISREG'
>> make[2]: *** [label_file.o] Error 1
>> make[2]: Leaving directory `/home/kernel/selinux/libselinux/src'
>> make[1]: *** [install] Error 2
>> make[1]: Leaving directory `/home/kernel/selinux/libselinux'
>> make: *** [install] Error 1
>>
>> three areas where this could of been created
>> update glibc
>> updated kernel
>> update userspace(altohugh there was not vary many commits in the pull).
>
> Newer glibc headers expose a failure to #include the required headers
> for stat(2). Also exposes a conflict in redefining close() in that
> file. Patch below should fix.
>
> diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
> index b5e904f..509b033 100644
> --- a/libselinux/src/label_file.c
> +++ b/libselinux/src/label_file.c
> @@ -17,6 +17,9 @@
> #include<errno.h>
> #include<limits.h>
> #include<regex.h>
> +#include<sys/types.h>
> +#include<sys/stat.h>
> +#include<unistd.h>
> #include "callbacks.h"
> #include "label_internal.h"
>
> @@ -545,7 +548,7 @@ finish:
> /*
> * Backend interface routines
> */
> -static void close(struct selabel_handle *rec)
> +static void closef(struct selabel_handle *rec)
> {
> struct saved_data *data = (struct saved_data *)rec->data;
> struct spec *spec;
> @@ -666,7 +669,7 @@ int selabel_file_init(struct selabel_handle *rec, struct selinux_opt *opts,
> memset(data, 0, sizeof(*data));
>
> rec->data = data;
> - rec->func_close =&close;
> + rec->func_close =&closef;
> rec->func_stats =&stats;
> rec->func_lookup =&lookup;
>
>
o.k. plugged in the above patch to libselinux, recompiled
the userspace tools, with glibc being at the last good
commit. Then reset glibc to the current HEAD(which breaks libselinux),
and userspace compiled good.(soe before and after compile good).
Thanks Stephen.
I guess the only other thing missing is a
(although the main thing is this is fixed).
Reported-Tested-by: Justin P. Mattock <justinmattock@gmail.com>
Justin P. Mattock
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-16 15:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 22:19 label_file.c:434: error: implicit declaration of function 'fstat' Justin Mattock
2010-02-16 3:34 ` Justin P. mattock
2010-02-16 3:34 ` [refpolicy] " Justin P. mattock
2010-02-16 14:29 ` Stephen Smalley
2010-02-16 15:58 ` Justin P. mattock
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.