MS-DOS patches to perl. Apply this patch to the standard perl source, version 4, patch level 19, using "patch -p." Do this in the root directory of the perl source distribution. You can cat all these patches together and pipe the output to patch -p. Len Reed Holos Software, Inc. ..!gatech!holos0!lbr holos0!lbr@gatech.edu -------------------------------------- *** msdos/msdos.c.old Fri Jun 14 20:09:56 1991 --- msdos/msdos.c Thu Nov 14 08:56:36 1991 *************** *** 1,17 **** ! /* $RCSfile: msdos.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:22:37 $ * * (C) Copyright 1989, 1990 Diomidis Spinellis. * ! * You may distribute under the terms of either the GNU General Public ! * License or the Artistic License, as specified in the README file. * * $Log: msdos.c,v $ - * Revision 4.0.1.1 91/06/07 11:22:37 lwall - * patch4: new copyright notice - * - * Revision 4.0 91/03/20 01:34:46 lwall - * 4.0 baseline. - * * Revision 3.0.1.1 90/03/27 16:10:41 lwall * patch16: MSDOS support * --- 1,13 ---- ! /* $Header: msdos.c,v 3.0.1.1 90/03/27 16:10:41 lwall Locked $ * * (C) Copyright 1989, 1990 Diomidis Spinellis. + * (C) Copyright 1989, 1990 Tom Dinger + * (C) Copyright 1990 Leonard Reed * ! * You may distribute under the terms of the GNU General Public License ! * as specified in the README file that comes with the perl 3.0 kit. * * $Log: msdos.c,v $ * Revision 3.0.1.1 90/03/27 16:10:41 lwall * patch16: MSDOS support * *************** *** 24,35 **** * Various Unix compatibility functions for MS-DOS. */ ! #include "EXTERN.h" ! #include "perl.h" ! #include #include /* * Interface to the MS-DOS ioctl system call. * The function is encoded as follows: --- 20,34 ---- * Various Unix compatibility functions for MS-DOS. */ ! #include ! #include #include + #include #include + #include "EXTERN.h" + #include "perl.h" + /* * Interface to the MS-DOS ioctl system call. * The function is encoded as follows: *************** *** 61,67 **** struct SREGS segregs; srv.h.ah = 0x44; ! srv.h.al = (unsigned char)(function & 0x0F); srv.x.bx = handle; srv.x.cx = function >> 4; segread(&segregs); --- 60,66 ---- struct SREGS segregs; srv.h.ah = 0x44; ! srv.h.al = function & 0xf; srv.x.bx = handle; srv.x.cx = function >> 4; segread(&segregs); *************** *** 138,143 **** --- 137,143 ---- ; } + /* * Just pretend that everyone is a superuser */ *************** *** 146,170 **** int getuid(void) { ! return ROOT_UID; } int geteuid(void) { ! return ROOT_UID; } int getgid(void) { ! return ROOT_GID; } int getegid(void) { ! return ROOT_GID; } int --- 146,170 ---- int getuid(void) { ! return 0; } int geteuid(void) { ! return 0; } int getgid(void) { ! return 0; } int getegid(void) { ! return 0; } int *************** *** 174,258 **** int setgid(int gid) { return (gid==ROOT_GID?0:-1); } - - /* - * The following code is based on the do_exec and do_aexec functions - * in file doio.c - */ - int - do_aspawn(really,arglast) - STR *really; - int *arglast; - { - register STR **st = stack->ary_array; - register int sp = arglast[1]; - register int items = arglast[2] - sp; - register char **a; - char **argv; - char *tmps; - int status; - - if (items) { - New(1101,argv, items+1, char*); - a = argv; - for (st += ++sp; items > 0; items--,st++) { - if (*st) - *a++ = str_get(*st); - else - *a++ = ""; - } - *a = Nullch; - if (really && *(tmps = str_get(really))) - status = spawnvp(P_WAIT,tmps,argv); - else - status = spawnvp(P_WAIT,argv[0],argv); - Safefree(argv); - } - return status; - } - - - int - do_spawn(cmd) - char *cmd; - { - register char **a; - register char *s; - char **argv; - char flags[10]; - int status; - char *shell, *cmd2; - - /* save an extra exec if possible */ - if ((shell = getenv("COMSPEC")) == 0) - shell = "\\command.com"; - - /* see if there are shell metacharacters in it */ - if (strchr(cmd, '>') || strchr(cmd, '<') || strchr(cmd, '|')) - doshell: - return spawnl(P_WAIT,shell,shell,"/c",cmd,(char*)0); - - New(1102,argv, strlen(cmd) / 2 + 2, char*); - - New(1103,cmd2, strlen(cmd) + 1, char); - strcpy(cmd2, cmd); - a = argv; - for (s = cmd2; *s;) { - while (*s && isspace(*s)) s++; - if (*s) - *(a++) = s; - while (*s && !isspace(*s)) s++; - if (*s) - *s++ = '\0'; - } - *a = Nullch; - if (argv[0]) - if ((status = spawnvp(P_WAIT,argv[0],argv)) == -1) { - Safefree(argv); - Safefree(cmd2); - goto doshell; - } - Safefree(cmd2); - Safefree(argv); - return status; - } --- 174,176 ----