Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on hurd-i386 and GNU/kFreeBSD #298

Closed
algernon opened this issue Nov 12, 2014 · 7 comments
Closed

Fails to build on hurd-i386 and GNU/kFreeBSD #298

algernon opened this issue Nov 12, 2014 · 7 comments
Labels

Comments

@algernon
Copy link
Contributor

Previous versions of syslog-ng built fine on the Hurd and GNU/kFreeBSD, 3.6.1 (and later) do not, due to the credential stuff in afsocket:

libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../lib -I../../modules -I./lib -I./modules -I../../modules/afsocket -I./modules/afsocket -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-gnu/glib-2.0/include -I/usr/include/eventlog -DLIBNET_LIL_ENDIAN -I/usr/include/dbi -I/usr/include/dbi/dbi -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -pthread -c ../../modules/afsocket/transport-mapper-inet.c  -fPIC -DPIC -o modules/afsocket/.libs/modules_afsocket_libafsocket_notls_la-transport-mapper-inet.o
../../modules/afsocket/transport-unix-socket.c:148:48: error: unknown type name 'cred_t'
 _feed_aux_from_ucred(LogTransportAuxData *aux, cred_t *uc)
                                                ^
../../modules/afsocket/transport-unix-socket.c: In function 'log_transport_unix_socket_new':
../../modules/afsocket/transport-unix-socket.c:251:3: warning: implicit declaration of function 'socket_set_pass_credentials' [-Wimplicit-function-declaration]
   socket_set_pass_credentials(fd);
   ^
../../modules/afsocket/transport-unix-socket.c: At top level:
../../modules/afsocket/transport-unix-socket.c:36:1: warning: '_add_nv_pair_int' defined but not used [-Wunused-function]
 _add_nv_pair_int(LogTransportAuxData *aux, const gchar *name, gint value)
 ^
../../modules/afsocket/transport-unix-socket.c:102:1: warning: '_add_nv_pair_proc_read_unless_unset' defined but not used [-Wunused-function]
 _add_nv_pair_proc_read_unless_unset(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file, const gchar *unset_value)
 ^
../../modules/afsocket/transport-unix-socket.c:115:1: warning: '_add_nv_pair_proc_read_argv' defined but not used [-Wunused-function]
 _add_nv_pair_proc_read_argv(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file)
 ^
../../modules/afsocket/transport-unix-socket.c:135:1: warning: '_add_nv_pair_proc_readlink' defined but not used [-Wunused-function]
 _add_nv_pair_proc_readlink(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file)
 ^
make[4]: *** [modules/afsocket/modules_afsocket_libafsocket_notls_la-transport-unix-socket.lo] Error 1

Full build log available here (for hurd). and here (for kfreebsd)

@algernon algernon changed the title Fails to build on hurd-i386 Fails to build on hurd-i386 and GNU/kFreeBSD Nov 12, 2014
@djlambert
Copy link

I can open a new issue if needed, but 3.6.1 build is also failing in transport-unix-socket.c on Solaris 11.2. I believe the issue is missing or alternate API for credential support with Unix domain sockets on BSD and Solaris. Hurd-i386 looks to also have BSD-like networking (see Does this system have a standard Unix API?).

  CC       modules/afsocket/modules_afsocket_libafsocket_notls_la-transport-unix-socket.lo
modules/afsocket/transport-unix-socket.c: In function ‘_format_proc_file_name’:
modules/afsocket/transport-unix-socket.c:50:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘pid_t’ [-Wformat=]
   g_snprintf(buf, buflen, "/proc/%d/%s", pid, proc_file);
   ^
modules/afsocket/transport-unix-socket.c: In function ‘_feed_aux_from_ucred’:
modules/afsocket/transport-unix-socket.c:150:3: warning: implicit declaration of function ‘cred_get’ [-Wimplicit-function-declaration]
   _add_nv_pair_int(aux, ".unix.pid", cred_get(uc, pid));
   ^
modules/afsocket/transport-unix-socket.c:150:51: error: ‘pid’ undeclared (first use in this function)
   _add_nv_pair_int(aux, ".unix.pid", cred_get(uc, pid));
                                                   ^
modules/afsocket/transport-unix-socket.c:150:51: note: each undeclared identifier is reported only once for each function it appears in
modules/afsocket/transport-unix-socket.c:151:51: error: ‘uid’ undeclared (first use in this function)
   _add_nv_pair_int(aux, ".unix.uid", cred_get(uc, uid));
                                                   ^
