Discussion:
[blfs-support] BLFS systemd 239?
spiky
2018-07-30 19:05:54 UTC
Permalink
Built lfs systemd svn, moved onto blfs, systemd is at 238, I have used
the 239 version with the 238 configure "didn't use 238 patch"  but get
an error. I have Pam both Doc Books and libxslt installed

FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 -Wextra
-Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition
-Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn
-Werror=missing-prototypes -Werror=implicit-function-declaration
-Werror=missing-declarations -Werror=return-type
-Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes
-Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow
-Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow
-Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time
-Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option
-fno-strict-aliasing -fvisibility=hidden -fstack-protector
-fstack-protector-strong --param=ssp-buffer-size=4 -fPIE
-ffunction-sections -fdata-sections -Wno-unused-parameter
-Wno-missing-field-initializers -Wno-unused-result
-Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include
config.h -fPIC  -MD -MQ
'journal-***@sta/src_journal_journald-server.c.o' -MF
'journal-***@sta/src_journal_journald-server.c.o.d' -o
'journal-***@sta/src_journal_journald-server.c.o' -c
../src/journal/journald-server.c
../src/journal/journald-server.c: In function ‘server_process_datagram’:
../src/journal/journald-server.c:1134:45: error: ‘SCM_SECURITY’
undeclared (first use in this function); did you mean ‘PF_SECURITY’?
                          cmsg->cmsg_type == SCM_SECURITY) {
                                             ^~~~~~~~~~~~
                                             PF_SECURITY
../src/journal/journald-server.c:1134:45: note: each undeclared
identifier is reported only once for each function it appears in
[249/1488] Compiling C object
'journal-***@sta/src_journal_journald-context.c.o'.
ninja: build stopped: subcommand failed.

Any help has some built it?
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above i
Michael Shell
2018-07-31 19:50:21 UTC
Permalink
On Mon, 30 Jul 2018 20:05:54 +0100
../src/journal/journald-server.c:1134:45: error: 'SCM_SECURITY'
undeclared (first use in this function); did you mean 'PF_SECURITY'?
                          cmsg->cmsg_type == SCM_SECURITY) {
                                             ^~~~~~~~~~~~
SCM_SECURITY is defined in the Linux kernel headers in
/include/linux/socket.h

https://elixir.bootlin.com/linux/latest/source/include/linux/socket.h#L152


/* "Socket"-level control message types: */

#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_SECURITY 0x03 /* rw: security label */


However, given that we are supposed to use "sanitized" kernel headers,
it is glibc's job to export these values. I believe this is done in
/usr/include/bits/socket.h

What version of glibc are you using? Perhaps older versions don't define
SCM_SECURITY?

Can someone with a recent glibc system verify that SCM_SECURITY is indeed
defined in /usr/include/bits/socket.h ?

FWIW, all the header include files that have references to SCM_SECURITY
can be found using:

cd /usr/include
find . -type f -name "*.h" -print|sort|xargs grep SCM_SECURITY


You can either add the SCM_ defs to your /usr/include/bits/socket.h or add
them to your systemd's journald-server.c


Cheers,

Mike
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the abo
Bruce Dubbs
2018-07-31 20:36:45 UTC
Permalink
Post by Michael Shell
On Mon, 30 Jul 2018 20:05:54 +0100
../src/journal/journald-server.c:1134:45: error: 'SCM_SECURITY'
undeclared (first use in this function); did you mean 'PF_SECURITY'?
                          cmsg->cmsg_type == SCM_SECURITY) {
                                             ^~~~~~~~~~~~
SCM_SECURITY is defined in the Linux kernel headers in
/include/linux/socket.h
https://elixir.bootlin.com/linux/latest/source/include/linux/socket.h#L152
/* "Socket"-level control message types: */
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_SECURITY 0x03 /* rw: security label */
However, given that we are supposed to use "sanitized" kernel headers,
it is glibc's job to export these values. I believe this is done in
/usr/include/bits/socket.h
What version of glibc are you using? Perhaps older versions don't define
SCM_SECURITY?
Can someone with a recent glibc system verify that SCM_SECURITY is indeed
defined in /usr/include/bits/socket.h ?
It is not. I do not find SCM_SECURITY anywhere in the /usr/include
directory tree,
Post by Michael Shell
FWIW, all the header include files that have references to SCM_SECURITY
cd /usr/include
find . -type f -name "*.h" -print|sort|xargs grep SCM_SECURITY
or 'grep -r SCM_SECURITY *'
Post by Michael Shell
You can either add the SCM_ defs to your /usr/include/bits/socket.h or add
them to your systemd's journald-server.c
In systemd's src/basic/missing.h is:

#ifndef SCM_SECURITY
#define SCM_SECURITY 0x03
#endif

Shouldn't that take care of it? missing.h is included in
src/journal/journald-server.c.

SCM_RIGHTS is defined in /usr/include/bits/socket.h as is SCM_CREDENTIALS

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.h
Michael Shell
2018-07-31 23:55:31 UTC
Permalink
On Tue, 31 Jul 2018 15:36:45 -0500
Post by Bruce Dubbs
#ifndef SCM_SECURITY
#define SCM_SECURITY 0x03
#endif
Shouldn't that take care of it? missing.h is included in
src/journal/journald-server.c.
Bruce,

Yep, good catch. Searching more, I can confirm (with Ken) that neither the
sanitized kernel headers, nor glibc (at least version 2.27) provide
SCM_SECURITY. So, it has to come internal to the systemd source tree.

In the systemd source tree for v239:

grep -r SCM_SECURITY *

yields:

src/journal/journald-server.c: cmsg->cmsg_type == SCM_SECURITY) {
src/basic/missing.h:#ifndef SCM_SECURITY
src/basic/missing.h:#define SCM_SECURITY 0x03

in missing.h, SCM_SECURITY is defined around line 547.

And indeed journald-server.c loads missing.h around line
45:

#include "missing.h"


spiky, what does
grep -r SCM_SECURITY *
show on your systemd source tree? Does your src/journal/journald-server.c
include missing.h ?

You could manually set

#define SCM_SECURITY 0x03

in journald-server.c to get around this problem (and likely hit right
upon another), but you should look into why missing.h is not doing the
def for you. Your systemd source tree might have gotten corrupted
somehow.


Cheers,

Mike
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See t
Ken Moffat
2018-07-31 20:51:23 UTC
Permalink
Post by Michael Shell
On Mon, 30 Jul 2018 20:05:54 +0100
../src/journal/journald-server.c:1134:45: error: 'SCM_SECURITY'
undeclared (first use in this function); did you mean 'PF_SECURITY'?
                          cmsg->cmsg_type == SCM_SECURITY) {
                                             ^~~~~~~~~~~~
SCM_SECURITY is defined in the Linux kernel headers in
/include/linux/socket.h
https://elixir.bootlin.com/linux/latest/source/include/linux/socket.h#L152
/* "Socket"-level control message types: */
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_SECURITY 0x03 /* rw: security label */
However, given that we are supposed to use "sanitized" kernel headers,
it is glibc's job to export these values. I believe this is done in
/usr/include/bits/socket.h
What version of glibc are you using? Perhaps older versions don't define
SCM_SECURITY?
Can someone with a recent glibc system verify that SCM_SECURITY is indeed
defined in /usr/include/bits/socket.h ?
FWIW, all the header include files that have references to SCM_SECURITY
cd /usr/include
find . -type f -name "*.h" -print|sort|xargs grep SCM_SECURITY
On (sysv) LFS-svn-20180516 (glibc-2.27) which I have currently
booted to build a new system, that returns nothing.

Looking at backup data from sysv systems created in the last 18+
months, none of them return any results. SCM_RIGHTS and
SCM_CREDENTIALS are present, but not SCM_SECURITY.
Post by Michael Shell
You can either add the SCM_ defs to your /usr/include/bits/socket.h or add
them to your systemd's journald-server.c
Very odd, but not my problem™

ĸen
--
Entropy not found, thump keyboard to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See th
William Harrington
2018-08-01 07:05:09 UTC
Permalink
On Mon, 30 Jul 2018 20:05:54 +0100
Post by spiky
Built lfs systemd svn, moved onto blfs, systemd is at 238, I have used
the 239 version with the 238 configure "didn't use 238 patch"  but get
an error. I have Pam both Doc Books and libxslt installed
FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 -Wextra
-Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition
-Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn
-Werror=missing-prototypes -Werror=implicit-function-declaration
-Werror=missing-declarations -Werror=return-type
-Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes
-Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow
-Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow
-Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time
-Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option
-fno-strict-aliasing -fvisibility=hidden -fstack-protector
-fstack-protector-strong --param=ssp-buffer-size=4 -fPIE
-ffunction-sections -fdata-sections -Wno-unused-parameter
-Wno-missing-field-initializers -Wno-unused-result
-Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include
config.h -fPIC  -MD -MQ
../src/journal/journald-server.c
../src/journal/journald-server.c:1134:45: error: ‘SCM_SECURITY’
undeclared (first use in this function); did you mean ‘PF_SECURITY’?
                          cmsg->cmsg_type == SCM_SECURITY) {
                                             ^~~~~~~~~~~~
                                             PF_SECURITY
../src/journal/journald-server.c:1134:45: note: each undeclared
identifier is reported only once for each function it appears in
[249/1488] Compiling C object
ninja: build stopped: subcommand failed.
Any help has some built it?
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Did you build glibc without selinux support? All I can find is that SCM_SECURITY is related to SELINUX.

Sincerely,
--
Berzerkula <***@berzerkula.org>
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See
Loading...