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