]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/afp_dsi.c
Add AFP 3.3 case
[netatalk.git] / etc / afpd / afp_dsi.c
1 /*
2  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
3  * Copyright (c) 1990,1993 Regents of The University of Michigan.
4  * All Rights Reserved.  See COPYRIGHT.
5  *
6  * modified from main.c. this handles afp over tcp.
7  */
8
9 #ifdef HAVE_CONFIG_H
10 #include "config.h"
11 #endif /* HAVE_CONFIG_H */
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <signal.h>
16 #include <string.h>
17 #include <errno.h>
18 #ifdef HAVE_UNISTD_H
19 #include <unistd.h>
20 #endif /* HAVE_UNISTD_H */
21 #include <sys/socket.h>
22 #include <sys/time.h>
23 #ifdef HAVE_SYS_STAT_H
24 #include <sys/stat.h>
25 #endif /* HAVE_SYS_STAT_H */
26 #include <netinet/in.h>
27 #include <arpa/inet.h>
28 #include <atalk/logger.h>
29
30 #include <atalk/dsi.h>
31 #include <atalk/compat.h>
32 #include <atalk/util.h>
33
34 #include "globals.h"
35 #include "switch.h"
36 #include "auth.h"
37 #include "fork.h"
38 #include "dircache.h"
39
40 #ifdef FORCE_UIDGID
41 #warning UIDGID
42 #include "uid.h"
43 #endif /* FORCE_UIDGID */
44
45 /* 
46  * We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be
47  * available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it
48  * but are deeply nested in the function chain with the caller already without acces to it.
49  * Changing this would require adding a reference to the caller which itself might be
50  * called in many places (eg acltoownermode is called from accessmode).
51  * The only sane way out is providing a copy of it here:
52  */
53 AFPObj *AFPobj = NULL;
54
55 typedef struct {
56     uint16_t DSIreqID;
57     uint8_t  AFPcommand;
58     uint32_t result;
59 } rc_elem_t;
60
61 /*
62  * AFP replay cache:
63  * - fix sized array
64  * - indexed just by taking DSIreqID mod REPLAYCACHE_SIZE
65  */
66 rc_elem_t replaycache[REPLAYCACHE_SIZE];
67
68 static void afp_dsi_close(AFPObj *obj)
69 {
70     DSI *dsi = obj->handle;
71
72     close(obj->ipc_fd);
73     obj->ipc_fd = -1;
74
75     /* we may have been called from a signal handler caught when afpd was running
76      * as uid 0, that's the wrong user for volume's prexec_close scripts if any,
77      * restore our login user
78      */
79     if (geteuid() != obj->uid) {
80         if (seteuid( obj->uid ) < 0) {
81             LOG(log_error, logtype_afpd, "can't seteuid(%u) back %s: uid: %u, euid: %u", 
82                 obj->uid, strerror(errno), getuid(), geteuid());
83             exit(EXITERR_SYS);
84         }
85     }
86
87     close_all_vol();
88     if (obj->logout)
89         (*obj->logout)();
90
91     LOG(log_info, logtype_afpd, "AFP statistics: %.2f KB read, %.2f KB written",
92         dsi->read_count/1024.0, dsi->write_count/1024.0);
93     log_dircache_stat();
94
95     dsi_close(dsi);
96 }
97
98 /* -------------------------------
99  * SIGTERM
100  * a little bit of code duplication. 
101  */
102 static void afp_dsi_die(int sig)
103 {
104 static volatile int in_handler;
105     
106     if (in_handler) {
107         return;
108     }
109     /* it's not atomic but we don't care because it's an exit function
110      * ie if a signal is received here, between the test and the affectation,
111      * it will not return.
112     */
113     in_handler = 1;
114
115     dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN);
116     afp_dsi_close(AFPobj);
117     if (sig) /* if no signal, assume dieing because logins are disabled &
118                 don't log it (maintenance mode)*/
119         LOG(log_info, logtype_afpd, "Connection terminated");
120     if (sig == SIGTERM || sig == SIGALRM) {
121         exit( 0 );
122     }
123     else {
124         exit(sig);
125     }
126 }
127
128 static void afp_dsi_transfer_session(int sig _U_)
129 {
130     uint16_t dsiID;
131     int socket;
132     DSI *dsi = (DSI *)AFPobj->handle;
133
134     LOG(log_note, logtype_afpd, "afp_dsi_transfer_session: got SIGURG, trying to receive session");
135
136     if (readt(AFPobj->ipc_fd, &dsiID, 2, 0, 2) != 2) {
137         LOG(log_error, logtype_afpd, "afp_dsi_transfer_session: couldn't receive DSI id, goodbye");
138         afp_dsi_close(AFPobj);
139         exit(EXITERR_SYS);
140     }
141
142     if ((socket = recv_fd(AFPobj->ipc_fd, 1)) == -1) {
143         LOG(log_error, logtype_afpd, "afp_dsi_transfer_session: couldn't receive session fd, goodbye");
144         afp_dsi_close(AFPobj);
145         exit(EXITERR_SYS);
146     }
147
148     if (dsi->socket != -1)
149         close(dsi->socket);
150     dsi->socket = socket;
151     dsi->header.dsi_requestID = dsiID;
152     dsi->header.dsi_len = 0;
153     dsi->header.dsi_code = AFP_OK;
154     dsi->header.dsi_command = DSIFUNC_CMD;
155     dsi->header.dsi_flags = DSIFL_REPLY;
156
157     /*
158      * The session transfer happens in the middle of FPDisconnect old session, thus we
159      * have to send the reply now.
160      */
161     if (!dsi_cmdreply(dsi, AFP_OK)) {
162         LOG(log_error, logtype_afpd, "dsi_cmdreply: %s", strerror(errno) );
163         afp_dsi_close(AFPobj);
164         exit(EXITERR_CLNT);
165     }
166
167     LOG(log_note, logtype_afpd, "afp_dsi_transfer_session: succesfull primary reconnect");
168     /* 
169      * Now returning from this signal handler return to dsi_receive which should start
170      * reading/continuing from the connected socket that was passed via the parent from
171      * another session. The parent will terminate that session.
172      */
173 }
174
175 /* */
176 static void afp_dsi_sleep(void)
177 {
178     dsi_sleep(AFPobj->handle, 1);
179 }
180
181 /* ------------------- */
182 static void afp_dsi_timedown(int sig _U_)
183 {
184     struct sigaction    sv;
185     struct itimerval    it;
186     DSI                 *dsi = (DSI *)AFPobj->handle;
187     dsi->flags |= DSI_DIE;
188     /* shutdown and don't reconnect. server going down in 5 minutes. */
189     setmessage("The server is going down for maintenance.");
190     if (dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN | AFPATTN_NORECONNECT |
191                   AFPATTN_MESG | AFPATTN_TIME(5)) < 0) {
192         DSI *dsi = (DSI *)AFPobj->handle;
193         dsi->down_request = 1;
194     }                  
195
196     it.it_interval.tv_sec = 0;
197     it.it_interval.tv_usec = 0;
198     it.it_value.tv_sec = 300;
199     it.it_value.tv_usec = 0;
200
201     if ( setitimer( ITIMER_REAL, &it, NULL ) < 0 ) {
202         LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) );
203         afp_dsi_die(EXITERR_SYS);
204     }
205     memset(&sv, 0, sizeof(sv));
206     sv.sa_handler = afp_dsi_die;
207     sigemptyset( &sv.sa_mask );
208     sigaddset(&sv.sa_mask, SIGHUP);
209     sigaddset(&sv.sa_mask, SIGTERM);
210     sv.sa_flags = SA_RESTART;
211     if ( sigaction( SIGALRM, &sv, NULL ) < 0 ) {
212         LOG(log_error, logtype_afpd, "afp_timedown: sigaction: %s", strerror(errno) );
213         afp_dsi_die(EXITERR_SYS);
214     }
215
216     /* ignore myself */
217     sv.sa_handler = SIG_IGN;
218     sigemptyset( &sv.sa_mask );
219     sv.sa_flags = SA_RESTART;
220     if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) {
221         LOG(log_error, logtype_afpd, "afp_timedown: sigaction SIGHUP: %s", strerror(errno) );
222         afp_dsi_die(EXITERR_SYS);
223     }
224 }
225
226 /* ---------------------------------
227  * SIGHUP reload configuration file
228  */
229 volatile int reload_request = 0;
230
231 static void afp_dsi_reload(int sig _U_)
232 {
233     reload_request = 1;
234 }
235
236 /* ---------------------------------
237  * SIGINT: enable max_debug LOGging
238  */
239 static volatile sig_atomic_t debug_request = 0;
240
241 static void afp_dsi_debug(int sig _U_)
242 {
243     debug_request = 1;
244 }
245
246 /* ---------------------- */
247 static void afp_dsi_getmesg (int sig _U_)
248 {
249     DSI *dsi = (DSI *)AFPobj->handle;
250
251     dsi->msg_request = 1;
252     if (dsi_attention(AFPobj->handle, AFPATTN_MESG | AFPATTN_TIME(5)) < 0)
253         dsi->msg_request = 2;
254 }
255
256 static void alarm_handler(int sig _U_)
257 {
258     int err;
259     DSI *dsi = (DSI *)AFPobj->handle;
260
261     /* we have to restart the timer because some libraries may use alarm() */
262     setitimer(ITIMER_REAL, &dsi->timer, NULL);
263
264     /* we got some traffic from the client since the previous timer tick. */
265     if ((dsi->flags & DSI_DATA)) {
266         dsi->flags &= ~DSI_DATA;
267         dsi->flags &= ~DSI_DISCONNECTED;
268        return;
269     }
270
271     dsi->tickle++;
272
273     if (dsi->flags & DSI_SLEEPING) {
274         if (dsi->tickle < AFPobj->options.sleep) {
275             LOG(log_error, logtype_afpd, "afp_alarm: sleep time ended");
276             afp_dsi_die(EXITERR_CLNT);
277         }
278         return;
279     } 
280
281     if (dsi->flags & DSI_DISCONNECTED) {
282         if (dsi->tickle > AFPobj->options.disconnected) {
283              LOG(log_error, logtype_afpd, "afp_alarm: no reconnect within 10 minutes, goodbye");
284             afp_dsi_die(EXITERR_CLNT);
285         }
286         return;
287     }
288
289     /* if we're in the midst of processing something, don't die. */        
290     if ( !(dsi->flags & DSI_RUNNING) && (dsi->tickle > AFPobj->options.timeout)) {
291         LOG(log_error, logtype_afpd, "afp_alarm: child timed out, entering disconnected state");
292         dsi->flags |= DSI_DISCONNECTED;
293         return;
294     }
295
296     if ((err = pollvoltime(AFPobj)) == 0)
297         err = dsi_tickle(AFPobj->handle);
298     if (err <= 0) {
299         LOG(log_error, logtype_afpd, "afp_alarm: connection problem, entering disconnected state");
300         dsi->flags |= DSI_DISCONNECTED;
301     }
302 }
303
304 /* ----------------- 
305    if dsi->in_write is set attention, tickle (and close?) msg
306    aren't sent. We don't care about tickle 
307 */
308 static void pending_request(DSI *dsi)
309 {
310     /* send pending attention */
311
312     /* read msg if any, it could be done in afp_getsrvrmesg */
313     if (dsi->msg_request) {
314         if (dsi->msg_request == 2) {
315             /* didn't send it in signal handler */
316             dsi_attention(AFPobj->handle, AFPATTN_MESG | AFPATTN_TIME(5));
317         }
318         dsi->msg_request = 0;
319         readmessage(AFPobj);
320     }
321     if (dsi->down_request) {
322         dsi->down_request = 0;
323         dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN | AFPATTN_NORECONNECT |
324                   AFPATTN_MESG | AFPATTN_TIME(5));
325     }
326 }
327
328 /* -------------------------------------------
329  afp over dsi. this never returns. 
330 */
331 void afp_over_dsi(AFPObj *obj)
332 {
333     DSI *dsi = (DSI *) obj->handle;
334     int rc_idx;
335     u_int32_t err, cmd;
336     u_int8_t function;
337     struct sigaction action;
338
339     AFPobj = obj;
340     obj->exit = afp_dsi_die;
341     obj->reply = (int (*)()) dsi_cmdreply;
342     obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;
343     obj->sleep = afp_dsi_sleep;
344     dsi->tickle = 0;
345
346     memset(&action, 0, sizeof(action));
347
348     /* install SIGHUP */
349     action.sa_handler = afp_dsi_reload;
350     sigemptyset( &action.sa_mask );
351     sigaddset(&action.sa_mask, SIGALRM);
352     sigaddset(&action.sa_mask, SIGTERM);
353     sigaddset(&action.sa_mask, SIGUSR1);
354     sigaddset(&action.sa_mask, SIGINT);
355     sigaddset(&action.sa_mask, SIGUSR2);
356     action.sa_flags = SA_RESTART;
357     if ( sigaction( SIGHUP, &action, NULL ) < 0 ) {
358         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
359         afp_dsi_die(EXITERR_SYS);
360     }
361
362     /* install SIGURG */
363     action.sa_handler = afp_dsi_transfer_session;
364     sigemptyset( &action.sa_mask );
365     sigaddset(&action.sa_mask, SIGALRM);
366     sigaddset(&action.sa_mask, SIGTERM);
367     sigaddset(&action.sa_mask, SIGUSR1);
368     sigaddset(&action.sa_mask, SIGINT);
369     sigaddset(&action.sa_mask, SIGUSR2);
370     action.sa_flags = SA_RESTART;
371     if ( sigaction( SIGURG, &action, NULL ) < 0 ) {
372         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
373         afp_dsi_die(EXITERR_SYS);
374     }
375
376     /* install SIGTERM */
377     action.sa_handler = afp_dsi_die;
378     sigemptyset( &action.sa_mask );
379     sigaddset(&action.sa_mask, SIGALRM);
380     sigaddset(&action.sa_mask, SIGHUP);
381     sigaddset(&action.sa_mask, SIGUSR1);
382     sigaddset(&action.sa_mask, SIGINT);
383     sigaddset(&action.sa_mask, SIGUSR2);
384     action.sa_flags = SA_RESTART;
385     if ( sigaction( SIGTERM, &action, NULL ) < 0 ) {
386         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
387         afp_dsi_die(EXITERR_SYS);
388     }
389
390     /* Added for server message support */
391     action.sa_handler = afp_dsi_getmesg;
392     sigemptyset( &action.sa_mask );
393     sigaddset(&action.sa_mask, SIGALRM);
394     sigaddset(&action.sa_mask, SIGTERM);
395     sigaddset(&action.sa_mask, SIGUSR1);
396     sigaddset(&action.sa_mask, SIGHUP);
397     sigaddset(&action.sa_mask, SIGINT);
398     action.sa_flags = SA_RESTART;
399     if ( sigaction( SIGUSR2, &action, NULL) < 0 ) {
400         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
401         afp_dsi_die(EXITERR_SYS);
402     }
403
404     /*  SIGUSR1 - set down in 5 minutes  */
405     action.sa_handler = afp_dsi_timedown;
406     sigemptyset( &action.sa_mask );
407     sigaddset(&action.sa_mask, SIGALRM);
408     sigaddset(&action.sa_mask, SIGHUP);
409     sigaddset(&action.sa_mask, SIGTERM);
410     sigaddset(&action.sa_mask, SIGINT);
411     sigaddset(&action.sa_mask, SIGUSR2);
412     action.sa_flags = SA_RESTART;
413     if ( sigaction( SIGUSR1, &action, NULL) < 0 ) {
414         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
415         afp_dsi_die(EXITERR_SYS);
416     }
417
418     /*  SIGINT - enable max_debug LOGging to /tmp/afpd.PID.XXXXXX */
419     action.sa_handler = afp_dsi_debug;
420     sigfillset( &action.sa_mask );
421     action.sa_flags = SA_RESTART;
422     if ( sigaction( SIGINT, &action, NULL) < 0 ) {
423         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
424         afp_dsi_die(EXITERR_SYS);
425     }
426
427 #ifndef DEBUGGING
428     /* tickle handler */
429     action.sa_handler = alarm_handler;
430     sigemptyset(&action.sa_mask);
431     sigaddset(&action.sa_mask, SIGHUP);
432     sigaddset(&action.sa_mask, SIGTERM);
433     sigaddset(&action.sa_mask, SIGUSR1);
434     sigaddset(&action.sa_mask, SIGINT);
435     sigaddset(&action.sa_mask, SIGUSR2);
436     action.sa_flags = SA_RESTART; /* dont restart, otherwi */
437     if ((sigaction(SIGALRM, &action, NULL) < 0) ||
438             (setitimer(ITIMER_REAL, &dsi->timer, NULL) < 0)) {
439         afp_dsi_die(EXITERR_SYS);
440     }
441 #endif /* DEBUGGING */
442
443     if (dircache_init(obj->options.dircachesize) != 0)
444         afp_dsi_die(EXITERR_SYS);
445
446     /* get stuck here until the end */
447     while (1) {
448         cmd = dsi_receive(dsi);
449         if (cmd == 0) {
450             /* Some error on the client connection, enter disconnected state */
451             dsi->flags |= DSI_DISCONNECTED;
452             pause(); /* gets interrupted by SIGALARM or SIGURG tickle */
453             continue; /* continue receiving until disconnect timer expires
454                        * or a primary reconnect succeeds  */
455         }
456
457         dsi->tickle = 0;
458         dsi_sleep(dsi, 0); /* wake up */
459
460         if (reload_request) {
461             reload_request = 0;
462             load_volumes(AFPobj);
463             dircache_dump();
464             log_dircache_stat();
465         }
466
467         /* The first SIGINT enables debugging, the next restores the config */
468         if (debug_request) {
469             static int debugging = 0;
470             debug_request = 0;
471
472             if (debugging) {
473                 if (obj->options.logconfig)
474                     setuplog(obj->options.logconfig);
475                 else
476                     setuplog("default log_note");
477                 debugging = 0;
478             } else {
479                 char logstr[50];
480                 debugging = 1;
481                 sprintf(logstr, "default log_maxdebug /tmp/afpd.%u.XXXXXX", getpid());
482                 setuplog(logstr);
483             }
484         }
485
486         if (cmd == DSIFUNC_TICKLE) {
487             /* timer is not every 30 seconds anymore, so we don't get killed on the client side. */
488             if ((dsi->flags & DSI_DIE))
489                 dsi_tickle(dsi);
490             pending_request(dsi);
491             continue;
492         } 
493
494         dsi->flags |= DSI_DATA;
495         switch(cmd) {
496         case DSIFUNC_CLOSE:
497             afp_dsi_close(obj);
498             LOG(log_note, logtype_afpd, "done");
499             return;
500             break;
501
502         case DSIFUNC_CMD:
503 #ifdef AFS
504             if ( writtenfork ) {
505                 if ( flushfork( writtenfork ) < 0 ) {
506                     LOG(log_error, logtype_afpd, "main flushfork: %s", strerror(errno) );
507                 }
508                 writtenfork = NULL;
509             }
510 #endif /* AFS */
511
512             function = (u_char) dsi->commands[0];
513
514             /* AFP replay cache */
515             rc_idx = REPLAYCACHE_SIZE % dsi->clientID;
516             LOG(log_debug, logtype_afpd, "DSI request ID: %u", dsi->clientID);
517
518             if (replaycache[rc_idx].DSIreqID == dsi->clientID
519                 && replaycache[rc_idx].AFPcommand == function) {
520                 LOG(log_debug, logtype_afpd, "AFP Replay Cache match: id: %u / cmd: %s",
521                     dsi->clientID, AfpNum2name(function));
522                 err = replaycache[rc_idx].result;
523             /* AFP replay cache end */
524             } else {
525                 /* send off an afp command. in a couple cases, we take advantage
526                  * of the fact that we're a stream-based protocol. */
527                 if (afp_switch[function]) {
528                     dsi->datalen = DSI_DATASIZ;
529                     dsi->flags |= DSI_RUNNING;
530
531                     LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function));
532
533                     err = (*afp_switch[function])(obj,
534                                                   (char *)&dsi->commands, dsi->cmdlen,
535                                                   (char *)&dsi->data, &dsi->datalen);
536
537                     LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s",
538                         AfpNum2name(function), AfpErr2name(err));
539
540                     dir_free_invalid_q();
541
542 #ifdef FORCE_UIDGID
543                     /* bring everything back to old euid, egid */
544                     if (obj->force_uid)
545                         restore_uidgid ( &obj->uidgid );
546 #endif /* FORCE_UIDGID */
547                     dsi->flags &= ~DSI_RUNNING;
548
549                     /* Add result to the AFP replay cache */
550                     replaycache[rc_idx].DSIreqID = dsi->clientID;
551                     replaycache[rc_idx].AFPcommand = function;
552                     replaycache[rc_idx].result = err;
553                 } else {
554                     LOG(log_error, logtype_afpd, "bad function %X", function);
555                     dsi->datalen = 0;
556                     err = AFPERR_NOOP;
557                 }
558             }
559
560             /* single shot toggle that gets set by dsi_readinit. */
561             if (dsi->flags & DSI_NOREPLY) {
562                 dsi->flags &= ~DSI_NOREPLY;
563                 break;
564             }
565
566             if (!dsi_cmdreply(dsi, err)) {
567                 LOG(log_error, logtype_afpd, "dsi_cmdreply(%d): %s", dsi->socket, strerror(errno) );
568                 dsi->flags |= DSI_DISCONNECTED;
569             }
570             break;
571
572         case DSIFUNC_WRITE: /* FPWrite and FPAddIcon */
573             function = (u_char) dsi->commands[0];
574             if ( afp_switch[ function ] != NULL ) {
575                 dsi->datalen = DSI_DATASIZ;
576                 dsi->flags |= DSI_RUNNING;
577
578                 LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function));
579
580                 err = (*afp_switch[function])(obj,
581                                               (char *)&dsi->commands, dsi->cmdlen,
582                                               (char *)&dsi->data, &dsi->datalen);
583
584                 LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s",
585                     AfpNum2name(function), AfpErr2name(err));
586
587                 dsi->flags &= ~DSI_RUNNING;
588 #ifdef FORCE_UIDGID
589                 /* bring everything back to old euid, egid */
590                 if (obj->force_uid)
591                     restore_uidgid ( &obj->uidgid );
592 #endif /* FORCE_UIDGID */
593             } else {
594                 LOG(log_error, logtype_afpd, "(write) bad function %x", function);
595                 dsi->datalen = 0;
596                 err = AFPERR_NOOP;
597             }
598
599             if (!dsi_wrtreply(dsi, err)) {
600                 LOG(log_error, logtype_afpd, "dsi_wrtreply: %s", strerror(errno) );
601                 dsi->flags |= DSI_DISCONNECTED;
602             }
603             break;
604
605         case DSIFUNC_ATTN: /* attention replies */
606             break;
607
608             /* error. this usually implies a mismatch of some kind
609              * between server and client. if things are correct,
610              * we need to flush the rest of the packet if necessary. */
611         default:
612             LOG(log_info, logtype_afpd,"afp_dsi: spurious command %d", cmd);
613             dsi_writeinit(dsi, dsi->data, DSI_DATASIZ);
614             dsi_writeflush(dsi);
615             break;
616         }
617         pending_request(dsi);
618     }
619
620     /* error */
621     afp_dsi_die(EXITERR_CLNT);
622 }