|
@@ -132,16 +132,14 @@ size_t __pagesize = 0;
|
|
|
static void __check_one_fd(int fd, int mode)
|
|
|
{
|
|
|
|
|
|
- if (unlikely(__libc_fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF))
|
|
|
+ if (__libc_fcntl(fd, F_GETFD) == -1)
|
|
|
{
|
|
|
|
|
|
- struct stat st;
|
|
|
int nullfd = __libc_open(_PATH_DEVNULL, mode);
|
|
|
|
|
|
* that is in fact the device that we have opened and not
|
|
|
* some other wierd file... */
|
|
|
- if ( (nullfd!=fd) || fstat(fd, &st) || !S_ISCHR(st.st_mode) ||
|
|
|
- (st.st_rdev != makedev(1, 3)))
|
|
|
+ if (nullfd!=fd)
|
|
|
{
|
|
|
abort();
|
|
|
}
|
|
@@ -155,13 +153,13 @@ static int __check_suid(void)
|
|
|
|
|
|
uid = getuid();
|
|
|
euid = geteuid();
|
|
|
+ if (uid != euid)
|
|
|
+ return 1;
|
|
|
gid = getgid();
|
|
|
egid = getegid();
|
|
|
-
|
|
|
- if(uid == euid && gid == egid) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
- return 1;
|
|
|
+ if (gid != egid)
|
|
|
+ return 1;
|
|
|
+ return 0;
|
|
|
}
|
|
|
#endif
|
|
|
|