modules/afsocket/transport-unix-socket.c:152:51: error: ‘gid’ undeclared (first use in this function)
   _add_nv_pair_int(aux, ".unix.gid", cred_get(uc, gid));
                                                   ^
modules/afsocket/transport-unix-socket.c: In function ‘log_transport_unix_socket_read_method’:
modules/afsocket/transport-unix-socket.c:218:6: error: ‘struct msghdr’ has no member named ‘msg_control’
   msg.msg_control = ctlbuf;
      ^
modules/afsocket/transport-unix-socket.c:219:6: error: ‘struct msghdr’ has no member named ‘msg_controllen’
   msg.msg_controllen = sizeof(ctlbuf);
      ^
modules/afsocket/transport-unix-socket.c: In function ‘log_transport_unix_socket_new’:
modules/afsocket/transport-unix-socket.c:251:3: warning: implicit declaration of function ‘socket_set_pass_credentials’ [-Wimplicit-function-declaration]
   socket_set_pass_credentials(fd);
   ^
modules/afsocket/transport-unix-socket.c: At top level:
modules/afsocket/transport-unix-socket.c:102:1: warning: ‘_add_nv_pair_proc_read_unless_unset’ defined but not used [-Wunused-function]
 _add_nv_pair_proc_read_unless_unset(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file, const gchar *unset_value)
 ^
modules/afsocket/transport-unix-socket.c:115:1: warning: ‘_add_nv_pair_proc_read_argv’ defined but not used [-Wunused-function]
 _add_nv_pair_proc_read_argv(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file)
 ^
modules/afsocket/transport-unix-socket.c:135:1: warning: ‘_add_nv_pair_proc_readlink’ defined but not used [-Wunused-function]
 _add_nv_pair_proc_readlink(LogTransportAuxData *aux, const gchar *name, pid_t pid, const gchar *proc_file)
 ^
modules/afsocket/transport-unix-socket.c:148:1: warning: ‘_feed_aux_from_ucred’ defined but not used [-Wunused-function]
 _feed_aux_from_ucred(LogTransportAuxData *aux, cred_t *uc)
 ^
gmake[2]: *** [modules/afsocket/modules_afsocket_libafsocket_notls_la-transport-unix-socket.lo] Error 1
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all] Error 2

Although the code is Perl this post discusses the missing API and suggests an alternate for the Solaris case.

@algernon
Copy link
Contributor Author

I think one issue is enough, it affects the same subsystem. And should fall back to disabling it, if none of the known APIs are available.

@bazsi
Copy link
Collaborator

bazsi commented Nov 17, 2014

I agree, one issue should be enough. Any takers who could write the
configure test in question?

Bazsi

On Mon, Nov 17, 2014 at 10:18 AM, Gergely Nagy notifications@github.com
wrote:

I think one issue is enough, it affects the same subsystem. And should
fall back to disabling it, if none of the known APIs are available.


Reply to this email directly or view it on GitHub
#298 (comment).

@lbudai
Copy link
Collaborator

lbudai commented Nov 19, 2014

I think the problem is that when we check whether credential passing is supported or not in unix-credentials.h we don't use the result of this check in transport-unix-socket.c(in _feed_aux_from_ucred()).

PR was sent.

@lbudai lbudai added in progress and removed ready labels Nov 19, 2014
@algernon
Copy link
Contributor Author

Thanks! I'll run a build on affected platforms.

@lbudai
Copy link
Collaborator

lbudai commented Nov 19, 2014

Finally, I was able to build syslog-ng-3.6.1 on a
GNU/kFreeBSD debianBSD 8.0-1-486 #0 Wed Jan 27 11:11:57 UTC 2010 i686 i386... system.
(before the patch, I got the same problem, after the patch it seems OK)

@lbudai lbudai added the bug label Nov 20, 2014
@lbudai lbudai closed this as completed in d445452 Dec 6, 2014
@lbudai lbudai removed the in progress label Dec 6, 2014
@algernon
Copy link
Contributor Author

Just uploaded a snapshot to Debian experimental, kfreebsd-i386 and kfreebsd-amd64 are already built, but the hurd failed. Will open an issue about that at a later time. (test_logproto fails, but I do not yet know why)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants