1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Part #1 of suidperl repair.

This commit is contained in:
Mark Murray 1998-09-24 17:20:46 +00:00
parent 9460731153
commit 5c17a87bef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39629
2 changed files with 23 additions and 0 deletions

View File

@ -2123,6 +2123,20 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
croak("Can't swap uid and euid"); /* really paranoid */
if (PerlLIO_stat(SvPVX(GvSV(PL_curcop->cop_filegv)),&tmpstatbuf) < 0)
croak("Permission denied"); /* testing full pathname here */
#if (defined(BSD) && (BSD >= 199306))
#ifdef IAMSUID
{
struct statfs stfs;
if (fstatfs(fileno(PL_rsfp),&stfs) < 0)
croak("Can't statfs filesystem of script \"%s\"",PL_origfilename);
if (stfs.f_flags & MNT_NOSUID)
croak("Permission denied");
}
#endif /* IAMSUID */
#endif /* BSD */
if (tmpstatbuf.st_dev != PL_statbuf.st_dev ||
tmpstatbuf.st_ino != PL_statbuf.st_ino) {
(void)PerlIO_close(PL_rsfp);

View File

@ -361,6 +361,15 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
# include <sys/param.h>
#endif
/* needed for IAMSUID case for 4.4BSD systems
* XXX there should probably be a Configure variable
*/
#ifdef I_SYS_PARAM
#if (defined (BSD) && (BSD >= 199306))
# include <sys/mount.h>
#endif /* !BSD */
#endif /* !I_SYS_PARAM */
/* Use all the "standard" definitions? */
#if defined(STANDARD_C) && defined(I_STDLIB)