Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1748 - sandbox violation not really a violation.
Summary: sandbox violation not really a violation.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Jon Nelson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-13 22:48 UTC by Jon Nelson (RETIRED)
Modified: 2011-10-30 22:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Nelson (RETIRED) 2002-04-13 22:48:56 UTC
Referencing 1637 (pdksh): 

The configure script checks to see if the system has /dev/fd/foo support,
by creating a file, getting it's fd, and trying to open
/dev/fd/fd_of_the_file_just_opened.  This is a perfectly legitimate test, but fails.
Included below is the snippet of code that configure uses.

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
          main()
          {
            struct stat s1, s2;
            FILE *fp1, *fp2;
            char *file = "conftest.file";
            char devfd[32];

            if (!(fp1 = fopen(file, "w")))
              exit(1);
            if (fstat(fileno(fp1), &s1) < 0)
              exit(2);
            sprintf(devfd, "/dev/fd/%d", fileno(fp1));
            if (!(fp2 = fopen(devfd, "w")))
              exit(3);
            if (fstat(fileno(fp2), &s2) < 0)
              exit(4);
            if (s1.st_dev != s2.st_dev || s1.st_ino != s2.st_ino)
              exit(5);
            exit(0);
          }
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-04-15 04:20:44 UTC
vim 6.1 also had this issue
Comment 2 Jon Nelson (RETIRED) 2002-04-15 22:07:54 UTC
Portage 1.8.20 should fix this problem.