This is an automated email from the git hooks/post-receive script. sthibault pushed a commit to branch sid in repository glibc.
commit e23cce2baa3111ff928211709f2cb64d4cfc8d19 Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> Date: Mon Mar 14 01:02:21 2016 +0100 hurd-i386/tg-sendmsg-SCM_{RIGHTS,CREDS}.diff: Update --- debian/changelog | 5 ++ debian/patches/hurd-i386/tg-sendmsg-SCM_CREDS.diff | 27 +++++++--- .../patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff | 63 ++++++++++++---------- 3 files changed, 59 insertions(+), 36 deletions(-) diff --git a/debian/changelog b/debian/changelog index 745f39f..31aa715 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,13 @@ glibc (2.22-5) UNRELEASED; urgency=medium + [ Aurelien Jarno ] * debian/patches/localedata/fr_CA-first_weekday.diff: drop. Closes: #769051. + [ Samuel Thibault ] + * patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff,tg-sendmsg-SCM_CREDS.diff: + Update. + -- Aurelien Jarno <aure...@debian.org> Sun, 13 Mar 2016 15:03:58 +0100 glibc (2.22-3) unstable; urgency=medium diff --git a/debian/patches/hurd-i386/tg-sendmsg-SCM_CREDS.diff b/debian/patches/hurd-i386/tg-sendmsg-SCM_CREDS.diff index 33183a4..029859f 100644 --- a/debian/patches/hurd-i386/tg-sendmsg-SCM_CREDS.diff +++ b/debian/patches/hurd-i386/tg-sendmsg-SCM_CREDS.diff @@ -8,18 +8,22 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> control message, and call __auth_user_authenticate_request to make auth send credentials on that port. Do not wait for a reply. - * sysdeps/mach/hurd/recvmsg.c (contains_uid, contains_gid, check_auth): New functions. (__libc_recvmsg): On SCM_CREDS control messages, call check_auth to check the passed credentials thanks to the answer from the auth server. + * hurd/Makefile (user-interfaces): Add auth_request and + auth_reply. --- - sysdeps/mach/hurd/recvmsg.c | 136 ++++++++++++++++++++++++++++++++++++++++++++ + hurd/Makefile | 2 +- + sysdeps/mach/hurd/recvmsg.c | 137 ++++++++++++++++++++++++++++++++++++++++++++ sysdeps/mach/hurd/sendmsg.c | 34 +++++++++++ - 2 files changed, 170 insertions(+) + 3 files changed, 172 insertions(+), 1 deletion(-) +diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c +index 0200b13..b66e5b5 100644 --- a/sysdeps/mach/hurd/recvmsg.c +++ b/sysdeps/mach/hurd/recvmsg.c @@ -23,6 +23,123 @@ @@ -146,7 +150,7 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. */ ssize_t -@@ -191,6 +308,21 @@ __libc_recvmsg (int fd, struct msghdr *m +@@ -191,6 +308,21 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) i++; } } @@ -168,20 +172,23 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> } for (i = 0; i < nports; i++) -@@ -221,6 +353,10 @@ cleanup: +@@ -221,6 +353,11 @@ cleanup: __mach_port_deallocate (__mach_task_self (), ports[ii]); } } + else if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) + { + __mach_port_deallocate (__mach_task_self (), ports[ii]); ++ ii++; + } } } +diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c +index 612581c..51167e8 100644 --- a/sysdeps/mach/hurd/sendmsg.c +++ b/sysdeps/mach/hurd/sendmsg.c -@@ -112,6 +112,8 @@ __libc_sendmsg (int fd, const struct msg +@@ -111,6 +111,8 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) nports += (cmsg->cmsg_len - CMSG_ALIGN (sizeof (struct cmsghdr))) / sizeof (int); @@ -190,7 +197,7 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> if (nports) ports = __alloca (nports * sizeof (mach_port_t)); -@@ -146,6 +148,38 @@ __libc_sendmsg (int fd, const struct msg +@@ -145,6 +147,38 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) goto out; } } @@ -229,9 +236,11 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> } if (addr) +diff --git a/hurd/Makefile b/hurd/Makefile +index 4387253..0ee417d 100644 --- a/hurd/Makefile +++ b/hurd/Makefile -@@ -29,7 +29,7 @@ inline-headers = hurd.h $(addprefix hurd +@@ -33,7 +33,7 @@ inline-headers = hurd.h $(addprefix hurd/,fd.h signal.h \ # The RPC interfaces go in a separate library. interface-library := libhurduser user-interfaces := $(addprefix hurd/,\ @@ -240,3 +249,5 @@ Samuel Thibault <samuel.thiba...@ens-lyon.org> process process_request \ msg msg_reply msg_request \ exec exec_startup crash interrupt \ +-- +tg: (511e7f1..) t/sendmsg-SCM_CREDS (depends on: t/sendmsg-SCM_RIGHTS) diff --git a/debian/patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff b/debian/patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff index 2e97f81..f25b686 100644 --- a/debian/patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff +++ b/debian/patches/hurd-i386/tg-sendmsg-SCM_RIGHTS.diff @@ -4,15 +4,15 @@ Date: Sat, 17 Jul 2010 22:09:13 +0200 Subject: [PATCH] Add support to send file descriptors over Unix sockets --- - sysdeps/mach/hurd/recvmsg.c | 92 ++++++++++++++++++++++++++++++++++++++++++++- - sysdeps/mach/hurd/sendmsg.c | 73 +++++++++++++++++++++++++++++------ - 2 files changed, 152 insertions(+), 13 deletions(-) + sysdeps/mach/hurd/recvmsg.c | 97 ++++++++++++++++++++++++++++++++++++++++++++- + sysdeps/mach/hurd/sendmsg.c | 73 +++++++++++++++++++++++++++++----- + 2 files changed, 157 insertions(+), 13 deletions(-) -Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c -=================================================================== ---- glibc-2.19.orig/sysdeps/mach/hurd/recvmsg.c -+++ glibc-2.19/sysdeps/mach/hurd/recvmsg.c -@@ -32,13 +32,33 @@ __libc_recvmsg (int fd, struct msghdr *m +diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c +index 5d7b1ee..dfd4145 100644 +--- a/sysdeps/mach/hurd/recvmsg.c ++++ b/sysdeps/mach/hurd/recvmsg.c +@@ -32,13 +32,34 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) addr_port_t aport; char *data = NULL; mach_msg_type_number_t len = 0; @@ -27,6 +27,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c - int i; + int nfds, *opened_fds = NULL; + int i, ii, j; ++ int newfds; + + error_t reauthenticate (mach_port_t port, mach_port_t *result) + { @@ -48,7 +49,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c /* Find the total number of bytes to be read. */ amount = 0; -@@ -135,9 +155,77 @@ __libc_recvmsg (int fd, struct msghdr *m +@@ -135,9 +156,81 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) message->msg_controllen = clen; memcpy (message->msg_control, cdata, message->msg_controllen); @@ -60,6 +61,8 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c + + /* This counts how many ports we processed completely. */ + i = 0; ++ /* This counts how many new fds we create. */ ++ newfds = 0; + + for (cmsg = CMSG_FIRSTHDR (message); + cmsg; @@ -75,17 +78,19 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c + + for (j = 0; j < nfds; j++) + { -+ err = reauthenticate (ports[i], &newports[i]); ++ err = reauthenticate (ports[i], &newports[newfds]); + if (err) + goto cleanup; -+ fds[j] = opened_fds[i] = _hurd_intern_fd (newports[i], fds[j], 0); ++ fds[j] = opened_fds[newfds] = _hurd_intern_fd (newports[newfds], ++ fds[j], 0); + if (fds[j] == -1) + { + err = errno; -+ __mach_port_deallocate (__mach_task_self (), newports[i]); ++ __mach_port_deallocate (__mach_task_self (), newports[newfds]); + goto cleanup; + } + i++; ++ newfds++; + } + } + } @@ -102,7 +107,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c + if (nports > 0) + { + ii = 0; -+ j = 0; ++ newfds = 0; + for (cmsg = CMSG_FIRSTHDR (message); + cmsg; + cmsg = CMSG_NXTHDR (message, cmsg)) @@ -111,10 +116,10 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c + { + nfds = (cmsg->cmsg_len - CMSG_ALIGN (sizeof (struct cmsghdr))) + / sizeof (int); -+ for (j = 0; j < nfds && ii < i; j++, ii++) ++ for (j = 0; j < nfds && ii < i; j++, ii++, newfds++) + { -+ _hurd_fd_close (_hurd_fd_get (opened_fds[ii])); -+ __mach_port_deallocate (__mach_task_self (), newports[ii]); ++ _hurd_fd_close (_hurd_fd_get (opened_fds[newfds])); ++ __mach_port_deallocate (__mach_task_self (), newports[newfds]); + __mach_port_deallocate (__mach_task_self (), ports[ii]); + } + } @@ -126,11 +131,11 @@ Index: glibc-2.19/sysdeps/mach/hurd/recvmsg.c } weak_alias (__libc_recvmsg, recvmsg) -Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c -=================================================================== ---- glibc-2.19.orig/sysdeps/mach/hurd/sendmsg.c -+++ glibc-2.19/sysdeps/mach/hurd/sendmsg.c -@@ -32,6 +32,10 @@ ssize_t +diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c +index 5a93c63..612581c 100644 +--- a/sysdeps/mach/hurd/sendmsg.c ++++ b/sysdeps/mach/hurd/sendmsg.c +@@ -31,6 +31,10 @@ ssize_t __libc_sendmsg (int fd, const struct msghdr *message, int flags) { error_t err = 0; @@ -141,7 +146,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c struct sockaddr_un *addr = message->msg_name; socklen_t addr_len = message->msg_namelen; addr_port_t aport = MACH_PORT_NULL; -@@ -44,6 +48,7 @@ __libc_sendmsg (int fd, const struct msg +@@ -43,6 +47,7 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) mach_msg_type_number_t len; mach_msg_type_number_t amount; int dealloc = 0; @@ -149,7 +154,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c int i; /* Find the total number of bytes to be written. */ -@@ -101,6 +106,48 @@ __libc_sendmsg (int fd, const struct msg +@@ -100,6 +105,48 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) } } @@ -198,8 +203,8 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c if (addr) { if (addr->sun_family == AF_LOCAL) -@@ -111,9 +158,8 @@ __libc_sendmsg (int fd, const struct msg - file_t file = __file_name_lookup (name, 0, 0); +@@ -109,9 +156,8 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) + file_t file = __file_name_lookup (addr->sun_path, 0, 0); if (file == MACH_PORT_NULL) { - if (dealloc) @@ -210,7 +215,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c } err = __ifsock_getsockaddr (file, &aport); __mach_port_deallocate (__mach_task_self (), file); -@@ -121,11 +167,7 @@ __libc_sendmsg (int fd, const struct msg +@@ -119,11 +165,7 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) /* The file did not grok the ifsock protocol. */ err = ENOTSOCK; if (err) @@ -223,7 +228,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c } else err = EIEIO; -@@ -144,8 +186,9 @@ __libc_sendmsg (int fd, const struct msg +@@ -142,8 +184,9 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) /* Send the data. */ err = __socket_send (port, aport, flags, data.ptr, len, @@ -235,7 +240,7 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c message->msg_control, message->msg_controllen, &amount); -@@ -154,11 +197,19 @@ __libc_sendmsg (int fd, const struct msg +@@ -152,11 +195,19 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) } err; })); @@ -256,3 +261,5 @@ Index: glibc-2.19/sysdeps/mach/hurd/sendmsg.c } weak_alias (__libc_sendmsg, sendmsg) +-- +tg: (b4578ba..) t/sendmsg-SCM_RIGHTS (depends on: 64a17f1adde4715bb6607f64decd73b2df9e6852) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git