axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] RE: gcl-2.6.8pre on MAC OSX 10.2


From: Waldek Hebisch
Subject: Re: [Axiom-developer] RE: gcl-2.6.8pre on MAC OSX 10.2
Date: Thu, 2 Nov 2006 10:50:02 +0100 (CET)

> On Wednesday, November 01, 2006 7:45 PM Waldek Hebisch wrote:
> >  
> > I am affraid I can not really offer Mac experience. However
> > the first Goole hit for: MACOSX pty is:
> > 
> > Mac OS X pty Permission Security Issue
> > 
> > Now, something which does not exits should have no security
> > problems, so I would belive that Mac OS X has pty.
> 
> Yes you are right. The reference I read earlier was that OSX 10.3
> does not have support for posix grantpt... Maybe things have
> change in OSX a lot since 10.3.
> 
> 
> > OTOH this security problem is solved by Unix 98 pty's (in
> > other words Linux /dev/ptmx and /dev/pts), so we can infer
> > that Mac OS X has only legacy pty (so you should use BSD
> > branch). 
> >
> 
> What do you mean by "BSD branch"?
>

To change openpty.c.pamphlet like below (untested, I took oportunity
to remove some obfuscation).

--- openpty.c.pamphlet.bb       2006-11-02 11:25:27.000000000 +0100
+++ openpty.c.pamphlet  2006-11-02 11:33:03.243288784 +0100
@@ -10,17 +10,9 @@
 \tableofcontents
 \eject
 \section{MAC OSX and BSD platform changes}
-Since we have no other information we are adding the [[MACOSXplatform]] 
variable
-to the list everywhere we find [[LINUXplatform]]. This may not be correct but
-we have no way to know yet. We have also added the [[BSDplatform]] variable.
-MAC OSX is some variant of BSD. These should probably be merged but we
-cannot yet prove that.
-<<mac osx platform change 1>>=
-#if defined(SUN4OS5platform) ||defined(ALPHAplatform) || defined(HP10platform) 
|| defined(LINUXplatform) || defined(MACOSXplatform) || defined(BSDplatform)
-@
-<<mac osx platform change 2>>=
-#if defined(SUNplatform) || defined(HP9platform) || defined(LINUXplatform) || 
defined(MACOSXplatform) || defined(BSDplatform)
-@
+We should really use autotools to check for Unix 98 pty support.
+Before this is done below we hardcode information about each platform.
+
 \section{License}
 <<license>>=
 /*
@@ -104,7 +96,7 @@
 #endif
 
 {
-#if defined(SUNplatform) || defined (HP9platform) || defined(RTplatform) 
||defined(AIX370platform) || defined(BSDplatform)
+#if defined(SUNplatform) || defined (HP9platform) || defined(RTplatform) 
||defined(AIX370platform) || defined(BSDplatform) || defined(MACOSXplatform)
   int looking = 1, i;
   int oflag = O_RDWR;                  /* flag for opening the pty */
   
@@ -147,7 +139,8 @@
   return(fdm);
 #endif
 
-<<mac osx platform change 1>>
+/* MAC OS X 10.3 does not support Unix 98 pty's */
+#if defined(SUN4OS5platform) ||defined(ALPHAplatform) || defined(HP10platform) 
|| defined(LINUXplatform) || defined(BSDplatform)
 extern int grantpt(int);
 extern int unlockpt(int);
 extern char* ptsname(int);
@@ -216,7 +209,7 @@
        sprintf(serv, "/dev/ttyp%02x", channelNo);
        channelNo++;
 #endif
-<<mac osx platform change 2>>
+#if defined(SUNplatform) || defined(HP9platform) || defined(LINUXplatform) || 
defined(MACOSXplatform) || defined(BSDplatform)
        static int channelNo = 0;
        static char group[] = "pqrstuvwxyzPQRST";
        static int groupNo = 0;
  
> > BTW: I you are logged into a Mac OS X machine you can try
> > to look is '/dev' directory contains things like '/dev/ptyq0'
> > and '/dev/ttyq0' (this is a traditional name for legacy
> > pty's).
> >  
> 
> Yes, I see for example:
> 
> ppc-osx3:~/osx $ ls /dev/ptyq*
> /dev/ptyq0 /dev/ptyq3 /dev/ptyq6 /dev/ptyq9 /dev/ptyqc /dev/ptyqf
> /dev/ptyq1 /dev/ptyq4 /dev/ptyq7 /dev/ptyqa /dev/ptyqd
> /dev/ptyq2 /dev/ptyq5 /dev/ptyq8 /dev/ptyqb /dev/ptyqe
> ppc-osx3:~/osx $
> 
> But when I try to build clef I get:
> 
> ppc-osx3:~/osx/axiom.build-improvements/src/clef $ make
> gcc ./edible.o
> -L/home/users/b/bi/billpage/osx/axiom.build-improvements/src/clef/../../
> ./src/lib -L/usr/lib -lspad  -lc -o
> /home/users/b/bi/billpage/osx/axiom.build-improvements/target/powerpc-ap
> ple-darwin6.8/bin/clef
> ld: warning table of contents of library:
> /home/users/b/bi/billpage/osx/axiom.build-improvements/src/clef/../.././
> src/lib/libspad.a not sorted slower link editing will result (use the
> ranlib(1) -s option)
> ld: Undefined symbols:
> _grantpt
> _ptsname
> _unlockpt
> 
> -----------
> 
> These are all pty external routines.
>

These are Unix 98 pty routines.  Somebody should check if Mac OS X
10.4 supports them, but all sources claim that earlier versions
do not have them.
 
-- 
                              Waldek Hebisch
address@hidden 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]