From 53b4fed6efb980044ff7152c725557de846a23bf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Sep 2004 22:44:12 +0000 Subject: Update. * sysdeps/unix/sysv/linux/sigwait.c (do_sigwait): Make sure SIGSETXID is not blocked. * sysdeps/unix/sysv/linux/sigwaitinfo.c (do_sigwaitinfo): Likewise. * sysdeps/unix/sysv/linux/sigtimedwait.c (do_sigtimedwait): Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/generic/sigfillset.c (sigfillset): Don't set SIGSETXID. --- sysdeps/generic/sigfillset.c | 6 +++++- sysdeps/unix/sysv/linux/sigprocmask.c | 14 +++++++++++--- sysdeps/unix/sysv/linux/sigtimedwait.c | 12 ++++++++++-- sysdeps/unix/sysv/linux/sigwait.c | 12 ++++++++++-- sysdeps/unix/sysv/linux/sigwaitinfo.c | 12 ++++++++++-- 5 files changed, 46 insertions(+), 10 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/sigfillset.c b/sysdeps/generic/sigfillset.c index 5f91fa6bda..95d52cf0c0 100644 --- a/sysdeps/generic/sigfillset.c +++ b/sysdeps/generic/sigfillset.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,96,97,2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1991,96,97,2002,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,6 +37,10 @@ sigfillset (set) #ifdef SIGCANCEL __sigdelset (set, SIGCANCEL); #endif + /* Likewise for the signal to implement setxid. */ +#ifdef SIGSETXID + __sigdelset (set, SIGSETXID); +#endif return 0; } diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c index e1b57566a5..1573780d8e 100644 --- a/sysdeps/unix/sysv/linux/sigprocmask.c +++ b/sysdeps/unix/sysv/linux/sigprocmask.c @@ -43,12 +43,20 @@ __sigprocmask (how, set, oset) #ifdef SIGCANCEL sigset_t local_newmask; - /* The only thing we have to make sure here is that SIGCANCEL is not - blocked. */ - if (set != NULL && __builtin_expect (__sigismember (set, SIGCANCEL), 0)) + /* The only thing we have to make sure here is that SIGCANCEL and + SIGSETXID are not blocked. */ + if (set != NULL + && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) +# ifdef SIGSETXID + || __builtin_expect (__sigismember (set, SIGSETXID), 0) +# endif + )) { local_newmask = *set; __sigdelset (&local_newmask, SIGCANCEL); +# ifdef SIGSETXID + __sigdelset (&local_newmask, SIGSETXID); +# endif set = &local_newmask; } #endif diff --git a/sysdeps/unix/sysv/linux/sigtimedwait.c b/sysdeps/unix/sysv/linux/sigtimedwait.c index 1705cb10bd..adeadc1587 100644 --- a/sysdeps/unix/sysv/linux/sigtimedwait.c +++ b/sysdeps/unix/sysv/linux/sigtimedwait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2002,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,12 +32,20 @@ do_sigtimedwait (const sigset_t *set, siginfo_t *info, { #ifdef SIGCANCEL sigset_t tmpset; - if (set != NULL && __sigismember (set, SIGCANCEL)) + if (set != NULL + && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) +# ifdef SIGSETXID + || __builtin_expect (__sigismember (set, SIGSETXID), 0) +# endif + )) { /* Create a temporary mask without the bit for SIGCANCEL set. */ // We are not copying more than we have to. memcpy (&tmpset, set, _NSIG / 8); __sigdelset (&tmpset, SIGCANCEL); +# ifdef SIGSETXID + __sigdelset (&tmpset, SIGSETXID); +# endif set = &tmpset; } #endif diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c index f755928493..7c865963cd 100644 --- a/sysdeps/unix/sysv/linux/sigwait.c +++ b/sysdeps/unix/sysv/linux/sigwait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2002,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,12 +36,20 @@ do_sigwait (const sigset_t *set, int *sig) #ifdef SIGCANCEL sigset_t tmpset; - if (set != NULL && __sigismember (set, SIGCANCEL)) + if (set != NULL + && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) +# ifdef SIGSETXID + || __builtin_expect (__sigismember (set, SIGSETXID), 0) +# endif + )) { /* Create a temporary mask without the bit for SIGCANCEL set. */ // We are not copying more than we have to. memcpy (&tmpset, set, _NSIG / 8); __sigdelset (&tmpset, SIGCANCEL); +# ifdef SIGSETXID + __sigdelset (&tmpset, SIGSETXID); +# endif set = &tmpset; } #endif diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c index a2dec820fc..a51a01f20b 100644 --- a/sysdeps/unix/sysv/linux/sigwaitinfo.c +++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2002,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,12 +33,20 @@ do_sigwaitinfo (const sigset_t *set, siginfo_t *info) { #ifdef SIGCANCEL sigset_t tmpset; - if (set != NULL && __sigismember (set, SIGCANCEL)) + if (set != NULL + && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) +# ifdef SIGSETXID + || __builtin_expect (__sigismember (set, SIGSETXID), 0) +# endif + )) { /* Create a temporary mask without the bit for SIGCANCEL set. */ // We are not copying more than we have to. memcpy (&tmpset, set, _NSIG / 8); __sigdelset (&tmpset, SIGCANCEL); +# ifdef SIGSETXID + __sigdelset (&tmpset, SIGSETXID); +# endif set = &tmpset; } #endif -- cgit v1.2.3