1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
1998-07-31 11:10  Ulrich Drepper  <drepper@cygnus.com>

	* elf/elf.h: Add lots of new symbols from Irix and Solaris.

	* sysdeps/unix/sysv/linux/sigstack.c: Include stddef.h to get NULL
	definition.

1998-07-31  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* sunrpc/xcrypt.c: Use only the first 8 characters of the password.

1998-07-30 21:06 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* sysdeps/generic/glob.c: Undefine strdup before defining it,
	because bits/string2.h may have defined it already.

1998-07-29  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* stdio-common/vfscanf.c: Optimize looking for type modifiers.
	Fix recognition of 'a' modifier vs. 'a' format.
	(TYPEMOD): Removed.

	* stdio-common/printf-parse.h (parse_one_spec): Optimize looking
	for type modifiers.  Fix recognition of 'hh' modifier.

1998-07-31  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* sunrpc/svc_unix.c: Fix typo.

1998-07-31  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* sysdeps/unix/sysv/linux/recvmsg.c: Don't check for SCM_CREDS before
	syscall.
This commit is contained in:
Ulrich Drepper
1998-07-31 11:14:46 +00:00
parent bdd421cc6d
commit c3966b88ee
9 changed files with 450 additions and 221 deletions

View File

@ -39,53 +39,35 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
{
struct cmsghdr *cm;
int ret;
int found_creds = 0;
/* Must check for space first. */
cm = CMSG_FIRSTHDR (message);
while (cm)
{
if (cm->cmsg_type == SCM_CREDS)
{
if (cm->cmsg_len < CMSG_SPACE (sizeof (struct cmsgcred)))
{
__set_errno (EINVAL);
return -1;
}
found_creds = 1;
}
cm = CMSG_NXTHDR (message, cm);
}
ret = __syscall_recvmsg (fd, message, flags);
if (ret == -1)
return ret;
/* Postprocess the message control block for SCM_CREDS. */
/* Postprocess the message control block for SCM_CREDS. */
cm = CMSG_FIRSTHDR (message);
if (found_creds)
while (cm)
{
if (cm->cmsg_type == SCM_CREDS)
{
struct cmsgcred *c = (struct cmsgcred *) CMSG_DATA (cm);
struct __kernel_ucred u;
int i;
memcpy (&u, CMSG_DATA (cm), sizeof (struct __kernel_ucred));
while (cm)
{
if (cm->cmsg_type == SCM_CREDS)
{
struct cmsgcred *c = (struct cmsgcred *) CMSG_DATA (cm);
struct __kernel_ucred u;
int i;
memcpy (&u, CMSG_DATA (cm), sizeof (struct __kernel_ucred));
c->cmcred_pid = u.pid;
c->cmcred_uid = u.uid;
c->cmcred_gid = u.gid;
c->cmcred_pid = u.pid;
c->cmcred_uid = u.uid;
c->cmcred_gid = u.gid;
c->cmcred_euid = -1;
c->cmcred_ngroups = 0;
for (i = 0; i < CMGROUP_MAX; i++)
c->cmcred_groups[i] = -1;
}
cm = CMSG_NXTHDR (message, cm);
}
c->cmcred_euid = -1;
c->cmcred_ngroups = 0;
for (i = 0; i < CMGROUP_MAX; i++)
c->cmcred_groups[i] = -1;
}
cm = CMSG_NXTHDR (message, cm);
}
return ret;
}