kjb@cs.vu.nl (Kees J. Bot) (05/13/91)
Here is my implementation of #! interpretation by MM. I was at first not going to post it when I saw Klamer Schutte's version go by, but I spotted 2 minor and 1 major bug in his patch after half an hour. So I decided that posting my patch to mm/exec.c was the easiest fix. The good points of my version are: - The #! line may be 255 (PATH_MAX) bytes long instead of 32 (SunOs), or 29 (Klamer). - It knows about tabs on the #! line. - A lot of comments. - It doesn't double the number of goto's in MM :-) - Full error checking. - It does setuid right. Bad points: - It does setuid right. - It patches the stack for each argument it inserts, Klamer inserts them all at once which saves a few microsecs. - A new and different set of bugs (features). The bugs in Klamer's patch: - Buf must be cbuf in "buf[HDR_SIZE - 1] = '\n'". - The ALIGN(len) may introduce extra bytes in the middle the stack image. (ps(1) may not like that). Better do an ALIGN(stk_bytes) when you're done. - Argv[0] should be replaced by the first argument of execve(2). (Fixing this without making your code ugly won't be easy.) -- Kees J. Bot (kjb@cs.vu.nl) Systems Programmer, Vrije Universiteit Amsterdam P.S. I really dislike the name "Advanced Minix". To me, the only advanced Minix is version 1.6.15 that Andy is working on. Better call it "Enhanced Minix", because that is what it really is: Minix with a lot of features (bugs) added to make look more like all the other overweight UNIX(tm)'s. table !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ begin 644 exec.c.cdif.Z M'YV-*@*">-'	X7,5S4(-CF11D\9<:X&)-@2ATW()J$D0,"! T0,F;H@(%Cz M9 T0,7+D@*&@A4L0#R-.K'@Q8Y@\*&6 A*@T=,FR@5!E#0<"C2).J,"HPy M1@T6,F" 0-KRI5.H,4"X=*F@XX@T;L:PJ4.F# @1;=JX0".B*XBO8<>6!<%Cx M3IXY+^;0"4-GK0^W<,62-<NC#=@T!\>$8</&C1R_"E:\!2MX;ETZ<L">@>R5w MLERS:.'(>2.1+6#/@\_"V1A&K>F.3)7*C@UB!@P6,W!,/5JU1>T8+&C,T+H5v M<%DS8,U2>4)%2,?GT*.#L)'@A0H0;$CS3?,&XQLS(.B\V<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S7%?ZM 9434!20\@,#A8Tx MDMF/YLO%U\% XX#R':$HH (ND><9VJ#*R[R(:SFX<@)<0 <<:E@9[78D:>@+w M1]8(JBIKL-U6 K0!?)$5_"WS.[[S*K=TBX>8[;+5^FCDG !W;A8HKN>EC7U0v MLP4W6Z00"J&N#C2P'L ANB*_D1_'C10;)4F>G"GZ^M6^<KI/;><RMY0O=?Ku MX]S#N-)%T-+WC6TH8.3[;<(RW6)\K+$ZEL;P':QSZ.F;^U/Y*R1NK<LXID%Gt MX :-1UQ]@C4%USS(K=??/@=+U.>)"WW4+#R<]T0OL.]4\FX 7P3\33W[1W>Ps M*[VIG<D9G>UT6M00#_%'M--W]28ZLE- _1P3SZ@1W_$X?4-(C:F-XB9O "<[r *]=1S JIS$FT* -00q p end
bert@arrakis.nl.mugnet.org (Bert Laverman) (05/23/91)
kjb@cs.vu.nl (Kees J. Bot) wrote: > P.S. > I really dislike the name "Advanced Minix". To me, the only advanced > Minix is version 1.6.15 that Andy is working on. Better call it > "Enhanced Minix", because that is what it really is: Minix with a lot > of features (bugs) added to make look more like all the other overweight > UNIX(tm)'s. Whoa! Are we getting a 'real war'(tm)? :-) Perhaps 'twere better if you add a smiley next time you post something like this, otherwise it could be mistaken for mudslingin'. ;-) About the name: I think any form of generalized name (i.e. a name _not_ speciying a specific system or processor) is unfit for both, as long as there isn't a 68k version (and 386 of course, but that doesn't count as much... to me :-)) with full source-level & system call compatibility. If possible with largely the same sources. Greetings, Bert ===================================================================== Bert Laverman email: bert@arrakis.nl.mugnet.org tel.: +31 50 - 733587 or: laverman@cs.rug.nl =====================================================================