# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Jun 20 02:24:20 EET DST 2001 [metaconfig 3.0 PL70]
+# Generated on Wed Jun 20 08:47:08 EET DST 2001 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
d_telldir=''
d_readlink=''
d_readv=''
-d_realpath=''
d_recvmsg=''
d_rename=''
d_rmdir=''
set readv d_readv
eval $inlibc
-: see if realpath exists
-set realpath d_realpath
-eval $inlibc
-
: see if recvmsg exists
set recvmsg d_recvmsg
eval $inlibc
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_readv='$d_readv'
-d_realpath='$d_realpath'
d_recvmsg='$d_recvmsg'
d_rename='$d_rename'
d_rewinddir='$d_rewinddir'
uregcomp$(_O) uregexec$(_O) urun$(_O) \
uscope$(_O) usv$(_O) utaint$(_O) utoke$(_O) \
unumeric$(_O) ulocale$(_O) \
- uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O) \
+ uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O)
microperl: $(O)
$(LD) -o $@ $(O) $(LIBS)
This variable conditionally defines the HAS_READV symbol, which
indicates to the C program that the readv() routine is available.
-d_realpath (d_realpath.U):
- This variable conditionally defines the HAS_REALPATH symbol, which
- indicates to the C program that the realpath() routine is available.
-
d_recvmsg (d_recvmsg.U):
This variable conditionally defines the HAS_RECVMSG symbol, which
indicates to the C program that the recvmsg() routine is available.
# Package name : perl5
# Source directory : .
-# Configuration time: Fri Jun 15 02:15:37 EET DST 2001
+# Configuration time: Wed Jun 20 08:48:18 EET DST 2001
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
ccversion='V5.6-082'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Fri Jun 15 02:15:37 EET DST 2001'
+cf_time='Wed Jun 20 08:48:18 EET DST 2001'
charsize='1'
chgrp=''
chmod=''
cppsymbols='_AES_SOURCE=1 __alpha=1 __ALPHA=1 _ANSI_C_SOURCE=1 __LANGUAGE_C__=1 _LONGLONG=1 __osf__=1 _OSF_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 _REENTRANT=1 __STDC__=1 _SYSTYPE_BSD=1 __unix__=1 _XOPEN_SOURCE=1'
cryptlib=''
csh='csh'
-d_Gconvert='gcvt((x),(n),(b))'
+d_Gconvert='sprintf((b),"%.*g",(n),(x))'
d_PRIEUldbl='define'
d_PRIFUldbl='define'
d_PRIGUldbl='define'
d_readdir='define'
d_readlink='define'
d_readv='define'
-d_realpath='define'
d_recvmsg='define'
d_rename='define'
d_rewinddir='define'
exe_ext=''
expr='expr'
extensions='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode POSIX PerlIO/Scalar PerlIO/Via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread Time/HiRes Time/Piece XS/Typemap attrs re Errno'
-fflushNULL='undef'
+fflushNULL='define'
fflushall='undef'
find=''
firstmakefile='makefile'
path_sep=':'
perl5='/u/vieraat/vieraat/jhi/Perl/bin/perl'
perl=''
-perl_patchlevel='10575'
+perl_patchlevel='10721'
perladmin='yourname@yourhost.yourplace.com'
perllibs='-lm -liconv -lutil -lpthread -lexc'
perlpath='/opt/perl/bin/perl'
PERL_API_REVISION=5
PERL_API_VERSION=5
PERL_API_SUBVERSION=0
-PERL_PATCHLEVEL=10575
+PERL_PATCHLEVEL=10721
PERL_CONFIG_SH=true
# Variables propagated from previous config.sh file.
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Fri Jun 15 02:15:37 EET DST 2001
+ * Configuration time: Wed Jun 20 08:48:18 EET DST 2001
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
* 4 and 8. The default is eight, for safety.
*/
#if defined(USE_CROSS_COMPILE) || defined(MULTIARCH)
-#define MEM_ALIGNBYTES 8
+# define MEM_ALIGNBYTES 8
#else
#define MEM_ALIGNBYTES 8
#endif
* d_Gconvert='sprintf((b),"%.*g",(n),(x))'
* The last two assume trailing zeros should not be kept.
*/
-#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
/* HAS_GETCWD:
* This symbol, if defined, indicates that the getcwd routine is
* Note that if fflushNULL is defined, fflushall will not
* even be probed for and will be left undefined.
*/
-/*#define FFLUSH_NULL / **/
+#define FFLUSH_NULL /**/
/*#define FFLUSH_ALL / **/
/* Fpos_t:
*/
/*#define HAS_FLOCK_PROTO / **/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
*/
#$d_flockproto HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-#$d_realpath HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
Aopd |char* |sv_pvn_force |SV* sv|STRLEN* lp
Apd |char* |sv_pvutf8n_force|SV* sv|STRLEN* lp
Apd |char* |sv_pvbyten_force|SV* sv|STRLEN* lp
-Apd |int |sv_realpath |SV* sv|char *path|STRLEN len
+Apd |int |sv_realpath |SV* sv|char *path|STRLEN maxlen
Apd |char* |sv_reftype |SV* sv|int ob
Apd |void |sv_replace |SV* sv|SV* nsv
Apd |void |sv_report_used
#undef Perl_sv_realpath
int
-Perl_sv_realpath(pTHXo_ SV* sv, char *path, STRLEN len)
+Perl_sv_realpath(pTHXo_ SV* sv, char *path, STRLEN maxlen)
{
- return ((CPerlObj*)pPerl)->Perl_sv_realpath(sv, path, len);
+ return ((CPerlObj*)pPerl)->Perl_sv_realpath(sv, path, maxlen);
}
#undef Perl_sv_reftype
(F) Your Perl was compiled with B<-D>SETUID_SCRIPTS_ARE_SECURE_NOW, but
a version of the setuid emulator somehow got run anyway.
+=item sv_realpath: %s
+
+(S) You probably used some form of getcwd. The implementation of
+that functionality detected something odd in your filesystem
+environment and gave up (returning undef).
+
=item Switch (?(condition)... contains too many branches in regex;
marked by <-- HERE in m/%s/
Safefree, savepv, savepvn, SAVETMPS, SP, SPAGAIN, ST, strEQ, strGE, strGT,
strLE, strLT, strNE, strnEQ, strnNE, StructCopy, SvCUR, SvCUR_set, SvEND,
SvGETMAGIC, SvGROW, SvIOK, SvIOKp, SvIOK_notUV, SvIOK_off, SvIOK_on,
-SvIOK_only, SvIOK_only_UV, SvIOK_UV, SvIV, SvIVx, SvIVX, SvLEN, SvNIOK,
+SvIOK_only, SvIOK_only_UV, SvIOK_UV, SvIV, SvIVX, SvIVx, SvLEN, SvNIOK,
SvNIOKp, SvNIOK_off, SvNOK, SvNOKp, SvNOK_off, SvNOK_on, SvNOK_only, SvNV,
SvNVx, SvNVX, SvOK, SvOOK, SvPOK, SvPOKp, SvPOK_off, SvPOK_on, SvPOK_only,
SvPOK_only_UTF8, SvPV, SvPVbyte, SvPVbytex, SvPVbytex_force,
=item Incompatible Changes
+=over 4
+
+=item 64-bit platforms and malloc
+
=item Future Deprecations
+=back
+
=item Core Enhancements
=item Modules and Pragmata
=over 4
-=item New Modules
+=item New Modules and Distribution
=item Updated And Improved Modules and Pragmata
=back
-=item Performance Enhancements
-
=item Utility Changes
=item New Documentation
=item Self-tying of Arrays and Hashes Is Forbidden
+=item Variable Attributes are not Currently Usable for Tieing
+
=item Building Extensions Can Fail Because Of Largefiles
=item The Compiler Suite Is Still Experimental
* 4 and 8. The default is eight, for safety.
*/
#if defined(USE_CROSS_COMPILE) || defined(MULTIARCH)
-#define MEM_ALIGNBYTES 8
+# define MEM_ALIGNBYTES 8
#else
#define MEM_ALIGNBYTES 4
#endif
*/
/*#define HAS_FLOCK_PROTO / **/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH / **/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
d_readdir='undef'
d_readlink='undef'
d_readv='undef'
-d_realpath='undef'
d_recvmsg='undef'
d_rename='undef'
d_rewinddir='undef'
SvGROW(sv, 128);
while ((getcwd(SvPVX(sv), SvLEN(sv)-1) == NULL) && errno == ERANGE) {
+ if (SvLEN(sv) + 128 >= MAXPATHLEN) {
+ SV_CWD_RETURN_UNDEF;
+ }
SvGROW(sv, SvLEN(sv) + 128);
}
SvCUR_set(sv, strlen(SvPVX(sv)));
SV_CWD_RETURN_UNDEF;
}
+ if (pathlen + namelen + 1 >= MAXPATHLEN) {
+ SV_CWD_RETURN_UNDEF;
+ }
+
SvGROW(sv, pathlen + namelen + 1);
if (pathlen) {
/*
=for apidoc sv_realpath
-Wrap or emulate realpath(3).
+Emulate realpath(3).
+
+The real realpath() is not used because it's a known can of worms.
+We may have bugs but hey, they are our very own.
=cut
*/
int
-Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN len)
+Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN maxlen)
{
#ifndef PERL_MICRO
- char name[MAXPATHLEN] = { 0 }, *s;
+ char name[MAXPATHLEN] = { 0 };
+ char dotdots[MAXPATHLEN] = { 0 };
+ char *s;
STRLEN pathlen, namelen;
+ DIR *parent;
+ Direntry_t *dp;
+ struct stat cst, pst, tst;
- /* Don't use strlen() to avoid running off the end. */
- s = memchr(path, '\0', MAXPATHLEN);
- pathlen = s ? s - path : MAXPATHLEN;
-
-#ifdef HAS_REALPATH
-
- /* Be paranoid about the use of realpath(),
- * it is an infamous source of buffer overruns. */
-
- /* Is the source buffer too long? */
- if (pathlen == MAXPATHLEN) {
- Perl_warn(aTHX_ "sv_realpath: realpath(\"%s\"): %c= (MAXPATHLEN = %d)",
- path, s ? '=' : '>', MAXPATHLEN);
- SV_CWD_RETURN_UNDEF;
- }
-
- /* Here goes nothing. */
- if (realpath(path, name) == NULL) {
- Perl_warn(aTHX_ "sv_realpath: realpath(\"%s\"): %s",
- path, Strerror(errno));
+ if (!sv || !path || !maxlen) {
+ Perl_warn(aTHX_ "sv_realpath: realpath(0x%x, 0x%x, "")",
+ sv, path, maxlen);
SV_CWD_RETURN_UNDEF;
}
- /* Is the destination buffer too long?
+ /* Is the source buffer too long?
* Don't use strlen() to avoid running off the end. */
- s = memchr(name, '\0', MAXPATHLEN);
- namelen = s ? s - name : MAXPATHLEN;
- if (namelen == MAXPATHLEN) {
- Perl_warn(aTHX_ "sv_realpath: realpath(\"%s\"): %c= (MAXPATHLEN = %d)",
- path, s ? '=' : '>', MAXPATHLEN);
+ if (maxlen >= MAXPATHLEN)
+ pathlen = maxlen;
+ else {
+ s = memchr(path, '\0', MAXPATHLEN);
+ pathlen = s ? s - path : MAXPATHLEN;
+ }
+ if (pathlen >= MAXPATHLEN) {
+ Perl_warn(aTHX_ "sv_realpath: source too large");
SV_CWD_RETURN_UNDEF;
}
- /* The coast is clear? */
- sv_setpvn(sv, name, namelen);
- SvPOK_only(sv);
-
- return TRUE;
-#else
- {
- DIR *parent;
- Direntry_t *dp;
- char dotdots[MAXPATHLEN] = { 0 };
- struct stat cst, pst, tst;
-
if (PerlLIO_stat(path, &cst) < 0) {
Perl_warn(aTHX_ "sv_realpath: stat(\"%s\"): %s",
path, Strerror(errno));
(void)SvUPGRADE(sv, SVt_PV);
- if (!len) {
- len = strlen(path);
- }
- Copy(path, dotdots, len, char);
+ Copy(path, dotdots, maxlen, char);
+
+ pathlen = 0;
for (;;) {
strcat(dotdots, "/..");
SV_CWD_RETURN_UNDEF;
}
+ if (pathlen + namelen + 1 >= MAXPATHLEN) {
+ Perl_warn(aTHX_ "sv_realpath: too long name");
+ SV_CWD_RETURN_UNDEF;
+ }
+
SvGROW(sv, pathlen + namelen + 1);
if (pathlen) {
/* shift down */
SvPOK_only(sv);
return TRUE;
- }
-#endif
#else
- return FALSE;
+ return FALSE; /* MICROPERL */
#endif
}
$d_readdir='define'
$d_readlink='define'
$d_readv='undef'
-$d_realpath='undef'
$d_recvmsg='undef'
$d_rename='define'
$d_rewinddir='define'
*/
/*#define HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
$d_readdir='define'
$d_readlink='define'
$d_readv='undef'
-$d_realpath='undef'
$d_recvmsg='undef'
$d_rename='define'
$d_rewinddir='define'
*/
/*#define HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
*/
/*#define HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
*/
/*#define HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask
*/
/*#define HAS_FLOCK_PROTO /**/
-/* HAS_REALPATH:
- * This symbol, if defined, indicates that the realpath routine is
- * available to do resolve paths.
- */
-/*#define HAS_REALPATH /**/
-
/* HAS_SIGPROCMASK:
* This symbol, if defined, indicates that the sigprocmask
* system call is available to examine or change the signal mask