Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "Opcode 3" | |
132 | .TH Opcode 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide" | |
133 | .SH "NAME" | |
134 | Opcode \- Disable named opcodes when compiling perl code | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | .Vb 1 | |
138 | \& use Opcode; | |
139 | .Ve | |
140 | .SH "DESCRIPTION" | |
141 | .IX Header "DESCRIPTION" | |
142 | Perl code is always compiled into an internal format before execution. | |
143 | .PP | |
144 | Evaluating perl code (e.g. via \*(L"eval\*(R" or \*(L"do 'file'\*(R") causes | |
145 | the code to be compiled into an internal format and then, | |
146 | provided there was no error in the compilation, executed. | |
147 | The internal format is based on many distinct \fIopcodes\fR. | |
148 | .PP | |
149 | By default no opmask is in effect and any code can be compiled. | |
150 | .PP | |
151 | The Opcode module allow you to define an \fIoperator mask\fR to be in | |
152 | effect when perl \fInext\fR compiles any code. Attempting to compile code | |
153 | which contains a masked opcode will cause the compilation to fail | |
154 | with an error. The code will not be executed. | |
155 | .SH "NOTE" | |
156 | .IX Header "NOTE" | |
157 | The Opcode module is not usually used directly. See the ops pragma and | |
158 | Safe modules for more typical uses. | |
159 | .SH "WARNING" | |
160 | .IX Header "WARNING" | |
161 | The authors make \fBno warranty\fR, implied or otherwise, about the | |
162 | suitability of this software for safety or security purposes. | |
163 | .PP | |
164 | The authors shall not in any case be liable for special, incidental, | |
165 | consequential, indirect or other similar damages arising from the use | |
166 | of this software. | |
167 | .PP | |
168 | Your mileage will vary. If in any doubt \fBdo not use it\fR. | |
169 | .SH "Operator Names and Operator Lists" | |
170 | .IX Header "Operator Names and Operator Lists" | |
171 | The canonical list of operator names is the contents of the array | |
172 | PL_op_name defined and initialised in file \fIopcode.h\fR of the Perl | |
173 | source distribution (and installed into the perl library). | |
174 | .PP | |
175 | Each operator has both a terse name (its opname) and a more verbose or | |
176 | recognisable descriptive name. The opdesc function can be used to | |
177 | return a list of descriptions for a list of operators. | |
178 | .PP | |
179 | Many of the functions and methods listed below take a list of | |
180 | operators as parameters. Most operator lists can be made up of several | |
181 | types of element. Each element can be one of | |
182 | .IP "an operator name (opname)" 8 | |
183 | .IX Item "an operator name (opname)" | |
184 | Operator names are typically small lowercase words like enterloop, | |
185 | leaveloop, last, next, redo etc. Sometimes they are rather cryptic | |
186 | like gv2cv, i_ncmp and ftsvtx. | |
187 | .IP "an operator tag name (optag)" 8 | |
188 | .IX Item "an operator tag name (optag)" | |
189 | Operator tags can be used to refer to groups (or sets) of operators. | |
190 | Tag names always begin with a colon. The Opcode module defines several | |
191 | optags and the user can define others using the define_optag function. | |
192 | .IP "a negated opname or optag" 8 | |
193 | .IX Item "a negated opname or optag" | |
194 | An opname or optag can be prefixed with an exclamation mark, e.g., !mkdir. | |
195 | Negating an opname or optag means remove the corresponding ops from the | |
196 | accumulated set of ops at that point. | |
197 | .IP "an operator set (opset)" 8 | |
198 | .IX Item "an operator set (opset)" | |
199 | An \fIopset\fR as a binary string of approximately 44 bytes which holds a | |
200 | set or zero or more operators. | |
201 | .Sp | |
202 | The opset and opset_to_ops functions can be used to convert from | |
203 | a list of operators to an opset and \fIvice versa\fR. | |
204 | .Sp | |
205 | Wherever a list of operators can be given you can use one or more opsets. | |
206 | See also Manipulating Opsets below. | |
207 | .SH "Opcode Functions" | |
208 | .IX Header "Opcode Functions" | |
209 | The Opcode package contains functions for manipulating operator names | |
210 | tags and sets. All are available for export by the package. | |
211 | .IP "opcodes" 8 | |
212 | .IX Item "opcodes" | |
213 | In a scalar context opcodes returns the number of opcodes in this | |
214 | version of perl (around 350 for perl\-5.7.0). | |
215 | .Sp | |
216 | In a list context it returns a list of all the operator names. | |
217 | (Not yet implemented, use \f(CW@names\fR = opset_to_ops(full_opset).) | |
218 | .IP "opset (\s-1OP\s0, ...)" 8 | |
219 | .IX Item "opset (OP, ...)" | |
220 | Returns an opset containing the listed operators. | |
221 | .IP "opset_to_ops (\s-1OPSET\s0)" 8 | |
222 | .IX Item "opset_to_ops (OPSET)" | |
223 | Returns a list of operator names corresponding to those operators in | |
224 | the set. | |
225 | .IP "opset_to_hex (\s-1OPSET\s0)" 8 | |
226 | .IX Item "opset_to_hex (OPSET)" | |
227 | Returns a string representation of an opset. Can be handy for debugging. | |
228 | .IP "full_opset" 8 | |
229 | .IX Item "full_opset" | |
230 | Returns an opset which includes all operators. | |
231 | .IP "empty_opset" 8 | |
232 | .IX Item "empty_opset" | |
233 | Returns an opset which contains no operators. | |
234 | .IP "invert_opset (\s-1OPSET\s0)" 8 | |
235 | .IX Item "invert_opset (OPSET)" | |
236 | Returns an opset which is the inverse set of the one supplied. | |
237 | .IP "verify_opset (\s-1OPSET\s0, ...)" 8 | |
238 | .IX Item "verify_opset (OPSET, ...)" | |
239 | Returns true if the supplied opset looks like a valid opset (is the | |
240 | right length etc) otherwise it returns false. If an optional second | |
241 | parameter is true then verify_opset will croak on an invalid opset | |
242 | instead of returning false. | |
243 | .Sp | |
244 | Most of the other Opcode functions call verify_opset automatically | |
245 | and will croak if given an invalid opset. | |
246 | .IP "define_optag (\s-1OPTAG\s0, \s-1OPSET\s0)" 8 | |
247 | .IX Item "define_optag (OPTAG, OPSET)" | |
248 | Define \s-1OPTAG\s0 as a symbolic name for \s-1OPSET\s0. Optag names always start | |
249 | with a colon \f(CW\*(C`:\*(C'\fR. | |
250 | .Sp | |
251 | The optag name used must not be defined already (define_optag will | |
252 | croak if it is already defined). Optag names are global to the perl | |
253 | process and optag definitions cannot be altered or deleted once | |
254 | defined. | |
255 | .Sp | |
256 | It is strongly recommended that applications using Opcode should use a | |
257 | leading capital letter on their tag names since lowercase names are | |
258 | reserved for use by the Opcode module. If using Opcode within a module | |
259 | you should prefix your tags names with the name of your module to | |
260 | ensure uniqueness and thus avoid clashes with other modules. | |
261 | .IP "opmask_add (\s-1OPSET\s0)" 8 | |
262 | .IX Item "opmask_add (OPSET)" | |
263 | Adds the supplied opset to the current opmask. Note that there is | |
264 | currently \fIno\fR mechanism for unmasking ops once they have been masked. | |
265 | This is intentional. | |
266 | .IP "opmask" 8 | |
267 | .IX Item "opmask" | |
268 | Returns an opset corresponding to the current opmask. | |
269 | .IP "opdesc (\s-1OP\s0, ...)" 8 | |
270 | .IX Item "opdesc (OP, ...)" | |
271 | This takes a list of operator names and returns the corresponding list | |
272 | of operator descriptions. | |
273 | .IP "opdump (\s-1PAT\s0)" 8 | |
274 | .IX Item "opdump (PAT)" | |
275 | Dumps to \s-1STDOUT\s0 a two column list of op names and op descriptions. | |
276 | If an optional pattern is given then only lines which match the | |
277 | (case insensitive) pattern will be output. | |
278 | .Sp | |
279 | It's designed to be used as a handy command line utility: | |
280 | .Sp | |
281 | .Vb 2 | |
282 | \& perl -MOpcode=opdump -e opdump | |
283 | \& perl -MOpcode=opdump -e 'opdump Eval' | |
284 | .Ve | |
285 | .SH "Manipulating Opsets" | |
286 | .IX Header "Manipulating Opsets" | |
287 | Opsets may be manipulated using the perl bit vector operators & (and), | (or), | |
288 | ^ (xor) and ~ (negate/invert). | |
289 | .PP | |
290 | However you should never rely on the numerical position of any opcode | |
291 | within the opset. In other words both sides of a bit vector operator | |
292 | should be opsets returned from Opcode functions. | |
293 | .PP | |
294 | Also, since the number of opcodes in your current version of perl might | |
295 | not be an exact multiple of eight, there may be unused bits in the last | |
296 | byte of an upset. This should not cause any problems (Opcode functions | |
297 | ignore those extra bits) but it does mean that using the ~ operator | |
298 | will typically not produce the same 'physical' opset 'string' as the | |
299 | invert_opset function. | |
300 | .SH "TO DO (maybe)" | |
301 | .IX Header "TO DO (maybe)" | |
302 | .Vb 1 | |
303 | \& $bool = opset_eq($opset1, $opset2) true if opsets are logically eqiv | |
304 | .Ve | |
305 | .PP | |
306 | .Vb 1 | |
307 | \& $yes = opset_can($opset, @ops) true if $opset has all @ops set | |
308 | .Ve | |
309 | .PP | |
310 | .Vb 1 | |
311 | \& @diff = opset_diff($opset1, $opset2) => ('foo', '!bar', ...) | |
312 | .Ve | |
313 | .SH "Predefined Opcode Tags" | |
314 | .IX Header "Predefined Opcode Tags" | |
315 | .IP ":base_core" 5 | |
316 | .IX Item ":base_core" | |
317 | .Vb 1 | |
318 | \& null stub scalar pushmark wantarray const defined undef | |
319 | .Ve | |
320 | .Sp | |
321 | .Vb 1 | |
322 | \& rv2sv sassign | |
323 | .Ve | |
324 | .Sp | |
325 | .Vb 1 | |
326 | \& rv2av aassign aelem aelemfast aslice av2arylen | |
327 | .Ve | |
328 | .Sp | |
329 | .Vb 1 | |
330 | \& rv2hv helem hslice each values keys exists delete | |
331 | .Ve | |
332 | .Sp | |
333 | .Vb 3 | |
334 | \& preinc i_preinc predec i_predec postinc i_postinc postdec i_postdec | |
335 | \& int hex oct abs pow multiply i_multiply divide i_divide | |
336 | \& modulo i_modulo add i_add subtract i_subtract | |
337 | .Ve | |
338 | .Sp | |
339 | .Vb 2 | |
340 | \& left_shift right_shift bit_and bit_xor bit_or negate i_negate | |
341 | \& not complement | |
342 | .Ve | |
343 | .Sp | |
344 | .Vb 2 | |
345 | \& lt i_lt gt i_gt le i_le ge i_ge eq i_eq ne i_ne ncmp i_ncmp | |
346 | \& slt sgt sle sge seq sne scmp | |
347 | .Ve | |
348 | .Sp | |
349 | .Vb 1 | |
350 | \& substr vec stringify study pos length index rindex ord chr | |
351 | .Ve | |
352 | .Sp | |
353 | .Vb 1 | |
354 | \& ucfirst lcfirst uc lc quotemeta trans chop schop chomp schomp | |
355 | .Ve | |
356 | .Sp | |
357 | .Vb 1 | |
358 | \& match split qr | |
359 | .Ve | |
360 | .Sp | |
361 | .Vb 1 | |
362 | \& list lslice splice push pop shift unshift reverse | |
363 | .Ve | |
364 | .Sp | |
365 | .Vb 1 | |
366 | \& cond_expr flip flop andassign orassign and or xor | |
367 | .Ve | |
368 | .Sp | |
369 | .Vb 1 | |
370 | \& warn die lineseq nextstate scope enter leave setstate | |
371 | .Ve | |
372 | .Sp | |
373 | .Vb 1 | |
374 | \& rv2cv anoncode prototype | |
375 | .Ve | |
376 | .Sp | |
377 | .Vb 1 | |
378 | \& entersub leavesub leavesublv return method method_named -- XXX loops via recursion? | |
379 | .Ve | |
380 | .Sp | |
381 | .Vb 1 | |
382 | \& leaveeval -- needed for Safe to operate, is safe without entereval | |
383 | .Ve | |
384 | .IP ":base_mem" 5 | |
385 | .IX Item ":base_mem" | |
386 | These memory related ops are not included in :base_core because they | |
387 | can easily be used to implement a resource attack (e.g., consume all | |
388 | available memory). | |
389 | .Sp | |
390 | .Vb 1 | |
391 | \& concat repeat join range | |
392 | .Ve | |
393 | .Sp | |
394 | .Vb 1 | |
395 | \& anonlist anonhash | |
396 | .Ve | |
397 | .Sp | |
398 | Note that despite the existence of this optag a memory resource attack | |
399 | may still be possible using only :base_core ops. | |
400 | .Sp | |
401 | Disabling these ops is a \fIvery\fR heavy handed way to attempt to prevent | |
402 | a memory resource attack. It's probable that a specific memory limit | |
403 | mechanism will be added to perl in the near future. | |
404 | .IP ":base_loop" 5 | |
405 | .IX Item ":base_loop" | |
406 | These loop ops are not included in :base_core because they can easily be | |
407 | used to implement a resource attack (e.g., consume all available \s-1CPU\s0 time). | |
408 | .Sp | |
409 | .Vb 6 | |
410 | \& grepstart grepwhile | |
411 | \& mapstart mapwhile | |
412 | \& enteriter iter | |
413 | \& enterloop leaveloop unstack | |
414 | \& last next redo | |
415 | \& goto | |
416 | .Ve | |
417 | .IP ":base_io" 5 | |
418 | .IX Item ":base_io" | |
419 | These ops enable \fIfilehandle\fR (rather than filename) based input and | |
420 | output. These are safe on the assumption that only pre-existing | |
421 | filehandles are available for use. To create new filehandles other ops | |
422 | such as open would need to be enabled. | |
423 | .Sp | |
424 | .Vb 1 | |
425 | \& readline rcatline getc read | |
426 | .Ve | |
427 | .Sp | |
428 | .Vb 1 | |
429 | \& formline enterwrite leavewrite | |
430 | .Ve | |
431 | .Sp | |
432 | .Vb 1 | |
433 | \& print sysread syswrite send recv | |
434 | .Ve | |
435 | .Sp | |
436 | .Vb 1 | |
437 | \& eof tell seek sysseek | |
438 | .Ve | |
439 | .Sp | |
440 | .Vb 1 | |
441 | \& readdir telldir seekdir rewinddir | |
442 | .Ve | |
443 | .IP ":base_orig" 5 | |
444 | .IX Item ":base_orig" | |
445 | These are a hotchpotch of opcodes still waiting to be considered | |
446 | .Sp | |
447 | .Vb 1 | |
448 | \& gvsv gv gelem | |
449 | .Ve | |
450 | .Sp | |
451 | .Vb 1 | |
452 | \& padsv padav padhv padany | |
453 | .Ve | |
454 | .Sp | |
455 | .Vb 1 | |
456 | \& rv2gv refgen srefgen ref | |
457 | .Ve | |
458 | .Sp | |
459 | .Vb 1 | |
460 | \& bless -- could be used to change ownership of objects (reblessing) | |
461 | .Ve | |
462 | .Sp | |
463 | .Vb 1 | |
464 | \& pushre regcmaybe regcreset regcomp subst substcont | |
465 | .Ve | |
466 | .Sp | |
467 | .Vb 1 | |
468 | \& sprintf prtf -- can core dump | |
469 | .Ve | |
470 | .Sp | |
471 | .Vb 1 | |
472 | \& crypt | |
473 | .Ve | |
474 | .Sp | |
475 | .Vb 1 | |
476 | \& tie untie | |
477 | .Ve | |
478 | .Sp | |
479 | .Vb 3 | |
480 | \& dbmopen dbmclose | |
481 | \& sselect select | |
482 | \& pipe_op sockpair | |
483 | .Ve | |
484 | .Sp | |
485 | .Vb 1 | |
486 | \& getppid getpgrp setpgrp getpriority setpriority localtime gmtime | |
487 | .Ve | |
488 | .Sp | |
489 | .Vb 1 | |
490 | \& entertry leavetry -- can be used to 'hide' fatal errors | |
491 | .Ve | |
492 | .Sp | |
493 | .Vb 1 | |
494 | \& custom -- where should this go | |
495 | .Ve | |
496 | .IP ":base_math" 5 | |
497 | .IX Item ":base_math" | |
498 | These ops are not included in :base_core because of the risk of them being | |
499 | used to generate floating point exceptions (which would have to be caught | |
500 | using a \f(CW$SIG\fR{\s-1FPE\s0} handler). | |
501 | .Sp | |
502 | .Vb 1 | |
503 | \& atan2 sin cos exp log sqrt | |
504 | .Ve | |
505 | .Sp | |
506 | These ops are not included in :base_core because they have an effect | |
507 | beyond the scope of the compartment. | |
508 | .Sp | |
509 | .Vb 1 | |
510 | \& rand srand | |
511 | .Ve | |
512 | .IP ":base_thread" 5 | |
513 | .IX Item ":base_thread" | |
514 | These ops are related to multi\-threading. | |
515 | .Sp | |
516 | .Vb 1 | |
517 | \& lock threadsv | |
518 | .Ve | |
519 | .IP ":default" 5 | |
520 | .IX Item ":default" | |
521 | A handy tag name for a \fIreasonable\fR default set of ops. (The current ops | |
522 | allowed are unstable while development continues. It will change.) | |
523 | .Sp | |
524 | .Vb 1 | |
525 | \& :base_core :base_mem :base_loop :base_io :base_orig :base_thread | |
526 | .Ve | |
527 | .Sp | |
528 | If safety matters to you (and why else would you be using the Opcode module?) | |
529 | then you should not rely on the definition of this, or indeed any other, optag! | |
530 | .IP ":filesys_read" 5 | |
531 | .IX Item ":filesys_read" | |
532 | .Vb 1 | |
533 | \& stat lstat readlink | |
534 | .Ve | |
535 | .Sp | |
536 | .Vb 3 | |
537 | \& ftatime ftblk ftchr ftctime ftdir fteexec fteowned fteread | |
538 | \& ftewrite ftfile ftis ftlink ftmtime ftpipe ftrexec ftrowned | |
539 | \& ftrread ftsgid ftsize ftsock ftsuid fttty ftzero ftrwrite ftsvtx | |
540 | .Ve | |
541 | .Sp | |
542 | .Vb 1 | |
543 | \& fttext ftbinary | |
544 | .Ve | |
545 | .Sp | |
546 | .Vb 1 | |
547 | \& fileno | |
548 | .Ve | |
549 | .IP ":sys_db" 5 | |
550 | .IX Item ":sys_db" | |
551 | .Vb 4 | |
552 | \& ghbyname ghbyaddr ghostent shostent ehostent -- hosts | |
553 | \& gnbyname gnbyaddr gnetent snetent enetent -- networks | |
554 | \& gpbyname gpbynumber gprotoent sprotoent eprotoent -- protocols | |
555 | \& gsbyname gsbyport gservent sservent eservent -- services | |
556 | .Ve | |
557 | .Sp | |
558 | .Vb 2 | |
559 | \& gpwnam gpwuid gpwent spwent epwent getlogin -- users | |
560 | \& ggrnam ggrgid ggrent sgrent egrent -- groups | |
561 | .Ve | |
562 | .IP ":browse" 5 | |
563 | .IX Item ":browse" | |
564 | A handy tag name for a \fIreasonable\fR default set of ops beyond the | |
565 | :default optag. Like :default (and indeed all the other optags) its | |
566 | current definition is unstable while development continues. It will change. | |
567 | .Sp | |
568 | The :browse tag represents the next step beyond :default. It it a | |
569 | superset of the :default ops and adds :filesys_read the :sys_db. | |
570 | The intent being that scripts can access more (possibly sensitive) | |
571 | information about your system but not be able to change it. | |
572 | .Sp | |
573 | .Vb 1 | |
574 | \& :default :filesys_read :sys_db | |
575 | .Ve | |
576 | .IP ":filesys_open" 5 | |
577 | .IX Item ":filesys_open" | |
578 | .Vb 2 | |
579 | \& sysopen open close | |
580 | \& umask binmode | |
581 | .Ve | |
582 | .Sp | |
583 | .Vb 1 | |
584 | \& open_dir closedir -- other dir ops are in :base_io | |
585 | .Ve | |
586 | .IP ":filesys_write" 5 | |
587 | .IX Item ":filesys_write" | |
588 | .Vb 1 | |
589 | \& link unlink rename symlink truncate | |
590 | .Ve | |
591 | .Sp | |
592 | .Vb 1 | |
593 | \& mkdir rmdir | |
594 | .Ve | |
595 | .Sp | |
596 | .Vb 1 | |
597 | \& utime chmod chown | |
598 | .Ve | |
599 | .Sp | |
600 | .Vb 1 | |
601 | \& fcntl -- not strictly filesys related, but possibly as dangerous? | |
602 | .Ve | |
603 | .IP ":subprocess" 5 | |
604 | .IX Item ":subprocess" | |
605 | .Vb 1 | |
606 | \& backtick system | |
607 | .Ve | |
608 | .Sp | |
609 | .Vb 1 | |
610 | \& fork | |
611 | .Ve | |
612 | .Sp | |
613 | .Vb 1 | |
614 | \& wait waitpid | |
615 | .Ve | |
616 | .Sp | |
617 | .Vb 1 | |
618 | \& glob -- access to Cshell via <`rm *`> | |
619 | .Ve | |
620 | .IP ":ownprocess" 5 | |
621 | .IX Item ":ownprocess" | |
622 | .Vb 1 | |
623 | \& exec exit kill | |
624 | .Ve | |
625 | .Sp | |
626 | .Vb 1 | |
627 | \& time tms -- could be used for timing attacks (paranoid?) | |
628 | .Ve | |
629 | .IP ":others" 5 | |
630 | .IX Item ":others" | |
631 | This tag holds groups of assorted specialist opcodes that don't warrant | |
632 | having optags defined for them. | |
633 | .Sp | |
634 | SystemV Interprocess Communications: | |
635 | .Sp | |
636 | .Vb 1 | |
637 | \& msgctl msgget msgrcv msgsnd | |
638 | .Ve | |
639 | .Sp | |
640 | .Vb 1 | |
641 | \& semctl semget semop | |
642 | .Ve | |
643 | .Sp | |
644 | .Vb 1 | |
645 | \& shmctl shmget shmread shmwrite | |
646 | .Ve | |
647 | .IP ":still_to_be_decided" 5 | |
648 | .IX Item ":still_to_be_decided" | |
649 | .Vb 2 | |
650 | \& chdir | |
651 | \& flock ioctl | |
652 | .Ve | |
653 | .Sp | |
654 | .Vb 2 | |
655 | \& socket getpeername ssockopt | |
656 | \& bind connect listen accept shutdown gsockopt getsockname | |
657 | .Ve | |
658 | .Sp | |
659 | .Vb 4 | |
660 | \& sleep alarm -- changes global timer state and signal handling | |
661 | \& sort -- assorted problems including core dumps | |
662 | \& tied -- can be used to access object implementing a tie | |
663 | \& pack unpack -- can be used to create/use memory pointers | |
664 | .Ve | |
665 | .Sp | |
666 | .Vb 2 | |
667 | \& entereval -- can be used to hide code from initial compile | |
668 | \& require dofile | |
669 | .Ve | |
670 | .Sp | |
671 | .Vb 1 | |
672 | \& caller -- get info about calling environment and args | |
673 | .Ve | |
674 | .Sp | |
675 | .Vb 1 | |
676 | \& reset | |
677 | .Ve | |
678 | .Sp | |
679 | .Vb 1 | |
680 | \& dbstate -- perl -d version of nextstate(ment) opcode | |
681 | .Ve | |
682 | .IP ":dangerous" 5 | |
683 | .IX Item ":dangerous" | |
684 | This tag is simply a bucket for opcodes that are unlikely to be used via | |
685 | a tag name but need to be tagged for completeness and documentation. | |
686 | .Sp | |
687 | .Vb 1 | |
688 | \& syscall dump chroot | |
689 | .Ve | |
690 | .SH "SEE ALSO" | |
691 | .IX Header "SEE ALSO" | |
692 | \&\fIops\fR\|(3) \*(-- perl pragma interface to Opcode module. | |
693 | .PP | |
694 | \&\fISafe\fR\|(3) \*(-- Opcode and namespace limited execution compartments | |
695 | .SH "AUTHORS" | |
696 | .IX Header "AUTHORS" | |
697 | Originally designed and implemented by Malcolm Beattie, | |
698 | mbeattie@sable.ox.ac.uk as part of Safe version 1. | |
699 | .PP | |
700 | Split out from Safe module version 1, named opcode tags and other | |
701 | changes added by Tim Bunce. |