Perl patch #29 - loses Sys V compatibility
M S Slomin
mike2 at lcuxa.UUCP
Tue Mar 22 01:34:02 AEST 1988
Unfortunately, patch #29 has caused compatibility with System V
(rev 2) to be lost. The problems are: (1) <param.h>
does not include <types.h>; (2) arg.c as modified calls fchmod()
and fchown(); and (3) stab.c as modified calls setruid(), seteuid(),
setrgid() and setegid(). The system calls in nos. 2 and 3 above do
not exist. Presumably, the fixes are:
*** stab.c
--- stab.c-on-sys-v
**************
*** 266,272
break;
case '<':
uid = (int)str_gnum(str);
! if (setruid(uid) < 0)
uid = (int)getuid();
break;
case '>':
--- 266,272 -----
break;
case '<':
uid = (int)str_gnum(str);
! if (setuid(uid) < 0)
uid = (int)getuid();
break;
case '>':
**************
*** 271,277
break;
case '>':
euid = (int)str_gnum(str);
! if (seteuid(euid) < 0)
euid = (int)geteuid();
break;
case '(':
--- 271,277 -----
break;
case '>':
euid = (int)str_gnum(str);
! if (setuid(euid) < 0)
euid = (int)geteuid();
break;
case '(':
**************
*** 275,281
euid = (int)geteuid();
break;
case '(':
! setrgid((int)str_gnum(str));
break;
case ')':
setegid((int)str_gnum(str));
--- 275,281 -----
euid = (int)geteuid();
break;
case '(':
! setgid((int)str_gnum(str));
break;
case ')':
setgid((int)str_gnum(str));
**************
*** 278,284
setrgid((int)str_gnum(str));
break;
case ')':
! setegid((int)str_gnum(str));
break;
case '.':
case '+':
--- 278,284 -----
setgid((int)str_gnum(str));
break;
case ')':
! setgid((int)str_gnum(str));
break;
case '.':
case '+':
*** arg.c
--- arg.c-on-sys-v
**************
*** 513,520
errno = 0; /* in case sprintf set errno */
do_open(argvoutstab,tokenbuf);
defoutstab = argvoutstab;
! fchmod(fileno(argvoutstab->stab_io->fp),filemode);
! fchown(fileno(argvoutstab->stab_io->fp),fileuid,filegid);
}
str_free(str);
return stab->stab_io->fp;
--- 513,520 -----
errno = 0; /* in case sprintf set errno */
do_open(argvoutstab,tokenbuf);
defoutstab = argvoutstab;
! chmod(fileno(argvoutstab->stab_io->fp),filemode);
! chown(fileno(argvoutstab->stab_io->fp),fileuid,filegid);
}
str_free(str);
return stab->stab_io->fp;
*** perl.h
--- perl.h-on-sys-v
**************
*** 44,49
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
#include <sys/param.h>
#include <sys/stat.h>
--- 44,50 -----
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
+ #include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
Since I do not have superuser privileges, I cannot test the foregoing.
It does, however, compile.
Mike Slomin
bellcore!lcuxa!mike2
More information about the Comp.sources.bugs
mailing list