This file is indexed.

/usr/share/doc/lprng-doc/LPRng-Reference-Multipart/x8715.htm is in lprng-doc 3.8.A~rc2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org">

  <title>Rule Matching Procedures</title>
  <meta name="GENERATOR" content=
  "Modular DocBook HTML Stylesheet Version 1.79">
  <link rel="HOME" title=" LPRng Reference Manual" href=
  "index.htm">
  <link rel="UP" title="Permissions and Authentication " href=
  "permsref.htm">
  <link rel="PREVIOUS" title="Permissions and Authentication "
  href="permsref.htm">
  <link rel="NEXT" title="Permission File Location " href=
  "permspath.htm">
</head>

<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#840084" alink="#0000FF">
  <div class="NAVHEADER">
    <table summary="Header navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="3" align="center">LPRng Reference Manual: 24
        Sep 2004 (For LPRng-3.8.28)</th>
      </tr>

      <tr>
        <td width="10%" align="left" valign="bottom"><a href=
        "permsref.htm" accesskey="P">Prev</a></td>

        <td width="80%" align="center" valign="bottom">Chapter 17.
        Permissions and Authentication</td>

        <td width="10%" align="right" valign="bottom"><a href=
        "permspath.htm" accesskey="N">Next</a></td>
      </tr>
    </table>
    <hr align="left" width="100%">
  </div>

  <div class="SECT1">
    <h1 class="SECT1"><a name="AEN8715" id="AEN8715">17.2. Rule
    Matching Procedures</a></h1>

    <div class="INFORMALEXAMPLE">
      <a name="AEN8718" id="AEN8718"></a>
      <pre class="SCREEN">
[not] key                                 assigned value
[not] key=pattern                         substring match
[not] key=pattern1,pattern2,pattern3,...  glob and exact
[not] key=IP1/mask1,IP2/mask2,...         IP address
</pre>
    </div>

    <p>Each of the indicated values is matched against a list of
    patterns. The following types of matches are used:</p>

    <ol type="1">
      <li>
        <p>assigned value. The keyword has an assigned value which
        is true (match) or false (no match). Examples are SAMEHOST
        and SERVER.</p>
      </li>

      <li>
        <p>substring match. The indicated entry is present as a
        substring in the pattern.</p>
      </li>

      <li>
        <p>GLOB matches. The pattern is interpreted as a GLOB style
        pattern, where * matches 0 or more characters, and ?
        matches a single character, and <tt class=
        "LITERAL">[L-H]</tt> specifies a range of characters from
        <tt class="LITERAL">L</tt> to <tt class="LITERAL">H</tt>,
        in ASCII order.</p>
      </li>

      <li>
        <p>IP address match. The address must be specified in the
        standard <tt class="FILENAME">nn.nn.nn.nn</tt> format. The
        mask must be either an integer number corresponding to the
        number of significant bits, or in the standard <tt class=
        "FILENAME">nn.nn.nn.nn</tt> format. Addresses are compared
        by doing</p>

        <div class="INFORMALEXAMPLE">
          <a name="AEN8735" id="AEN8735"></a>
          <pre class="SCREEN">
( IPaddr XOR IP ) AND mask
</pre>
        </div>

        <p>If the result is 0, then a match results. Note that
        there may be one or more addresses being checked for; this
        can occur when a host may have multiple IP addresses
        assigned to it.</p>
      </li>

      <li>
        <p>integer range match. The pattern has the form <tt class=
        "LITERAL">low-high</tt>, where low and high are integer
        numbers. The match succeeds if the value is in the
        specified range.</p>
      </li>

      <li>
        <p>Same IP Address Match. This compares two lists of IP
        addresses; a match is found when there is one or more
        common addresses.</p>
      </li>
    </ol>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8743" id="AEN8743">17.2.1.
      DEFAULT</a></h2>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8746" id="AEN8746"></a>
        <pre class="SCREEN">
DEFAULT ACCEPT
DEFAULT REJECT
</pre>
      </div>

      <p>The DEFAULT rule specifies the default if no rule matches.
      Normally, there is one DEFAULT entry in a permissions
      file.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8749" id="AEN8749"></a>
        <pre class="SCREEN">
Example:

DEFAULT ACCEPT
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8751" id="AEN8751">17.2.2.
      SERVICE</a></h2>

      <p>Match type: substring</p>

      <p>The SERVICE key is based on the type of request.</p>

      <div class="INFORMALTABLE">
        <a name="AEN8755" id="AEN8755"></a>

        <table border="1" frame="border" rules="all" class=
        "CALSTABLE">
          <col>
          <col>

          <thead>
            <tr>
              <th>Key</th>

              <th>Request</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>Key</td>

              <td>Request</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">C</tt></td>

              <td>LPC Control Request</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">M</tt></td>

              <td><b class="APPLICATION">lprm</b> Removal
              Request</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">P</tt></td>

              <td>Printing</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">Q</tt></td>

              <td><b class="APPLICATION">lpq</b> Status
              Request</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">R</tt></td>

              <td><b class="APPLICATION">lpr</b> Job Transfer</td>
            </tr>

            <tr>
              <td><tt class="LITERAL">X</tt></td>

              <td>Connection Request</td>
            </tr>
          </tbody>
        </table>
      </div>

      <p>Each of the above codes corresponds either directly to the
      user command, or a set of subcommands.</p>

      <p>If you have an LPC request, you can add an <tt class=
      "LITERAL">LPC=xxx</tt> clause to refine the permissions
      checking to allow or disallow <b class="APPLICATION">lpc</b>
      commands such as <tt class="COMMAND">lpc status, printcap,
      active,</tt> .</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8797" id="AEN8797"></a>
        <pre class="SCREEN">
Example:

# control only from root on server
ACCEPT SERVICE=C SERVER USER=root
REJECT SERVICE=C
# accept all others
ACCEPT SERVICE=*
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8799" id="AEN8799">17.2.3.
      USER</a></h2>

      <p>Match type: GLOB</p>

      <p>The USER information is taken from the <tt class=
      "LITERAL">P</tt> (person or logname) information in the print
      job control file.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8804" id="AEN8804"></a>
        <pre class="SCREEN">
Example:

# we allow jobs to be spooled
ACCEPT SERVICE=R
# now we do the checking at print time
ACCEPT SERVICE=P USER=root
REJECT SERVICE=P
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8806" id="AEN8806">17.2.4.
      REMOTEUSER</a></h2>

      <p>Match type: GLOB</p>

      <p>The REMOTEUSER information is taken from the user
      information sent with a service request.</p>

      <p>Note that one of the flaws of <a href=
      "rfc1179.htm">RFC1179</a> is that an <b class=
      "APPLICATION">lpq</b> (print status) request does not provide
      a REMOTEUSER name.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8813" id="AEN8813"></a>
        <pre class="SCREEN">
Example:

ACCEPT SERVICE=C REMOTEUSER=root,papowell,admin SERVER
ACCEPT SERVICE=C LPC=status,lpd REMOTEUSER=admin
REJECT SERVICE=C
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8815" id="AEN8815">17.2.5.
      HOST</a></h2>

      <p>Match type: GLOB</p>

      <p>The <tt class="LITERAL">H</tt> (host) information in the
      print job control file is used to do a DNS lookup, and the
      resulting list of names and addresses is used for matching
      purposes.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8820" id="AEN8820"></a>
        <pre class="SCREEN">
Example:

# we allow jobs to be spooled
ACCEPT SERVICE=R
# now we do the checking at print time
# allow from our private subnet
ACCEPT SERVICE=P HOST=10.0.0.0/8,*.othernet.com
REJECT SERVICE=P
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8822" id="AEN8822">17.2.6.
      REMOTEHOST</a></h2>

      <p>Match type: GLOB</p>

      <p>The REMOTEHOST information is obtained by doing a reverse
      IP name lookup on the remote host IP address and the
      resulting list of names and addresses is used for matching
      purposes. If there is no FQDN available, then the IP address
      in text form will be used.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8826" id="AEN8826"></a>
        <pre class="SCREEN">
Example:

# allow from our private subnet
ACCEPT SERVICE=R REMOTEHOST=10.0.0.0/8,*.othernet.com
REJECT SERVICE=R
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8828" id="AEN8828">17.2.7.
      REMOTEPORT</a></h2>

      <p>Match type: integer range</p>

      <p>The REMOTEPORT value is the originating port of the TCP/IP
      connection. The match succeeds if it is in the specified
      range.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8832" id="AEN8832"></a>
        <pre class="SCREEN">
Example:

# require connections to originate from privileged port
ACCEPT SERVICE=X REMOTEPORT=1-1023
REJECT SERVICE=X
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8834" id="AEN8834">17.2.8.
      PORT</a></h2>

      <p>Alias for REMOTEPORT.</p>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8837" id="AEN8837">17.2.9.
      IP</a></h2>

      <p>Alias for HOST.</p>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8840" id="AEN8840">17.2.10.
      REMOTEIP</a></h2>

      <p>Alias for REMOTEHOST.</p>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8843" id="AEN8843">17.2.11.
      LPC</a></h2>

      <p>Match type: GLOB</p>

      <p>The requested <b class="APPLICATION">lpc</b> command. This
      allows the following permissions line to be used:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8848" id="AEN8848"></a>
        <pre class="SCREEN">
Example:

#allow remoteuser admin on server to use LPC topq and hold
ACCEPT SERVICE=C SERVER REMOTEUSER=root
ACCEPT LPC=topq,hold SERVER REMOTEUSER=papowell
REJECT SERVICE=C
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8850" id="AEN8850">17.2.12.
      SAMEUSER</a></h2>

      <p>Match type: exact string match</p>

      <p>Both the REMOTEUSER and USER information must be present
      and identical.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8854" id="AEN8854"></a>
        <pre class="SCREEN">
Example:

# LPC users can do anything
ACCEPT SERVICE=C SERVER REMOTEUSER=root
REJECT SERVICE=C
# allow users who sent jobs from the same host to remove them
ACCEPT SERVICE=M SAMEUSER SAMEHOST
REJECT SERVICE=M
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8856" id="AEN8856">17.2.13.
      SAMEHOST</a></h2>

      <p>Match type: Same IP Address</p>

      <p>The REMOTEHOST and HOST address lists are checked; if
      there is a common value the match succeeds.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8860" id="AEN8860"></a>
        <pre class="SCREEN">
Example:

# allow root on the same host as user
# to remove files
ACCEPT SERVICE=M SAMEHOST REMOTEUSER=root
REJECT SERVICE=M
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8862" id="AEN8862">17.2.14.
      SERVER</a></h2>

      <p>Match type: Matching IP Address</p>

      <p>One of the REMOTEHOST addresses must be the same as one of
      the addresses of the <b class="APPLICATION">lpd</b> server
      host, or must be one of the addresses found by looking up the
      <tt class="LITERAL">localhost</tt> name using <code class=
      "FUNCTION">gethostbyname()</code>.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8869" id="AEN8869"></a>
        <pre class="SCREEN">
Example:

# allow root on the server full LPC permissions
ACCEPT SERVICE=C SERVER REMOTEUSER=root
REJECT SERVICE=C
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8871" id="AEN8871">17.2.15.
      FORWARD</a></h2>

      <p>Match type: Address Match</p>

      <p>The list of REMOTEHOST and HOST addresses must not have a
      common entry. This is usually the case when a remote
      <b class="APPLICATION">lpd</b> server is forwarding jobs to
      the <b class="APPLICATION">lpd</b> server.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8877" id="AEN8877"></a>
        <pre class="SCREEN">
Example:

# do not accept forwarded jobs or requests
REJECT SERVICE=* FORWARD
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8879" id="AEN8879">17.2.16.
      GROUP</a></h2>

      <p>Match type: modified GLOB</p>

      <p>The USER must be present in one of the groups in
      <tt class="FILENAME">/etc/group</tt> or whatever permissions
      mechanism is used to determine group ownership which matches
      the GLOB pattern. If the pattern has the form <tt class=
      "LITERAL">@name</tt>, then a check to see if the user is in
      the named netgroup is done.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8885" id="AEN8885"></a>
        <pre class="SCREEN">
Example:

ACCEPT SERVICE=P GROUP=admin,@netgroup
REJECT SERVICE=P
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8887" id="AEN8887">17.2.17.
      REMOTEGROUP</a></h2>

      <p>The same rules as for GROUP, but using the REMOTEUSER
      value.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8890" id="AEN8890"></a>
        <pre class="SCREEN">
Example:

ACCEPT SERVICE=R REMOTEGROUP=admin,@netgroup
REJECT SERVICE=R
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8892" id="AEN8892">17.2.18.
      CONTROLLINE</a></h2>

      <p>Match type: GLOB</p>

      <p>A <acronym class="ACRONYM">CONTROLLINE</acronym> pattern
      has the form</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8897" id="AEN8897"></a>
        <pre class="SCREEN">
X=pattern1,pattern2,...
</pre>
      </div>

      <p>X is a single upper case letter. The corresponding line
      must be present in a control file, and the pattern is applied
      to the line contents.</p>

      <p>This pattern can be used to select only files with
      specific control file information for printing.</p>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8901" id="AEN8901">17.2.19.
      AUTH</a></h2>

      <p>Match type: value</p>

      <p>If the current transfer or the transfer used to send a job
      was authenticated, then AUTH is true or matches.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8905" id="AEN8905"></a>
        <pre class="SCREEN">
Example:

# reject all non-authenticated transfers
REJECT NOT AUTH
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8907" id="AEN8907">17.2.20.
      AUTHTYPE</a></h2>

      <p>Match type: glob</p>

      <p>If the current transfer or the transfer used to send a job
      was authenticated, then AUTHTYPE is set to the name of the
      authentication method.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8911" id="AEN8911"></a>
        <pre class="SCREEN">
Example:

# require kerberos, pgp, or md5 authentication
REJECT NOT AUTHTYPE=kerberos*,pgp,md5
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8913" id="AEN8913">17.2.21.
      AUTHUSER</a></h2>

      <p>Match type: GLOB</p>

      <p>The AUTHUSER rule will check to see if the authenticated
      user identification matches the pattern.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN8917" id="AEN8917"></a>
        <pre class="SCREEN">
Example:

ACCEPT SERVICE=C AUTHTYPE=kerberos* AUTHUSER=admin@ASTART.COM
</pre>
      </div>
    </div>

    <div class="SECT2">
      <h2 class="SECT2"><a name="AEN8919" id="AEN8919">17.2.22.
      IFIP</a></h2>

      <p>Match type: IPmatch, but for IPV6 as well as IPV4</p>

      <p>There is a subtle problem with names and IP addresses
      which are obtained for 'multi-homed hosts', i.e. - those with
      multiple ethernet interfaces, and for IPV6 (IP Version 6), in
      which a host can have multiple addresses, and for the normal
      host which can have both a short name and a fully qualified
      domain name.</p>

      <p>The IFIP (interface IP) field can be used to check the IP
      address of the interface that accepted the network
      connection, as reported by the information returned by the
      accept() system call. Note that this information may be IPV4
      or IPV6 information, depending on the origination of the
      system. This information is used by gethostbyaddr() to obtain
      the originating host fully qualified domain name (FQDN) and
      set of IP addresses. Note that this FQDN will be for the
      originating interface, and may not be the canonical host
      name. Some systems which use the Domain Name Server (DNS)
      system may add the canonical system name as an alias.</p>

      <p>This entry is deprecated and may not be supported in
      future releases.</p>
    </div>
  </div>

  <div class="NAVFOOTER">
    <hr align="left" width="100%">

    <table summary="Footer navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33%" align="left" valign="top"><a href=
        "permsref.htm" accesskey="P">Prev</a></td>

        <td width="34%" align="center" valign="top"><a href=
        "index.htm" accesskey="H">Home</a></td>

        <td width="33%" align="right" valign="top"><a href=
        "permspath.htm" accesskey="N">Next</a></td>
      </tr>

      <tr>
        <td width="33%" align="left" valign="top">Permissions and
        Authentication</td>

        <td width="34%" align="center" valign="top"><a href=
        "permsref.htm" accesskey="U">Up</a></td>

        <td width="33%" align="right" valign="top">Permission File
        Location</td>
      </tr>
    </table>
  </div>

  <p align="center"></p>
</body>
</html>