← Documents Documentation/filesystems/afs.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

kAFS: AFS Filesystem

AFS cell·volume·mountpoint·RxRPC key와 @sys 치환의 전문 번역입니다.

Source pathDocumentation/filesystems/afs.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

afs.rst:1-251

kAFS는 RxRPC와 Kerberos key를 이용해 AFS cell의 volume을 mount하고, special mountpoint·dynamic root·FS-Cache·`@sys` substitution을 제공합니다.

kAFS 구성 계층
RxRPC transport와 RXKAD security`rootcell=` 및 VL server database`#`/`%` volume selector와 automountsession keyring의 `afs@<cellname>` keyAFS file I/O와 FS-Cache

cell 등록부터 authenticated volume access까지의 관계입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ====================
4 kAFS: AFS FILESYSTEM
5 ====================
6
7 .. Contents:
8
9 - Overview.
10 - Usage.
11 - Mountpoints.
12 - Dynamic root.
13 - Proc filesystem.
14 - The cell database.
15 - Security.
16 - The @sys substitution.
17
18
19 Overview
20 ========
21
22 This filesystem provides a fairly simple secure AFS filesystem driver. It is
23 under development and does not yet provide the full feature set. The features
24 it does support include:
25
26 (*) Security (currently only AFS kaserver and KerberosIV tickets).
27
28 (*) File reading and writing.
29
30 (*) Automounting.
31
32 (*) Local caching (via fscache).
33
34 It does not yet support the following AFS features:
35
36 (*) pioctl() system call.
37
38
39 Compilation
40 ===========
41
42 The filesystem should be enabled by turning on the kernel configuration
43 options::
44
45 CONFIG_AF_RXRPC - The RxRPC protocol transport
46 CONFIG_RXKAD - The RxRPC Kerberos security handler
47 CONFIG_AFS_FS - The AFS filesystem
48
49 Additionally, the following can be turned on to aid debugging::
50
51 CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled
52 CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled
53
54 They permit the debugging messages to be turned on dynamically by manipulating
55 the masks in the following files::
56
57 /sys/module/af_rxrpc/parameters/debug
58 /sys/module/kafs/parameters/debug
59
60
61 Usage
62 =====
63
64 When inserting the driver modules the root cell must be specified along with a
65 list of volume location server IP addresses::
66
67 modprobe rxrpc
68 modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
69
70 The first module is the AF_RXRPC network protocol driver. This provides the
71 RxRPC remote operation protocol and may also be accessed from userspace. See:
72
73 Documentation/networking/rxrpc.rst
74
75 The second module is the kerberos RxRPC security driver, and the third module
76 is the actual filesystem driver for the AFS filesystem.
77
78 Once the module has been loaded, more modules can be added by the following
79 procedure::
80
81 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
82
83 Where the parameters to the "add" command are the name of a cell and a list of
84 volume location servers within that cell, with the latter separated by colons.
85
86 Filesystems can be mounted anywhere by commands similar to the following::
87
88 mount -t afs "%cambridge.redhat.com:root.afs." /afs
89 mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge
90 mount -t afs "#root.afs." /afs
91 mount -t afs "#root.cell." /afs/cambridge
92
93 Where the initial character is either a hash or a percent symbol depending on
94 whether you definitely want a R/W volume (percent) or whether you'd prefer a
95 R/O volume, but are willing to use a R/W volume instead (hash).
96
97 The name of the volume can be suffixes with ".backup" or ".readonly" to
98 specify connection to only volumes of those types.
99
100 The name of the cell is optional, and if not given during a mount, then the
101 named volume will be looked up in the cell specified during modprobe.
102
103 Additional cells can be added through /proc (see later section).
104
105
106 Mountpoints
107 ===========
108
109 AFS has a concept of mountpoints. In AFS terms, these are specially formatted
110 symbolic links (of the same form as the "device name" passed to mount). kAFS
111 presents these to the user as directories that have a follow-link capability
112 (i.e.: symbolic link semantics). If anyone attempts to access them, they will
113 automatically cause the target volume to be mounted (if possible) on that site.
114
115 Automatically mounted filesystems will be automatically unmounted approximately
116 twenty minutes after they were last used. Alternatively they can be unmounted
117 directly with the umount() system call.
118
119 Manually unmounting an AFS volume will cause any idle submounts upon it to be
120 culled first. If all are culled, then the requested volume will also be
121 unmounted, otherwise error EBUSY will be returned.
122
123 This can be used by the administrator to attempt to unmount the whole AFS tree
124 mounted on /afs in one go by doing::
125
126 umount /afs
127
128
129 Dynamic Root
130 ============
131
132 A mount option is available to create a serverless mount that is only usable
133 for dynamic lookup. Creating such a mount can be done by, for example::
134
135 mount -t afs none /afs -o dyn
136
137 This creates a mount that just has an empty directory at the root. Attempting
138 to look up a name in this directory will cause a mountpoint to be created that
139 looks up a cell of the same name, for example::
140
141 ls /afs/grand.central.org/
142
143
144 Proc Filesystem
145 ===============
146
147 The AFS module creates a "/proc/fs/afs/" directory and populates it:
148
149 (*) A "cells" file that lists cells currently known to the afs module and
150 their usage counts::
151
152 [root@andromeda ~]# cat /proc/fs/afs/cells
153 USE NAME
154 3 cambridge.redhat.com
155
156 (*) A directory per cell that contains files that list volume location
157 servers, volumes, and active servers known within that cell::
158
159 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
160 USE ADDR STATE
161 4 172.16.18.91 0
162 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers
163 ADDRESS
164 172.16.18.91
165 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes
166 USE STT VLID[0] VLID[1] VLID[2] NAME
167 1 Val 20000000 20000001 20000002 root.afs
168
169
170 The Cell Database
171 =================
172
173 The filesystem maintains an internal database of all the cells it knows and the
174 IP addresses of the volume location servers for those cells. The cell to which
175 the system belongs is added to the database when modprobe is performed by the
176 "rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
177 the kernel command line.
178
179 Further cells can be added by commands similar to the following::
180
181 echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells
182 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
183
184 No other cell database operations are available at this time.
185
186
187 Security
188 ========
189
190 Secure operations are initiated by acquiring a key using the klog program. A
191 very primitive klog program is available at:
192
193 https://people.redhat.com/~dhowells/rxrpc/klog.c
194
195 This should be compiled by::
196
197 make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"
198
199 And then run as::
200
201 ./klog
202
203 Assuming it's successful, this adds a key of type RxRPC, named for the service
204 and cell, e.g.: "afs@<cellname>". This can be viewed with the keyctl program or
205 by cat'ing /proc/keys::
206
207 [root@andromeda ~]# keyctl show
208 Session Keyring
209 -3 --alswrv 0 0 keyring: _ses.3268
210 2 --alswrv 0 0 \_ keyring: _uid.0
211 111416553 --als--v 0 0 \_ rxrpc: [email protected]
212
213 Currently the username, realm, password and proposed ticket lifetime are
214 compiled into the program.
215
216 It is not required to acquire a key before using AFS facilities, but if one is
217 not acquired then all operations will be governed by the anonymous user parts
218 of the ACLs.
219
220 If a key is acquired, then all AFS operations, including mounts and automounts,
221 made by a possessor of that key will be secured with that key.
222
223 If a file is opened with a particular key and then the file descriptor is
224 passed to a process that doesn't have that key (perhaps over an AF_UNIX
225 socket), then the operations on the file will be made with key that was used to
226 open the file.
227
228
229 The @sys Substitution
230 =====================
231
232 The list of up to 16 @sys substitutions for the current network namespace can
233 be configured by writing a list to /proc/fs/afs/sysname::
234
235 [root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname
236
237 or cleared entirely by writing an empty list::
238
239 [root@andromeda ~]# echo >/proc/fs/afs/sysname
240
241 The current list for current network namespace can be retrieved by::
242
243 [root@andromeda ~]# cat /proc/fs/afs/sysname
244 foo
245 amd64_linux_26
246
247 When @sys is being substituted for, each element of the list is tried in the
248 order given.
249
250 By default, the list will contain one item that conforms to the pattern
251 "<arch>_linux_26", amd64 being the name for x86_64.
252

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

kAFS 개요와 지원 기능

1-38

kAFS는 비교적 단순하고 보안 기능을 갖춘 AFS filesystem driver입니다. 개발 중이어서 전체 AFS 기능을 제공하지는 않습니다.

현재 AFS kaserver와 Kerberos IV ticket을 이용한 security, file read/write, automount, FS-Cache를 통한 local caching을 지원합니다. 아직 `pioctl()` system call은 지원하지 않습니다.

kAFS 기능 상태
상태기능
지원AFS kaserver 및 Kerberos IV ticket security
지원file read/write
지원automount
지원FS-Cache local caching
미지원`pioctl()` system call

원문의 지원·미지원 항목을 구분했습니다.

.. SPDX-License-Identifier: GPL-2.0

====================
kAFS: AFS FILESYSTEM
====================

.. Contents:

 - Overview.
 - Usage.
 - Mountpoints.
 - Dynamic root.
 - Proc filesystem.
 - The cell database.
 - Security.
 - The @sys substitution.


Overview
========

This filesystem provides a fairly simple secure AFS filesystem driver. It is
under development and does not yet provide the full feature set.  The features
it does support include:

 (*) Security (currently only AFS kaserver and KerberosIV tickets).

 (*) File reading and writing.

 (*) Automounting.

 (*) Local caching (via fscache).

It does not yet support the following AFS features:

 (*) pioctl() system call.

kernel 구성과 동적 debug

39-60

filesystem을 사용하려면 `CONFIG_AF_RXRPC`로 RxRPC protocol transport, `CONFIG_RXKAD`로 RxRPC Kerberos security handler, `CONFIG_AFS_FS`로 AFS filesystem을 활성화합니다.

debug를 돕기 위해 `CONFIG_AF_RXRPC_DEBUG`와 `CONFIG_AFS_DEBUG`를 추가할 수 있습니다. 각각 AF_RXRPC와 AFS debugging을 runtime에 켤 수 있게 합니다.

debug message는 `/sys/module/af_rxrpc/parameters/debug`와 `/sys/module/kafs/parameters/debug`의 mask를 조작해 동적으로 켜고 끕니다.

kAFS Kconfig와 debug
symbol/path역할
`CONFIG_AF_RXRPC`RxRPC protocol transport
`CONFIG_RXKAD`RxRPC Kerberos security handler
`CONFIG_AFS_FS`AFS filesystem
`CONFIG_AF_RXRPC_DEBUG`AF_RXRPC dynamic debug 허용
`CONFIG_AFS_DEBUG`AFS dynamic debug 허용
`/sys/module/af_rxrpc/parameters/debug`AF_RXRPC debug mask
`/sys/module/kafs/parameters/debug`kAFS debug mask

build option과 runtime control path를 연결합니다.

Compilation
===========

The filesystem should be enabled by turning on the kernel configuration
options::

        CONFIG_AF_RXRPC                - The RxRPC protocol transport
        CONFIG_RXKAD                - The RxRPC Kerberos security handler
        CONFIG_AFS_FS                - The AFS filesystem

Additionally, the following can be turned on to aid debugging::

        CONFIG_AF_RXRPC_DEBUG        - Permit AF_RXRPC debugging to be enabled
        CONFIG_AFS_DEBUG        - Permit AFS debugging to be enabled

They permit the debugging messages to be turned on dynamically by manipulating
the masks in the following files::

        /sys/module/af_rxrpc/parameters/debug
        /sys/module/kafs/parameters/debug

root cell 등록과 volume mount

61-105

driver module을 넣을 때 root cell과 volume location server IP 목록을 지정해야 합니다. 예는 `modprobe rxrpc` 뒤 `modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91`을 실행하는 것입니다.

AF_RXRPC network protocol driver는 RxRPC remote operation protocol을 제공하고 userspace에서도 접근할 수 있습니다. 자세한 내용은 `Documentation/networking/rxrpc.rst`를 참조합니다. Kerberos RxRPC security driver와 실제 AFS filesystem driver가 그 위에서 동작합니다.

module을 올린 뒤 `echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells`로 cell을 추가할 수 있습니다. `add`의 첫 인자는 cell name이고 뒤에는 colon으로 구분한 volume location server 목록이 옵니다.

AFS volume은 `mount -t afs "%cambridge.redhat.com:root.afs." /afs` 또는 `mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge`처럼 mount합니다. cell name을 생략한 `#root.afs.`와 `#root.cell.`은 `modprobe` 때 지정한 root cell에서 찾습니다.

device name의 첫 문자가 `%`이면 반드시 read/write volume을 요구합니다. `#`이면 read-only volume을 선호하되 필요하면 read/write volume도 사용합니다. volume name에 `.backup` 또는 `.readonly` suffix를 붙이면 해당 type volume에만 연결합니다.

AFS volume selector
표현선택 규칙
`%cell:volume`반드시 read/write volume
`#cell:volume`read-only 선호, read/write fallback 허용
cell 생략`rootcell=`의 cell에서 volume 검색
`.backup`backup volume만 선택
`.readonly`read-only volume만 선택

mount device name의 prefix와 suffix 의미입니다.

Usage
=====

When inserting the driver modules the root cell must be specified along with a
list of volume location server IP addresses::

        modprobe rxrpc
        modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91

The first module is the AF_RXRPC network protocol driver.  This provides the
RxRPC remote operation protocol and may also be accessed from userspace.  See:

        Documentation/networking/rxrpc.rst

The second module is the kerberos RxRPC security driver, and the third module
is the actual filesystem driver for the AFS filesystem.

Once the module has been loaded, more modules can be added by the following
procedure::

        echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells

Where the parameters to the "add" command are the name of a cell and a list of
volume location servers within that cell, with the latter separated by colons.

Filesystems can be mounted anywhere by commands similar to the following::

        mount -t afs "%cambridge.redhat.com:root.afs." /afs
        mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge
        mount -t afs "#root.afs." /afs
        mount -t afs "#root.cell." /afs/cambridge

Where the initial character is either a hash or a percent symbol depending on
whether you definitely want a R/W volume (percent) or whether you'd prefer a
R/O volume, but are willing to use a R/W volume instead (hash).

The name of the volume can be suffixes with ".backup" or ".readonly" to
specify connection to only volumes of those types.

The name of the cell is optional, and if not given during a mount, then the
named volume will be looked up in the cell specified during modprobe.

Additional cells can be added through /proc (see later section).

AFS mountpoint와 자동 unmount

106-128

AFS mountpoint는 `mount`에 전달하는 device name과 같은 형식의 특수 symbolic link입니다. kAFS는 이를 follow-link capability가 있는 directory, 즉 symbolic-link semantics를 가진 directory로 표시합니다.

누군가 mountpoint에 접근하면 가능한 경우 target volume이 그 위치에 자동 mount됩니다. 자동 mount된 filesystem은 마지막 사용 약 20분 뒤 자동 unmount되며 `umount()`로 직접 내릴 수도 있습니다.

AFS volume을 수동 unmount하면 그 위의 idle submount를 먼저 제거합니다. 모두 제거되면 요청한 volume도 unmount하고, 남은 submount가 있으면 `EBUSY`를 반환합니다. 관리자는 `umount /afs` 한 번으로 전체 AFS tree 제거를 시도할 수 있습니다.

AFS mountpoint lifecycle
특수 AFS symbolic link에 접근target volume을 해당 위치에 automount사용 중에는 submount 유지마지막 사용 약 20분 뒤 자동 unmount수동 `umount`는 idle submount부터 제거남은 submount가 있으면 `EBUSY`

접근부터 idle unmount 또는 EBUSY까지의 흐름입니다.

Mountpoints
===========

AFS has a concept of mountpoints. In AFS terms, these are specially formatted
symbolic links (of the same form as the "device name" passed to mount).  kAFS
presents these to the user as directories that have a follow-link capability
(i.e.: symbolic link semantics).  If anyone attempts to access them, they will
automatically cause the target volume to be mounted (if possible) on that site.

Automatically mounted filesystems will be automatically unmounted approximately
twenty minutes after they were last used.  Alternatively they can be unmounted
directly with the umount() system call.

Manually unmounting an AFS volume will cause any idle submounts upon it to be
culled first.  If all are culled, then the requested volume will also be
unmounted, otherwise error EBUSY will be returned.

This can be used by the administrator to attempt to unmount the whole AFS tree
mounted on /afs in one go by doing::

        umount /afs

serverless dynamic root

129-143

`dyn` mount option은 server 없이 dynamic lookup만 가능한 mount를 만듭니다. 예는 `mount -t afs none /afs -o dyn`입니다.

처음에는 root에 빈 directory만 있습니다. 이 directory에서 이름을 lookup하면 같은 이름의 cell을 찾는 mountpoint를 동적으로 만듭니다. 예를 들어 `ls /afs/grand.central.org/`는 `grand.central.org` cell lookup을 유발합니다.

AFS dynamic root lookup
`mount -t afs none /afs -o dyn`serverless 빈 root 생성`/afs/<cell>/` 이름 lookup같은 이름의 cell용 mountpoint 생성cell volume을 동적으로 탐색·mount

빈 root가 cell별 mountpoint를 만드는 과정입니다.

Dynamic Root
============

A mount option is available to create a serverless mount that is only usable
for dynamic lookup.  Creating such a mount can be done by, for example::

        mount -t afs none /afs -o dyn

This creates a mount that just has an empty directory at the root.  Attempting
to look up a name in this directory will cause a mountpoint to be created that
looks up a cell of the same name, for example::

        ls /afs/grand.central.org/

`/proc/fs/afs` runtime 정보

144-169

AFS module은 `/proc/fs/afs/` directory를 만듭니다. `cells` file은 현재 알려진 cell과 usage count를 `USE NAME` 형식으로 표시합니다.

cell마다 별도 directory가 생기며 그 안의 `servers`, `vlservers`, `volumes` file이 해당 cell에서 알려진 active server, volume location server, volume 정보를 보여 줍니다.

예에서 `servers`는 usage, address, state를, `vlservers`는 address를, `volumes`는 usage, status, 세 volume ID와 name을 출력합니다.

AFS proc entry
path내용
`/proc/fs/afs/cells`cell name과 usage count
`/proc/fs/afs/<cell>/servers`active server usage·address·state
`/proc/fs/afs/<cell>/vlservers`volume location server address
`/proc/fs/afs/<cell>/volumes`volume usage·status·VLID·name

각 proc file의 정보 범위를 정리했습니다.

Proc Filesystem
===============

The AFS module creates a "/proc/fs/afs/" directory and populates it:

  (*) A "cells" file that lists cells currently known to the afs module and
      their usage counts::

        [root@andromeda ~]# cat /proc/fs/afs/cells
        USE NAME
          3 cambridge.redhat.com

  (*) A directory per cell that contains files that list volume location
      servers, volumes, and active servers known within that cell::

        [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
        USE ADDR            STATE
          4 172.16.18.91        0
        [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers
        ADDRESS
        172.16.18.91
        [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes
        USE STT VLID[0]  VLID[1]  VLID[2]  NAME
          1 Val 20000000 20000001 20000002 root.afs

cell database 추가

170-186

filesystem은 알고 있는 모든 cell과 각 cell의 volume location server IP를 내부 database에 유지합니다.

system이 속한 cell은 module 방식에서는 `rootcell=` argument로, built-in 방식에서는 kernel command line의 `kafs.rootcell=`로 database에 추가됩니다.

추가 cell은 `echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells`로 넣습니다. 현재는 이외의 cell database operation을 제공하지 않습니다.

AFS cell database 입력
`rootcell=` 또는 `kafs.rootcell=`로 system cell 등록cell name과 VL server IP 목록 저장`/proc/fs/afs/cells`에 `add` command write추가 cell과 colon-separated VL address 등록database를 volume lookup에 사용

boot/module 설정과 runtime 추가 경로입니다.

The Cell Database
=================

The filesystem maintains an internal database of all the cells it knows and the
IP addresses of the volume location servers for those cells.  The cell to which
the system belongs is added to the database when modprobe is performed by the
"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
the kernel command line.

Further cells can be added by commands similar to the following::

        echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells
        echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells

No other cell database operations are available at this time.

RxRPC key와 operation credential

187-228

secure operation은 `klog` program으로 key를 얻어 시작합니다. primitive 구현은 `https://people.redhat.com/~dhowells/rxrpc/klog.c`에 있으며 `make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"`로 compile하고 `./klog`로 실행합니다.

성공하면 service와 cell 이름을 딴 `afs@<cellname>`이라는 RxRPC type key가 생깁니다. `keyctl show` 또는 `/proc/keys`에서 확인할 수 있습니다. 현재 username, realm, password와 요청 ticket lifetime은 program에 compile되어 있습니다.

AFS를 사용하기 전에 key를 반드시 얻을 필요는 없지만 key가 없으면 모든 operation은 ACL의 anonymous user 부분을 따릅니다. key를 얻으면 그 key를 보유한 주체가 수행하는 mount와 automount를 포함한 모든 AFS operation이 해당 key로 보호됩니다.

특정 key로 file을 열고 file descriptor를 그 key가 없는 process에 전달해도, 이후 file operation은 file을 열 때 사용한 key로 수행됩니다. AF_UNIX socket으로 descriptor를 전달하는 경우도 같습니다.

AFS credential 적용
`klog`가 Kerberos 정보로 RxRPC key 생성session keyring에 `afs@<cellname>` 등록key 보유자의 mount·automount·I/O 보호file open 때 사용한 key를 file에 연계descriptor를 다른 process에 전달해도 opening key 유지key가 없으면 anonymous ACL 적용

klog key 획득과 file descriptor의 key 유지 관계입니다.

Security
========

Secure operations are initiated by acquiring a key using the klog program.  A
very primitive klog program is available at:

        https://people.redhat.com/~dhowells/rxrpc/klog.c

This should be compiled by::

        make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"

And then run as::

        ./klog

Assuming it's successful, this adds a key of type RxRPC, named for the service
and cell, e.g.: "afs@<cellname>".  This can be viewed with the keyctl program or
by cat'ing /proc/keys::

        [root@andromeda ~]# keyctl show
        Session Keyring
               -3 --alswrv      0     0  keyring: _ses.3268
                2 --alswrv      0     0   \_ keyring: _uid.0
        111416553 --als--v      0     0   \_ rxrpc: [email protected]

Currently the username, realm, password and proposed ticket lifetime are
compiled into the program.

It is not required to acquire a key before using AFS facilities, but if one is
not acquired then all operations will be governed by the anonymous user parts
of the ACLs.

If a key is acquired, then all AFS operations, including mounts and automounts,
made by a possessor of that key will be secured with that key.

If a file is opened with a particular key and then the file descriptor is
passed to a process that doesn't have that key (perhaps over an AF_UNIX
socket), then the operations on the file will be made with key that was used to
open the file.

`@sys` substitution 목록

229-251

현재 network namespace의 `@sys` substitution은 최대 16개이며 `/proc/fs/afs/sysname`에 목록을 써서 구성합니다. 예는 `echo foo amd64_linux_26 >/proc/fs/afs/sysname`입니다.

빈 목록을 쓰는 `echo >/proc/fs/afs/sysname`으로 모두 지울 수 있고 `cat /proc/fs/afs/sysname`으로 현재 목록을 읽습니다.

`@sys`를 치환할 때 목록의 각 원소를 주어진 순서대로 시험합니다. 기본 목록에는 `<arch>_linux_26` pattern을 따르는 항목 하나가 있으며 x86_64의 이름은 `amd64`입니다.

AFS `@sys` 치환
`/proc/fs/afs/sysname`에 최대 16개 이름 writepath의 `@sys` component 발견첫 번째 후보로 치환해 lookup실패하면 다음 후보를 순서대로 시험빈 write로 목록 전체 clear 가능

namespace별 후보 목록을 순서대로 적용합니다.

The @sys Substitution
=====================

The list of up to 16 @sys substitutions for the current network namespace can
be configured by writing a list to /proc/fs/afs/sysname::

        [root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname

or cleared entirely by writing an empty list::

        [root@andromeda ~]# echo >/proc/fs/afs/sysname

The current list for current network namespace can be retrieved by::

        [root@andromeda ~]# cat /proc/fs/afs/sysname
        foo
        amd64_linux_26

When @sys is being substituted for, each element of the list is tried in the
order given.

By default, the list will contain one item that conforms to the pattern
"<arch>_linux_26", amd64 being the name for x86_64.