diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-19 07:34:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-19 07:34:29 +0000 |
commit | 2a4bf7730d252fcadf5e50c3a9c740b5c94acfe3 (patch) | |
tree | 9a7597178791661d866752380767b1406cb2c96a | |
parent | 17cab1b848e4960c008b73548ee8e62a9e9735ec (diff) | |
parent | 41d6edb2c1acac32a0296d594f0943752d23f077 (diff) | |
download | perl-2a4bf7730d252fcadf5e50c3a9c740b5c94acfe3.tar.gz |
integrate cfgperl contents into mainline
p4raw-id: //depot/perl@5822
-rwxr-xr-x | Configure | 12 | ||||
-rw-r--r-- | Porting/Glossary | 11 | ||||
-rw-r--r-- | Porting/config.sh | 4 | ||||
-rw-r--r-- | Porting/config_H | 22 | ||||
-rw-r--r-- | Todo | 5 | ||||
-rw-r--r-- | Todo-5.6 | 23 | ||||
-rw-r--r-- | config_h.SH | 20 | ||||
-rw-r--r-- | doio.c | 8 | ||||
-rw-r--r-- | embed.h | 4 | ||||
-rwxr-xr-x | embed.pl | 1 | ||||
-rw-r--r-- | epoc/config.sh | 2 | ||||
-rw-r--r-- | ext/IPC/SysV/Msg.pm | 14 | ||||
-rw-r--r-- | ext/Thread/Thread.pm | 17 | ||||
-rw-r--r-- | global.sym | 1 | ||||
-rw-r--r-- | objXSUB.h | 4 | ||||
-rw-r--r-- | op.c | 3 | ||||
-rw-r--r-- | perlapi.c | 7 | ||||
-rw-r--r-- | pod/perlapi.pod | 17 | ||||
-rw-r--r-- | pod/perldelta.pod | 79 | ||||
-rw-r--r-- | pod/perlfunc.pod | 78 | ||||
-rw-r--r-- | pod/perlipc.pod | 67 | ||||
-rw-r--r-- | pod/perlsec.pod | 24 | ||||
-rw-r--r-- | pod/perlthrtut.pod | 8 | ||||
-rw-r--r-- | pp_sys.c | 59 | ||||
-rw-r--r-- | proto.h | 1 | ||||
-rw-r--r-- | sv.c | 19 | ||||
-rwxr-xr-x | t/lib/ipc_sysv.t | 10 | ||||
-rwxr-xr-x | t/op/sysio.t | 2 | ||||
-rwxr-xr-x | t/op/taint.t | 81 | ||||
-rw-r--r-- | toke.c | 2 | ||||
-rw-r--r-- | vms/subconfigure.com | 4 | ||||
-rw-r--r-- | vos/config.def | 2 | ||||
-rw-r--r-- | vos/config.h | 22 | ||||
-rwxr-xr-x | vos/config_h.SH_orig | 27 | ||||
-rw-r--r-- | win32/config_H.bc | 24 | ||||
-rw-r--r-- | win32/config_H.gc | 24 | ||||
-rw-r--r-- | win32/config_H.vc | 24 |
37 files changed, 562 insertions, 170 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu Mar 16 03:04:33 EET 2000 [metaconfig 3.0 PL70] +# Generated on Sat Mar 18 23:12:11 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <<EOF @@ -3312,13 +3312,15 @@ while test "$type"; do Directory) for fp in $gfpth; do if test "X$fp" = X.; then - pf="$ansexp" + dir="$ans" + direxp="$ansexp" else - pf="$fp/$ansexp" + dir="$fp/$ans" + direxp="$fp/$ansexp" fi - if test -d "$pf"; then + if test -d "$direxp"; then type='' - value="$pf" + value="$dir" break fi done diff --git a/Porting/Glossary b/Porting/Glossary index 2c948b8689..cc66d7041b 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -131,8 +131,8 @@ bin (bin.U): this variable must be prepared to deal with ~name substitution. bincompat5005 (bincompat5005.U): - This variable contains y if Perl 5.006 should be binary-compatible - with Perl 5.005. + This variable contains y if this version of Perl should be + binary-compatible with Perl 5.005. binexp (bin.U): This is the same as the bin variable, but is filename expanded at @@ -363,9 +363,10 @@ d_bcopy (d_bcopy.U): d_bincompat5005 (bincompat5005.U): This variable conditionally defines BINCOMPAT5005 so that embed.h - can take special action if Perl 5.006 should be binary-compatible - with Perl 5.005. This is impossible for builds that use features - like threads and multiplicity it is always $undef for those versions. + can take special action if this version of Perl should be + binary-compatible with Perl 5.005. This is impossible for builds + that use features like threads and multiplicity it is always $undef + for those versions. d_bsd (Guess.U): This symbol conditionally defines the symbol BSD when running on a diff --git a/Porting/config.sh b/Porting/config.sh index c88698768d..a0a4bba3c7 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -8,7 +8,7 @@ # Package name : perl5 # Source directory : . -# Configuration time: Thu Mar 16 03:30:28 EET 2000 +# Configuration time: Sat Mar 18 23:13:32 EET 2000 # Configured by : jhi # Target system : osf1 alpha.hut.fi v4.0 878 alpha @@ -59,7 +59,7 @@ ccflags='-pthread -std -DLANGUAGE_C' ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_BSD=1 SYSTYPE_BSD=1 unix=1' cf_by='jhi' cf_email='yourname@yourhost.yourplace.com' -cf_time='Thu Mar 16 03:30:28 EET 2000' +cf_time='Sat Mar 18 23:13:32 EET 2000' charsize='1' chgrp='' chmod='' diff --git a/Porting/config_H b/Porting/config_H index 70bf2c09c1..75f860b678 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -17,7 +17,7 @@ /* * Package name : perl5 * Source directory : . - * Configuration time: Thu Mar 16 03:30:28 EET 2000 + * Configuration time: Sat Mar 18 23:13:32 EET 2000 * Configured by : jhi * Target system : osf1 alpha.hut.fi v4.0 878 alpha */ @@ -1127,7 +1127,7 @@ #define BIN_EXP "/opt/perl/bin" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always * for those versions. @@ -2204,6 +2204,12 @@ */ #define Gid_t_f "u" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign 1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2213,16 +2219,16 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have * getgroups() or setgropus().. @@ -2864,6 +2870,12 @@ */ #define Uid_t_f "u" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign 1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ @@ -22,6 +22,11 @@ Would be nice to have support in perlmain to rerun debugger regression tests using __DIE__ hook lexically scoped functions: my sub foo { ... } + the basic concept is easy and sound, + the difficulties begin with self-referential + and mutually referential lexical subs: how to + declare the subs? + lexically scoped typeglobs? (lexical I/O handles work now) wantlvalue? more generalized want()/caller()? named prototypes: sub foo ($foo, @bar) { ... } ? regression/sanity tests for suidperl @@ -48,11 +48,12 @@ Configure uselargefiles <-> ... make configuring+building away from source directory work (VPATH et al) this is related to: cross-compilation configuring - scenarios to consider: the host and the target might have - shared filesystems, or they might not (the communication - channel might be e.g. rsh/ssh, or some batch submission system) - most obviously: they might not share the same CPU - meaning: assume nothing about shared properties/resources + host vs target: compile in the host, get the executable to the target, + get the possible input files to the target, execute in the target, + get possible output files back to to host. this needs to work + both during Configure and during the build. You cannot assume + shared filesystems between the host and the target, executing + the target executable may involve e.g. rsh _r support (see Todo for mode detailed description) POSIX 1003.1 1996 Edition support--realtime stuff: POSIX semaphores, message queues, shared memory, realtime clocks, @@ -91,6 +92,18 @@ Locales Regexen make RE engine thread-safe + a way to do full character set arithmetics: now one can do + addition, negate a whole class, and negate certain subclasses + (e.g. \D, [:^digit:]), but a more generic way to add/subtract/ + intersect characters/classes, like described in the Unicode technical + report on Regular Expression Guidelines, + http://www.unicode.org/unicode/reports/tr18/ + (amusingly, the TR notes that difference and intersection + can be done using "Perl-style look-ahead") + difference syntax? maybe [[:alpha:][^abc]] meaning + "all alphabetic expect a, b, and c"? or [[:alpha:]-[abc]]? + (maybe bad, as we explicitly disallow such 'ranges') + intersection syntax? maybe [[..]&[...]]? POSIX [=bar=] and [.zap.] would nice too but there's no API for them =bar= could be done with Unicode, though, see the Unicode TR #15 about normalization forms: diff --git a/config_h.SH b/config_h.SH index 91adef302a..52f4cb8da0 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1141,7 +1141,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define BIN_EXP "$binexp" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always $undef * for those versions. @@ -2218,6 +2218,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Gid_t_f $gidformat /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign $gidsign /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2227,16 +2233,16 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t $gidtype /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have * getgroups() or setgropus().. @@ -2878,6 +2884,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Uid_t_f $uidformat /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign $uidsign /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ @@ -1926,6 +1926,10 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp) if (ret >= 0) { SvCUR_set(mstr, sizeof(long)+ret); *SvEND(mstr) = '\0'; +#ifndef INCOMPLETE_TAINTS + /* who knows who has been playing with this message? */ + SvTAINTED_on(mstr); +#endif } return ret; #else @@ -1994,6 +1998,10 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp) SvCUR_set(mstr, msize); *SvEND(mstr) = '\0'; SvSETMAGIC(mstr); +#ifndef INCOMPLETE_TAINTS + /* who knows who has been playing with this shared memory? */ + SvTAINTED_on(mstr); +#endif } else { I32 n; @@ -471,6 +471,7 @@ #define newSVREF Perl_newSVREF #define newSVOP Perl_newSVOP #define newSViv Perl_newSViv +#define newSVuv Perl_newSVuv #define newSVnv Perl_newSVnv #define newSVpv Perl_newSVpv #define newSVpvn Perl_newSVpvn @@ -1914,6 +1915,7 @@ #define newSVREF(a) Perl_newSVREF(aTHX_ a) #define newSVOP(a,b,c) Perl_newSVOP(aTHX_ a,b,c) #define newSViv(a) Perl_newSViv(aTHX_ a) +#define newSVuv(a) Perl_newSVuv(aTHX_ a) #define newSVnv(a) Perl_newSVnv(aTHX_ a) #define newSVpv(a,b) Perl_newSVpv(aTHX_ a,b) #define newSVpvn(a,b) Perl_newSVpvn(aTHX_ a,b) @@ -3743,6 +3745,8 @@ #define newSVOP Perl_newSVOP #define Perl_newSViv CPerlObj::Perl_newSViv #define newSViv Perl_newSViv +#define Perl_newSVuv CPerlObj::Perl_newSVuv +#define newSVuv Perl_newSVuv #define Perl_newSVnv CPerlObj::Perl_newSVnv #define newSVnv Perl_newSVnv #define Perl_newSVpv CPerlObj::Perl_newSVpv @@ -1770,6 +1770,7 @@ Ap |SV* |newSV |STRLEN len Ap |OP* |newSVREF |OP* o Ap |OP* |newSVOP |I32 type|I32 flags|SV* sv Apd |SV* |newSViv |IV i +Apd |SV* |newSVuv |UV u Apd |SV* |newSVnv |NV n Apd |SV* |newSVpv |const char* s|STRLEN len Apd |SV* |newSVpvn |const char* s|STRLEN len diff --git a/epoc/config.sh b/epoc/config.sh index 8b9f982139..a60b7a0f08 100644 --- a/epoc/config.sh +++ b/epoc/config.sh @@ -770,7 +770,9 @@ i_sysstatfs='undef' i_sysvfs='undef' i_ustat='undef' uidsize='2' +uidsign='1' gidsize='2' +gidsign='1' ivdformat='"ld"' uvuformat='"lu"' uvoformat='"lo"' diff --git a/ext/IPC/SysV/Msg.pm b/ext/IPC/SysV/Msg.pm index 099329826f..120a5b2d3a 100644 --- a/ext/IPC/SysV/Msg.pm +++ b/ext/IPC/SysV/Msg.pm @@ -90,14 +90,14 @@ sub rcv { msgrcv($$self,$buf,$_[1],$_[2] || 0, $_[3] || 0) or return; my $type; - ($type,$_[0]) = unpack("L a*",$buf); + ($type,$_[0]) = unpack("l! a*",$buf); $type; } sub snd { @_ <= 4 && @_ >= 3 or croak '$msg->snd( TYPE, BUF, FLAGS )'; my $self = shift; - msgsnd($$self,pack("L a*",$_[0],$_[1]), $_[2] || 0); + msgsnd($$self,pack("l! a*",$_[0],$_[1]), $_[2] || 0); } @@ -111,12 +111,12 @@ IPC::Msg - SysV Msg IPC object class =head1 SYNOPSIS - use IPC::SysV qw(IPC_PRIVATE S_IRWXU S_IRWXG S_IRWXO); + use IPC::SysV qw(IPC_PRIVATE S_IRWXU); use IPC::Msg; - $msg = new IPC::Msg(IPC_PRIVATE, S_IRWXU | S_IRWXG | S_IRWXO); + $msg = new IPC::Msg(IPC_PRIVATE, S_IRWXU); - $msg->snd(pack("L a*",$msgtype,$msg)); + $msg->snd(pack("l! a*",$msgtype,$msg)); $msg->rcv($buf,256); @@ -157,8 +157,8 @@ Returns the system message queue identifier. =item rcv ( BUF, LEN [, TYPE [, FLAGS ]] ) -Read a message from the queue. Returns the type of the message read. See -L<msgrcv> +Read a message from the queue. Returns the type of the message read. +See L<msgrcv>. The BUF becomes tainted. =item remove diff --git a/ext/Thread/Thread.pm b/ext/Thread/Thread.pm index 3e50a99cd4..00cba8af67 100644 --- a/ext/Thread/Thread.pm +++ b/ext/Thread/Thread.pm @@ -36,16 +36,15 @@ Thread - manipulate threads in Perl (EXPERIMENTAL, subject to change) =head1 DESCRIPTION -The C<Thread> module provides multithreading support for perl. - -WARNING: Threading is an experimental feature. Both the interface -and implementation are subject to change drastically. + WARNING: Threading is an experimental feature. Both the interface + and implementation are subject to change drastically. In fact, this + documentation describes the flavor of threads that was in version + 5.005. Perl 5.6.0 and later have the beginnings of support for + interpreter threads, which (when finished) is expected to be + significantly different from what is described here. The information + contained here may therefore soon be obsolete. Use at your own risk! -In fact, this documentation describes the flavor of threads that was in -version 5.005. Perl v5.6 has the beginnings of support for interpreter -threads, which (when finished) is expected to be significantly different -from what is described here. The information contained here may therefore -soon be obsolete. Use at your own risk! +The C<Thread> module provides multithreading support for perl. =head1 FUNCTIONS diff --git a/global.sym b/global.sym index 7a97668caf..95e7775609 100644 --- a/global.sym +++ b/global.sym @@ -272,6 +272,7 @@ Perl_newSV Perl_newSVREF Perl_newSVOP Perl_newSViv +Perl_newSVuv Perl_newSVnv Perl_newSVpv Perl_newSVpvn @@ -1073,6 +1073,10 @@ #define Perl_newSViv pPerl->Perl_newSViv #undef newSViv #define newSViv Perl_newSViv +#undef Perl_newSVuv +#define Perl_newSVuv pPerl->Perl_newSVuv +#undef newSVuv +#define newSVuv Perl_newSVuv #undef Perl_newSVnv #define Perl_newSVnv pPerl->Perl_newSVnv #undef newSVnv @@ -2746,7 +2746,8 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) SvREFCNT_dec(transv); if (!del && havefinal) - (void)hv_store((HV*)SvRV((cSVOPo->op_sv)), "FINAL", 5, newSViv((IV)final), 0); + (void)hv_store((HV*)SvRV((cSVOPo->op_sv)), "FINAL", 5, + newSVuv((UV)final), 0); if (grows && to_utf) o->op_private |= OPpTRANS_GROWS; @@ -1963,6 +1963,13 @@ Perl_newSViv(pTHXo_ IV i) return ((CPerlObj*)pPerl)->Perl_newSViv(i); } +#undef Perl_newSVuv +SV* +Perl_newSVuv(pTHXo_ UV u) +{ + return ((CPerlObj*)pPerl)->Perl_newSVuv(u); +} + #undef Perl_newSVnv SV* Perl_newSVnv(pTHXo_ NV n) diff --git a/pod/perlapi.pod b/pod/perlapi.pod index c13dcde6ff..32e77d6f07 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -897,6 +897,13 @@ Creates a new SV which is an exact duplicate of the original SV. SV* newSVsv(SV* old) +=item newSVuv + +Creates a new SV and copies an unsigned integer into it. +The reference count for the SV is set to 1. + + SV* newSVuv(UV u) + =item newXS Used by C<xsubpp> to hook up XSUBs as Perl subs. @@ -1590,17 +1597,17 @@ false, defined or undefined. Does not handle 'get' magic. bool SvTRUE(SV* sv) +=item svtype + +An enum of flags for Perl types. These are found in the file B<sv.h> +in the C<svtype> enum. Test these flags with the C<SvTYPE> macro. + =item SvTYPE Returns the type of the SV. See C<svtype>. svtype SvTYPE(SV* sv) -=item svtype - -An enum of flags for Perl types. These are found in the file B<sv.h> -in the C<svtype> enum. Test these flags with the C<SvTYPE> macro. - =item SVt_IV Integer type flag for scalars. See C<svtype>. diff --git a/pod/perldelta.pod b/pod/perldelta.pod index e7eab2b3a9..147bbc1edb 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -206,6 +206,19 @@ will produce different results on platforms that have different $Config{ivsize}. For portability, be sure to mask off the excess bits in the result of unary C<~>, e.g., C<~$x & 0xffffffff>. +=head2 The passwd and shell returned by the getpwxxx() are now tainted + +Because the user can affect her own encrypted password and login shell +the password and shell returned by the getpwent(), getpwnam(), and +getpwuid() functions are tainted. + +=head2 The msgrcv() and shmread() now taint + +Because other (untrusted) processes can modify messages and shared +memory segments for their own nefarious purposes, the messages +returned by msgrcv() (and its object-oriented interface, +IPC::SysV::Msg::rcv) and the variable modified by shmread() are tainted. + =back =head2 C Source Incompatibilities @@ -535,7 +548,7 @@ See L<perldata/"Scalar value constructors"> for additional information. =head2 Weak references - WARNING: This is an experimental feature. + WARNING: This is an experimental feature. Details are subject to change. In previous versions of Perl, you couldn't cache objects so as to allow them to be deleted if the last reference from outside @@ -2632,6 +2645,70 @@ warning. And in Perl 5.005, this special treatment will cease. =back +=head1 Known Problems + +=head2 Thread tests failing + +The subtests 19 and 20 of the lib/thread test are known to fail in +many platforms. + +=head2 EBCDIC platforms not supported + +In earlier releases of Perl the EBCDIC environments like OS390 (also +known as Open Edition MVS) and VM-ESA were supported. Due to the +changes required by the UTF-8 (Unicode) support in Perl 5.6 the EBCDIC +platforms are not supported in Perl 5.6.0. + +=head2 NEXTSTEP 3.3 POSIX test failure + +In NEXTSTEP 3.3p2 the implementation of the strftime(3) in the +operating system libraries is buggy: the %j format numbers the days of +a month starting from zero, which, while being logical to programmers, +will cause the subtests 19 to 27 of the lib/posix test may fail. + +=head2 UNICOS/mk CC failures during Configure run + +In UNICOS/mk the following errors may appear during the Configure run: + + Guessing which symbols your C compiler and preprocessor define... + CC-20 cc: ERROR File = try.c, Line = 3 + ... + bad switch yylook 79bad switch yylook 79bad switch yylook 79bad switch yylook 79#ifdef A29K + ... + 4 errors detected in the compilation of "try.c". + +The culprit is the broken awk of UNICOS/mk. The effect is fortunately +rather mild: Perl itself is not adversely affected by the error, only +the h2ph utility coming with Perl, and that is rather rarely needed +these days. + +=head2 Many features still experimental + +As discussed above, many features are still experimental, to a greater +or lesser degree. Interfaces and implementation are subject to +change, in extreme cases even subject to removal in some future +release of Perl. These features include the following: + +=over 4 + +=item Threads + +=item Unicode + +=item Lvalue subroutines + +=item Weak references + +=item File globbing now implemented internally + +=item The Compiler suite + +=item the DB module + +=item the regular expression constructs C<(?{ code })> and C<(??{ code })> + +=back + =head1 BUGS If you find what you think is a bug, you might check the diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index f14b8bb04b..2c96d1d310 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1859,6 +1859,14 @@ various get routines are as follows: (If the entry doesn't exist you get a null list.) +The exact meaning of the $gcos field varies but it usually contains +the real name of the user (as opposed to the login name) and other +information pertaining to the user. Beware, however, that in many +system users are able to change this information and therefore it +cannot be trusted and therefore the $gcos is is tainted (see +L<perlsec>). The $passwd and $shell, user's encrypted password and +login shell, are also tainted, because of the same reason. + In scalar context, you get the name, unless the function was a lookup by name, in which case you get the other thing, whatever it is. (If the entry doesn't exist you get the undefined value.) For example: @@ -1871,26 +1879,25 @@ lookup by name, in which case you get the other thing, whatever it is. $name = getgrent(); #etc. -In I<getpw*()> the fields $quota, $comment, and $expire are -special cases in the sense that in many systems they are unsupported. -If the $quota is unsupported, it is an empty scalar. If it is -supported, it usually encodes the disk quota. If the $comment -field is unsupported, it is an empty scalar. If it is supported it -usually encodes some administrative comment about the user. In some -systems the $quota field may be $change or $age, fields that have -to do with password aging. In some systems the $comment field may -be $class. The $expire field, if present, encodes the expiration -period of the account or the password. For the availability and the -exact meaning of these fields in your system, please consult your -getpwnam(3) documentation and your F<pwd.h> file. You can also find -out from within Perl what your $quota and $comment fields mean -and whether you have the $expire field by using the C<Config> module -and the values C<d_pwquota>, C<d_pwage>, C<d_pwchange>, C<d_pwcomment>, -and C<d_pwexpire>. Shadow password files are only supported if your -vendor has implemented them in the intuitive fashion that calling the -regular C library routines gets the shadow versions if you're running -under privilege. Those that incorrectly implement a separate library -call are not supported. +In I<getpw*()> the fields $quota, $comment, and $expire are special +cases in the sense that in many systems they are unsupported. If the +$quota is unsupported, it is an empty scalar. If it is supported, it +usually encodes the disk quota. If the $comment field is unsupported, +it is an empty scalar. If it is supported it usually encodes some +administrative comment about the user. In some systems the $quota +field may be $change or $age, fields that have to do with password +aging. In some systems the $comment field may be $class. The $expire +field, if present, encodes the expiration period of the account or the +password. For the availability and the exact meaning of these fields +in your system, please consult your getpwnam(3) documentation and your +F<pwd.h> file. You can also find out from within Perl what your +$quota and $comment fields mean and whether you have the $expire field +by using the C<Config> module and the values C<d_pwquota>, C<d_pwage>, +C<d_pwchange>, C<d_pwcomment>, and C<d_pwexpire>. Shadow password +files are only supported if your vendor has implemented them in the +intuitive fashion that calling the regular C library routines gets the +shadow versions if you're running under privilege. Those that +incorrectly implement a separate library call are not supported. The $members value returned by I<getgr*()> is a space separated list of the login names of the members of the group. @@ -2490,22 +2497,25 @@ Calls the System V IPC function msgget(2). Returns the message queue id, or the undefined value if there is an error. See also C<IPC::SysV> and C<IPC::Msg> documentation. -=item msgsnd ID,MSG,FLAGS - -Calls the System V IPC function msgsnd to send the message MSG to the -message queue ID. MSG must begin with the native long integer message -type, which may be created with C<pack("l!", $type)>. Returns true if -successful, or false if there is an error. See also C<IPC::SysV> and -C<IPC::SysV::Msg> documentation. - =item msgrcv ID,VAR,SIZE,TYPE,FLAGS Calls the System V IPC function msgrcv to receive a message from message queue ID into variable VAR with a maximum message size of -SIZE. Note that if a message is received, the message type will be -the first thing in VAR, and the maximum length of VAR is SIZE plus the -size of the message type. Returns true if successful, or false if -there is an error. See also C<IPC::SysV> and C<IPC::SysV::Msg> documentation. +SIZE. Note that when a message is received, the message type as a +native long integer will be the first thing in VAR, followed by the +actual message. This packing may be opened with C<unpack("l! a*")>. +Taints the variable. Returns true if successful, or false if there is +an error. See also C<IPC::SysV> and C<IPC::SysV::Msg> documentation. + +=item msgsnd ID,MSG,FLAGS + +Calls the System V IPC function msgsnd to send the message MSG to the +message queue ID. MSG must begin with the native long integer message +type, and be followed by the length of the actual message, and finally +the message itself. This kind of packing can be achieved with +C<pack("l! a*", $type, $message)>. Returns true if successful, +or false if there is an error. See also C<IPC::SysV> +and C<IPC::SysV::Msg> documentation. =item my EXPR @@ -4015,8 +4025,8 @@ detaching from it. When reading, VAR must be a variable that will hold the data read. When writing, if STRING is too long, only SIZE bytes are used; if STRING is too short, nulls are written to fill out SIZE bytes. Return true if successful, or false if there is an error. -See also C<IPC::SysV> documentation and the C<IPC::Shareable> module -from CPAN. +shmread() taints the variable. See also C<IPC::SysV> documentation and +the C<IPC::Shareable> module from CPAN. =item shutdown SOCKET,HOW diff --git a/pod/perlipc.pod b/pod/perlipc.pod index a9c7e48106..8760257821 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -1305,16 +1305,16 @@ you weren't wanting it to. Here's a small example showing shared memory usage. - use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRWXU S_IRWXG S_IRWXO); + use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRWXU); $size = 2000; - $key = shmget(IPC_PRIVATE, $size, S_IRWXU|S_IRWXG|S_IRWXO) || die "$!"; - print "shm key $key\n"; + $id = shmget(IPC_PRIVATE, $size, S_IRWXU) || die "$!"; + print "shm key $id\n"; $message = "Message #1"; - shmwrite($key, $message, 0, 60) || die "$!"; + shmwrite($id, $message, 0, 60) || die "$!"; print "wrote: '$message'\n"; - shmread($key, $buff, 0, 60) || die "$!"; + shmread($id, $buff, 0, 60) || die "$!"; print "read : '$buff'\n"; # the buffer of shmread is zero-character end-padded. @@ -1322,16 +1322,16 @@ Here's a small example showing shared memory usage. print "un" unless $buff eq $message; print "swell\n"; - print "deleting shm $key\n"; - shmctl($key, IPC_RMID, 0) || die "$!"; + print "deleting shm $id\n"; + shmctl($id, IPC_RMID, 0) || die "$!"; Here's an example of a semaphore: use IPC::SysV qw(IPC_CREAT); $IPC_KEY = 1234; - $key = semget($IPC_KEY, 10, 0666 | IPC_CREAT ) || die "$!"; - print "shm key $key\n"; + $id = semget($IPC_KEY, 10, 0666 | IPC_CREAT ) || die "$!"; + print "shm key $id\n"; Put this code in a separate file to be run in more than one process. Call the file F<take>: @@ -1339,8 +1339,8 @@ Call the file F<take>: # create a semaphore $IPC_KEY = 1234; - $key = semget($IPC_KEY, 0 , 0 ); - die if !defined($key); + $id = semget($IPC_KEY, 0 , 0 ); + die if !defined($id); $semnum = 0; $semflag = 0; @@ -1348,14 +1348,14 @@ Call the file F<take>: # 'take' semaphore # wait for semaphore to be zero $semop = 0; - $opstring1 = pack("sss", $semnum, $semop, $semflag); + $opstring1 = pack("s!s!s!", $semnum, $semop, $semflag); # Increment the semaphore count $semop = 1; - $opstring2 = pack("sss", $semnum, $semop, $semflag); + $opstring2 = pack("s!s!s!", $semnum, $semop, $semflag); $opstring = $opstring1 . $opstring2; - semop($key,$opstring) || die "$!"; + semop($id,$opstring) || die "$!"; Put this code in a separate file to be run in more than one process. Call this file F<give>: @@ -1365,22 +1365,53 @@ Call this file F<give>: # that the second process continues $IPC_KEY = 1234; - $key = semget($IPC_KEY, 0, 0); - die if !defined($key); + $id = semget($IPC_KEY, 0, 0); + die if !defined($id); $semnum = 0; $semflag = 0; # Decrement the semaphore count $semop = -1; - $opstring = pack("sss", $semnum, $semop, $semflag); + $opstring = pack("s!s!s!", $semnum, $semop, $semflag); - semop($key,$opstring) || die "$!"; + semop($id,$opstring) || die "$!"; The SysV IPC code above was written long ago, and it's definitely clunky looking. For a more modern look, see the IPC::SysV module which is included with Perl starting from Perl 5.005. +A small example demonstrating SysV message queues: + + use IPC::SysV qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU); + + my $id = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); + + my $sent = "message"; + my $type = 1234; + my $rcvd; + my $type_rcvd; + + if (defined $id) { + if (msgsnd($id, pack("l! a*", $type_sent, $sent), 0)) { + if (msgrcv($id, $rcvd, 60, 0, 0)) { + ($type_rcvd, $rcvd) = unpack("l! a*", $rcvd); + if ($rcvd eq $sent) { + print "okay\n"; + } else { + print "not okay\n"; + } + } else { + die "# msgrcv failed\n"; + } + } else { + die "# msgsnd failed\n"; + } + msgctl($id, IPC_RMID, 0) || die "# msgctl failed: $!\n"; + } else { + die "# msgget failed\n"; + } + =head1 NOTES Most of these routines quietly but politely return C<undef> when they diff --git a/pod/perlsec.pod b/pod/perlsec.pod index 40374870a1..4185e84803 100644 --- a/pod/perlsec.pod +++ b/pod/perlsec.pod @@ -32,17 +32,19 @@ program more secure than the corresponding C program. You may not use data derived from outside your program to affect something else outside your program--at least, not by accident. All command line arguments, environment variables, locale information (see -L<perllocale>), results of certain system calls (readdir, readlink, -the gecos field of getpw* calls), and all file input are marked as -"tainted". Tainted data may not be used directly or indirectly in any -command that invokes a sub-shell, nor in any command that modifies -files, directories, or processes. (B<Important exception>: If you pass -a list of arguments to either C<system> or C<exec>, the elements of -that list are B<NOT> checked for taintedness.) Any variable set -to a value derived from tainted data will itself be tainted, -even if it is logically impossible for the tainted data -to alter the variable. Because taintedness is associated with each -scalar value, some elements of an array can be tainted and others not. +L<perllocale>), results of certain system calls (readdir(), +readlink(), the variable of shmread(), the messages returned by +msgrcv(), the password, gcos and shell fields returned by the +getpwxxx() calls), and all file input are marked as "tainted". +Tainted data may not be used directly or indirectly in any command +that invokes a sub-shell, nor in any command that modifies files, +directories, or processes. (B<Important exception>: If you pass a list +of arguments to either C<system> or C<exec>, the elements of that list +are B<NOT> checked for taintedness.) Any variable set to a value +derived from tainted data will itself be tainted, even if it is +logically impossible for the tainted data to alter the variable. +Because taintedness is associated with each scalar value, some +elements of an array can be tainted and others not. For example: diff --git a/pod/perlthrtut.pod b/pod/perlthrtut.pod index 88849dd662..0314d9da6c 100644 --- a/pod/perlthrtut.pod +++ b/pod/perlthrtut.pod @@ -4,6 +4,14 @@ perlthrtut - tutorial on threads in Perl =head1 DESCRIPTION + WARNING: Threading is an experimental feature. Both the interface + and implementation are subject to change drastically. In fact, this + documentation describes the flavor of threads that was in version + 5.005. Perl 5.6.0 and later have the beginnings of support for + interpreter threads, which (when finished) is expected to be + significantly different from what is described here. The information + contained here may therefore soon be obsolete. Use at your own risk! + One of the most prominent new features of Perl 5.005 is the inclusion of threads. Threads make a number of things a lot easier, and are a very useful addition to your bag of programming tricks. @@ -470,7 +470,7 @@ PP(pp_die) GV *gv = gv_fetchmethod(stash, "PROPAGATE"); if (gv) { SV *file = sv_2mortal(newSVpv(CopFILE(PL_curcop),0)); - SV *line = sv_2mortal(newSViv(CopLINE(PL_curcop))); + SV *line = sv_2mortal(newSVuv(CopLINE(PL_curcop))); EXTEND(SP, 3); PUSHMARK(SP); PUSHs(error); @@ -864,9 +864,9 @@ PP(pp_dbmopen) PUSHs(sv); PUSHs(left); if (SvIV(right)) - PUSHs(sv_2mortal(newSViv(O_RDWR|O_CREAT))); + PUSHs(sv_2mortal(newSVuv(O_RDWR|O_CREAT))); else - PUSHs(sv_2mortal(newSViv(O_RDWR))); + PUSHs(sv_2mortal(newSVuv(O_RDWR))); PUSHs(right); PUTBACK; call_sv((SV*)GvCV(gv), G_SCALAR); @@ -877,7 +877,7 @@ PP(pp_dbmopen) PUSHMARK(SP); PUSHs(sv); PUSHs(left); - PUSHs(sv_2mortal(newSViv(O_RDONLY))); + PUSHs(sv_2mortal(newSVuv(O_RDONLY))); PUSHs(right); PUTBACK; call_sv((SV*)GvCV(gv), G_SCALAR); @@ -1793,9 +1793,9 @@ PP(pp_sysseek) #if LSEEKSIZE > IVSIZE XPUSHs(sv_2mortal(newSVnv((NV) offset))); #else - XPUSHs(sv_2mortal(newSViv((IV) offset))); + XPUSHs(sv_2mortal(newSViv(offset))); #endif - XPUSHs(sv_2mortal(newSViv((IV) whence))); + XPUSHs(sv_2mortal(newSViv(whence))); PUTBACK; ENTER; call_method("SEEK", G_SCALAR); @@ -1807,15 +1807,15 @@ PP(pp_sysseek) if (PL_op->op_type == OP_SEEK) PUSHs(boolSV(do_seek(gv, offset, whence))); else { - Off_t n = do_sysseek(gv, offset, whence); - if (n < 0) + Off_t sought = do_sysseek(gv, offset, whence); + if (sought < 0) PUSHs(&PL_sv_undef); else { - SV* sv = n ? + SV* sv = sought ? #if LSEEKSIZE > IVSIZE - newSVnv((NV)n) + newSVnv((NV)sought) #else - newSViv((IV)n) + newSViv(sought) #endif : newSVpvn(zero_but_true, ZBTLEN); PUSHs(sv_2mortal(sv)); @@ -2541,17 +2541,25 @@ PP(pp_stat) EXTEND_MORTAL(max); PUSHs(sv_2mortal(newSViv(PL_statcache.st_dev))); PUSHs(sv_2mortal(newSViv(PL_statcache.st_ino))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_mode))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_nlink))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_mode))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_nlink))); #if Uid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid))); #else +# if Uid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_uid))); +# endif #endif #if Gid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_gid))); #else +# if Gid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_gid))); +# endif #endif #ifdef USE_STAT_RDEV PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev))); @@ -2573,8 +2581,8 @@ PP(pp_stat) PUSHs(sv_2mortal(newSViv(PL_statcache.st_ctime))); #endif #ifdef USE_STAT_BLOCKS - PUSHs(sv_2mortal(newSViv(PL_statcache.st_blksize))); - PUSHs(sv_2mortal(newSViv(PL_statcache.st_blocks))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blksize))); + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blocks))); #else PUSHs(sv_2mortal(newSVpvn("", 0))); PUSHs(sv_2mortal(newSVpvn("", 0))); @@ -4801,7 +4809,11 @@ PP(pp_gpwent) PUSHs(sv = sv_newmortal()); if (pwent) { if (which == OP_GPWNAM) +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif else sv_setpv(sv, pwent->pw_name); } @@ -4823,13 +4835,24 @@ PP(pp_gpwent) sv_setpv(sv, pwent->pw_passwd); # endif #endif +#ifndef INCOMPLETE_TAINTS + /* passwd is tainted because user himself can diddle with it. */ + SvTAINTED_on(sv); +#endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_gid); - +#else + sv_setuv(sv, (UV)pwent->pw_gid); +#endif /* pw_change, pw_quota, and pw_age are mutually exclusive. */ PUSHs(sv = sv_mortalcopy(&PL_sv_no)); #ifdef PWCHANGE @@ -4868,6 +4891,10 @@ PP(pp_gpwent) PUSHs(sv = sv_mortalcopy(&PL_sv_no)); sv_setpv(sv, pwent->pw_shell); +#ifndef INCOMPLETE_TAINTS + /* pw_shell is tainted because user himself can diddle with it. */ + SvTAINTED_on(sv); +#endif #ifdef PWEXPIRE PUSHs(sv = sv_mortalcopy(&PL_sv_no)); @@ -541,6 +541,7 @@ PERL_CALLCONV SV* Perl_newSV(pTHX_ STRLEN len); PERL_CALLCONV OP* Perl_newSVREF(pTHX_ OP* o); PERL_CALLCONV OP* Perl_newSVOP(pTHX_ I32 type, I32 flags, SV* sv); PERL_CALLCONV SV* Perl_newSViv(pTHX_ IV i); +PERL_CALLCONV SV* Perl_newSVuv(pTHX_ UV u); PERL_CALLCONV SV* Perl_newSVnv(pTHX_ NV n); PERL_CALLCONV SV* Perl_newSVpv(pTHX_ const char* s, STRLEN len); PERL_CALLCONV SV* Perl_newSVpvn(pTHX_ const char* s, STRLEN len); @@ -4743,6 +4743,25 @@ Perl_newSViv(pTHX_ IV i) } /* +=for apidoc newSVuv + +Creates a new SV and copies an unsigned integer into it. +The reference count for the SV is set to 1. + +=cut +*/ + +SV * +Perl_newSVuv(pTHX_ UV u) +{ + register SV *sv; + + new_SV(sv); + sv_setuv(sv,u); + return sv; +} + +/* =for apidoc newRV_noinc Creates an RV wrapper for an SV. The reference count for the original diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index e2ffd76ff1..a4f3e3f367 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -23,8 +23,7 @@ BEGIN { # These constants are common to all tests. # Later the sem* tests will import more for themselves. -use IPC::SysV qw(IPC_PRIVATE IPC_NOWAIT IPC_STAT IPC_RMID - S_IRWXU S_IRWXG S_IRWXO S_IWGRP S_IROTH S_IWOTH); +use IPC::SysV qw(IPC_PRIVATE IPC_NOWAIT IPC_STAT IPC_RMID S_IRWXU); use strict; print "1..16\n"; @@ -55,12 +54,7 @@ EOM exit(1); }; -my $perm; - -$perm = S_IRWXU | S_IRWXG | S_IRWXO | S_IWGRP | S_IROTH | S_IWOTH - if $^O eq 'vmesa'; - -$perm = S_IRWXU | S_IRWXG | S_IRWXO unless defined $perm; +my $perm = S_IRWXU; if ($Config{'d_msgget'} eq 'define' && $Config{'d_msgctl'} eq 'define' && diff --git a/t/op/sysio.t b/t/op/sysio.t index 22e60e30fc..e43f850154 100755 --- a/t/op/sysio.t +++ b/t/op/sysio.t @@ -2,7 +2,7 @@ print "1..39\n"; -chdir('op') || die "sysio.t: cannot look for myself: $!"; +chdir('op') || chdir('t/op') || die "sysio.t: cannot look for myself: $!"; open(I, 'sysio.t') || die "sysio.t: cannot find myself: $!"; diff --git a/t/op/taint.t b/t/op/taint.t index 6a9537b057..c32a1c41fb 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -94,7 +94,7 @@ print PROG 'print "@ARGV\n"', "\n"; close PROG; my $echo = "$Invoke_Perl $ECHO"; -print "1..149\n"; +print "1..151\n"; # First, let's make sure that Perl is checking the dangerous # environment variables. Maybe they aren't set yet, so we'll @@ -547,14 +547,14 @@ else { my @getpwent = getpwent(); die "getpwent: $!\n" unless (@getpwent); test 142,( not tainted $getpwent[0] - and not tainted $getpwent[1] + and tainted $getpwent[1] and not tainted $getpwent[2] and not tainted $getpwent[3] and not tainted $getpwent[4] and not tainted $getpwent[5] - and tainted $getpwent[6] # gecos + and tainted $getpwent[6] # ge?cos and not tainted $getpwent[7] - and not tainted $getpwent[8]); + and tainted $getpwent[8]); # shell endpwent(); } else { for (142) { print "ok $_ # Skipped: getpwent() is not available\n" } @@ -605,3 +605,76 @@ else { $why =~ s/e/'-'.$$/ge; test 149, tainted $why; } + +# test shmread +{ + if ($Config{d_shm}) { + use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRWXU S_IRWXG S_IRWXO); + + my $sent = "foobar"; + my $rcvd; + my $size = 2000; + my $id = shmget(IPC_PRIVATE, $size, S_IRWXU|S_IRWXG|S_IRWXO) || + warn "# shmget failed: $!\n"; + if (defined $id) { + if (shmwrite($id, $sent, 0, 60)) { + if (shmread($id, $rcvd, 0, 60)) { + substr($rcvd, index($rcvd, "\0")) = ''; + } else { + warn "# shmread failed: $!\n"; + } + } else { + warn "# shmwrite failed: $!\n"; + } + shmctl($id, IPC_RMID, 0) || warn "# shmctl failed: $!\n"; + } else { + warn "# shmget failed: $!\n"; + } + + if ($rcvd eq $sent) { + test 150, tainted $rcvd; + } else { + print "ok 150 # Skipped: SysV shared memory operation failed\n"; + } + } else { + print "ok 150 # Skipped: SysV shared memory is not available\n"; + } +} + +# test msgrcv +{ + if ($Config{d_msg}) { + use IPC::SysV qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU); + + my $id = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); + + my $sent = "message"; + my $type_sent = 1234; + my $rcvd; + my $type_rcvd; + + if (defined $id) { + if (msgsnd($id, pack("l! a*", $type_sent, $sent), 0)) { + if (msgrcv($id, $rcvd, 60, 0, 0)) { + ($type_rcvd, $rcvd) = unpack("l! a*", $rcvd); + } else { + warn "# msgrcv failed\n"; + } + } else { + warn "# msgsnd failed\n"; + } + msgctl($id, IPC_RMID, 0) || warn "# msgctl failed: $!\n"; + } else { + warn "# msgget failed\n"; + } + + if ($rcvd eq $sent && $type_sent == $type_rcvd) { + test 151, tainted $rcvd; + } else { + print "ok 151 # Skipped: SysV message queue operation failed\n"; + } + } else { + print "ok 151 # Skipped: SysV message queues are not available\n"; + } +} + @@ -3278,7 +3278,7 @@ Perl_yylex(pTHX) /* This kludge not intended to be bulletproof. */ if (PL_tokenbuf[1] == '[' && !PL_tokenbuf[2]) { yylval.opval = newSVOP(OP_CONST, 0, - newSViv((IV)PL_compiling.cop_arybase)); + newSViv(PL_compiling.cop_arybase)); yylval.opval->op_private = OPpCONST_ARYBASE; TERM(THING); } diff --git a/vms/subconfigure.com b/vms/subconfigure.com index 8650b0f128..56de2786e7 100644 --- a/vms/subconfigure.com +++ b/vms/subconfigure.com @@ -74,10 +74,12 @@ $ perl_shmattype = "" $ perl_mmaptype = "" $ perl_gidformat = "lu" $ perl_gidsize = "4" +$ perl_gidsign = "1" $ perl_groupstype = "Gid_t" $ perl_stdio_stream_array = "" $ perl_uidformat = "lu" $ perl_uidsize = "4" +$ perl_uidsign = "1" $ perl_d_getcwd = "undef" $ perl_d_nv_preserves_uv = "define" $ perl_d_fs_data_s = "undef" @@ -4013,9 +4015,11 @@ $ WC "pager='" + perl_pager + "'" $ WC "uidtype='" + perl_uidtype + "'" $ WC "uidformat='" + perl_uidformat + "'" $ WC "uidsize='" + perl_uidsize + "'" +$ WC "uidsign='" + perl_uidsign + "'" $ WC "gidtype='" + perl_gidtype + "'" $ WC "gidformat='" + perl_gidformat + "'" $ WC "gidsize='" + perl_gidsize + "'" +$ WC "gidsign='" + perl_gidsign + "'" $ WC "usethreads='" + perl_usethreads + "'" $ WC "d_pthread_yield='" + perl_d_pthread_yield + "'" $ WC "d_pthreads_created_joinable='" + perl_d_pthreads_created_joinable + "'" diff --git a/vos/config.def b/vos/config.def index 10d44a272d..1352c0586e 100644 --- a/vos/config.def +++ b/vos/config.def @@ -286,6 +286,7 @@ $full_csh='' $full_sed='/system/ported/command_library/sed.pm' $gidformat='"d"' $gidsize='4' +$gidsign='-1' $gidtype='gid_t' $groupstype='gid_t' $i16size='2' @@ -439,6 +440,7 @@ $u8size='1' $u8type='unsigned char' $uidformat='"d"' $uidsize='4' +$uidsign='-1' $uidtype='uid_t' $uquadtype='_error_' $use5005threads='undef' diff --git a/vos/config.h b/vos/config.h index 55bb25f66a..d77218a06e 100644 --- a/vos/config.h +++ b/vos/config.h @@ -1129,7 +1129,7 @@ #define BIN_EXP "/system/ported/command_library" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always $undef * for those versions. @@ -2199,6 +2199,12 @@ */ #define Gid_t_f "d" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2208,19 +2214,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2847,6 +2853,12 @@ */ #define Uid_t_f "d" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/vos/config_h.SH_orig b/vos/config_h.SH_orig index 299c931298..b743847203 100755 --- a/vos/config_h.SH_orig +++ b/vos/config_h.SH_orig @@ -1147,7 +1147,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define BIN_EXP "$binexp" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always $undef * for those versions. @@ -2217,6 +2217,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Gid_t_f $gidformat /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign $gidsign /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2226,19 +2232,19 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t $gidtype /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t $groupstype /* Type for 2nd arg to [sg]etgroups() */ @@ -2819,6 +2825,11 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define SITELIB_EXP "$sitelibexp" /**/ #define SITELIB_STEM "$sitelib_stem" /**/ +/* Size_t_size: + * This symbol holds the size of a Size_t in bytes. + */ +#define Size_t_size $sizesize /* */ + /* Size_t: * This symbol holds the type used to declare length parameters * for string functions. It is usually size_t, but may be @@ -2860,6 +2871,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Uid_t_f $uidformat /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign $uidsign /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.bc b/win32/config_H.bc index 41e3a3cf23..7e48f29fca 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -1129,7 +1129,7 @@ #define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always undef * for those versions. @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "d" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "d" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.gc b/win32/config_H.gc index baf02fe5a8..e12856c909 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -1129,7 +1129,7 @@ #define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always undef * for those versions. @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "ld" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "ld" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.vc b/win32/config_H.vc index 028914d38a..8f4b183053 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -1129,7 +1129,7 @@ #define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: - * This symbol, if defined, indicates that Perl 5.006 should be + * This symbol, if defined, indicates that this version of Perl should be * binary-compatible with Perl 5.005. This is impossible for builds * that use features like threads and multiplicity it is always undef * for those versions. @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "ld" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get + * gid_t, etc... It may be necessary to include <sys/types.h> to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "ld" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ |