2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
16 #include <afs/pthread_glock.h>
18 #include "../afs/sysincludes.h"
19 #include "../afs/afsincludes.h"
21 #include <sys/types.h>
24 #include <sys/utime.h>
26 #include <WINNT/afssw.h>
28 #include <sys/socket.h>
29 #include <netinet/in.h>
34 #include <arpa/nameser.h>
36 #endif /* AFS_AFSDB_ENV */
37 #endif /* AFS_NT40_ENV */
45 #include <afs/afsutil.h>
46 #include "cellconfig.h"
49 static ParseHostLine();
50 static ParseCellLine();
51 static afsconf_OpenInternal();
52 static afsconf_CloseInternal();
53 static afsconf_Reopen();
55 static struct afsconf_servPair serviceTable [] = {
66 "afsres", 7010, /* residency database for MR-AFS */
67 "afsremio", 7011, /* remote I/O interface for MR-AFS */
68 0, 0 /* insert new services before this spot */
72 * Basic Rule: we touch "<AFSCONF_DIR>/CellServDB" every time we change anything, so
73 * our code can tell if there is new info in the key files, the cell server db
74 * files or any of the other files (and reopen the thing) if the date on
78 /* return port number in network byte order in the low 16 bits of a long; return -1 if not found */
79 static afs_int32 afsconf_FindService(aname)
80 register char *aname; {
81 /* lookup a service name */
83 register struct afsconf_servPair *tsp;
85 #if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
86 ts = getservbyname(aname, "");
88 ts = getservbyname(aname, (char *) 0);
91 /* we found it in /etc/services, so we use this value */
92 return ts->s_port; /* already in network byte order */
95 /* not found in /etc/services, see if it is one of ours */
96 for(tsp = serviceTable;; tsp++) {
97 if (tsp->name == (char *) 0) return -1;
98 if (!strcmp(tsp->name, aname)) return htons(tsp->port);
102 static int TrimLine(abuffer)
110 if (!isspace(tc)) break;
114 strcpy(abuffer, tbuffer);
120 * IsClientConfigDirectory() -- determine if path matches well-known
121 * client configuration directory.
123 static int IsClientConfigDirectory(const char *path)
125 const char *cdir = AFSDIR_CLIENT_ETC_DIRPATH;
128 for (i = 0; cdir[i] != '\0' && path[i] != '\0'; i++) {
129 int cc = tolower(cdir[i]);
130 int pc = tolower(path[i]);
143 /* hit end of one or both; allow mismatch in existence of trailing slash */
144 if (cdir[i] != '\0') {
145 if ((cdir[i] != '\\' && cdir[i] != '/') || (cdir[i + 1] != '\0')) {
149 if (path[i] != '\0') {
150 if ((path[i] != '\\' && path[i] != '/') || (path[i + 1] != '\0')) {
156 #endif /* AFS_NT40_ENV */
159 static int afsconf_Check(adir)
160 register struct afsconf_dir *adir; {
163 register afs_int32 code;
166 /* NT client CellServDB has different file name than NT server or Unix */
167 if (IsClientConfigDirectory(adir->name)) {
168 strcompose(tbuffer, 256,
169 adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
171 strcompose(tbuffer, 256,
172 adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
175 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
176 #endif /* AFS_NT40_ENV */
178 code = stat(tbuffer, &tstat);
182 /* did file change? */
183 if (tstat.st_mtime == adir->timeRead) {
186 /* otherwise file has changed, so reopen it */
187 return afsconf_Reopen(adir);
190 /* set modtime on file */
191 static afsconf_Touch(adir)
192 register struct afsconf_dir *adir; {
195 struct timeval tvp[2];
198 adir->timeRead = 0; /* just in case */
201 /* NT client CellServDB has different file name than NT server or Unix */
203 if (IsClientConfigDirectory(adir->name)) {
204 strcompose(tbuffer, 256,
205 adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
207 strcompose(tbuffer, 256,
208 adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
211 return _utime(tbuffer, NULL);
214 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
215 gettimeofday(&tvp[0], NULL);
217 return utimes(tbuffer, tvp);
218 #endif /* AFS_NT40_ENV */
221 struct afsconf_dir *afsconf_Open(adir)
222 register char *adir; {
223 register struct afsconf_dir *tdir;
224 register afs_int32 code;
227 /* zero structure and fill in name; rest is done by internal routine */
228 tdir = (struct afsconf_dir *) malloc(sizeof(struct afsconf_dir));
229 memset(tdir, 0, sizeof(struct afsconf_dir));
230 tdir->name = (char *) malloc(strlen(adir)+1);
231 strcpy(tdir->name, adir);
233 code = afsconf_OpenInternal(tdir, 0, 0);
235 char *afsconf_path, *getenv(), afs_confdir[128];
238 /* Check global place only when local Open failed for whatever reason */
239 if (!(afsconf_path = getenv("AFSCONF"))) {
240 /* The "AFSCONF" environment (or contents of "/.AFSCONF") will be typically set to something like "/afs/<cell>/common/etc" where, by convention, the default files for "ThisCell" and "CellServDB" will reside; note that a major drawback is that a given afs client on that cell may NOT contain the same contents... */
245 if (!(home_dir = getenv("HOME"))) {
246 /* Our last chance is the "/.AFSCONF" file */
247 fp = fopen("/.AFSCONF", "r");
251 return (struct afsconf_dir *) 0;
253 fgets(afs_confdir, 128, fp);
258 sprintf(pathname, "%s/%s", home_dir, ".AFSCONF");
259 fp = fopen(pathname, "r");
261 /* Our last chance is the "/.AFSCONF" file */
262 fp = fopen("/.AFSCONF", "r");
266 return (struct afsconf_dir *) 0;
268 fgets(afs_confdir, 128, fp);
271 fgets(afs_confdir, 128, fp);
274 len = strlen(afs_confdir);
278 return (struct afsconf_dir *) 0;
280 if (afs_confdir[len-1] == '\n') {
281 afs_confdir[len-1] = 0;
283 afsconf_path = afs_confdir;
285 tdir->name = (char *) malloc(strlen(afsconf_path)+1);
286 strcpy(tdir->name, afsconf_path);
287 code = afsconf_OpenInternal(tdir, 0, 0);
292 return (struct afsconf_dir *) 0;
300 static int GetCellUnix(struct afsconf_dir *adir)
306 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_THISCELL_FILE, NULL);
307 tf = fopen(tbuffer, "r");
309 rc = fscanf(tf, "%s", tbuffer);
311 adir->cellName = (char *) malloc(strlen(tbuffer)+1);
312 strcpy(adir->cellName, tbuffer);
324 static int GetCellNT(struct afsconf_dir *adir)
326 if (IsClientConfigDirectory(adir->name)) {
327 /* NT client config dir; ThisCell is in registry (no file). */
328 return afssw_GetClientCellName(&adir->cellName);
330 /* NT server config dir; works just like Unix */
331 return GetCellUnix(adir);
334 #endif /* AFS_NT40_ENV */
337 static int afsconf_OpenInternal(adir, cell, clones)
338 register struct afsconf_dir *adir;
343 register char *tp, *bp;
344 register struct afsconf_entry *curEntry;
345 register afs_int32 code;
347 char tbuffer[256], tbuf1[256];
350 /* figure out the cell name */
354 i = GetCellUnix(adir);
360 /* now parse the individual lines */
364 /* NT client/server have a CellServDB that is the same format as Unix.
365 * However, the NT client uses a different file name
367 if (IsClientConfigDirectory(adir->name)) {
368 /* NT client config dir */
369 strcompose(tbuffer, 256,
370 adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
372 /* NT server config dir */
373 strcompose(tbuffer, 256,
374 adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
377 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
378 #endif /* AFS_NT40_ENV */
380 if (!stat(tbuffer, &tstat)) {
381 adir->timeRead = tstat.st_mtime;
386 strcpy(tbuf1, tbuffer);
387 tf = fopen(tbuffer, "r");
392 tp = fgets(tbuffer, sizeof(tbuffer), tf);
394 TrimLine(tbuffer); /* remove white space */
395 if (tbuffer[0] == 0 || tbuffer[0] == '\n') continue; /* empty line */
396 if (tbuffer[0] == '>') {
397 char linkedcell[MAXCELLCHARS];
398 /* start new cell item */
400 /* thread this guy on the list */
401 curEntry->next = adir->entries;
402 adir->entries = curEntry;
405 curEntry = (struct afsconf_entry *) malloc(sizeof(struct afsconf_entry));
406 memset(curEntry, 0, sizeof(struct afsconf_entry));
407 code = ParseCellLine(tbuffer, curEntry->cellInfo.name, linkedcell);
409 afsconf_CloseInternal(adir);
413 if (linkedcell[0] != '\0') {
414 curEntry->cellInfo.linkedCell =
415 (char *) malloc(strlen(linkedcell) + 1);
416 strcpy(curEntry->cellInfo.linkedCell, linkedcell);
420 /* new host in the current cell */
422 afsconf_CloseInternal(adir);
426 i = curEntry->cellInfo.numServers;
427 if (cell && !strcmp(cell, curEntry->cellInfo.name))
428 code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i], &clones[i]);
430 code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i], 0);
432 if (code == AFSCONF_SYNTAX) {
433 for (bp=tbuffer; *bp != '\n'; bp++) { /* Take out the <cr> from the buffer */
437 fprintf(stderr, "Can't properly parse host line \"%s\" in configuration file %s\n", tbuffer, tbuf1);
441 afsconf_CloseInternal(adir);
444 curEntry->cellInfo.numServers = ++i;
447 fclose(tf); /* close the file now */
449 /* end the last partially-completed cell */
451 curEntry->next = adir->entries;
452 adir->entries = curEntry;
455 /* now read the fs keys, if possible */
456 adir->keystr = (struct afsconf_keys *) 0;
457 afsconf_IntGetKeys(adir);
462 /* parse a line of the form
463 *"128.2.1.3 #hostname" or
464 *"[128.2.1.3] #hostname" for clones
465 * into the appropriate pieces.
467 static ParseHostLine(aline, addr, aname, aclone)
469 register struct sockaddr_in *addr;
473 register afs_int32 code;
477 if (aclone) *aclone = 1;
478 code = sscanf(aline, "[%d.%d.%d.%d] #%s", &c1, &c2, &c3, &c4, aname);
480 if (aclone) *aclone = 0;
481 code = sscanf(aline, "%d.%d.%d.%d #%s", &c1, &c2, &c3, &c4, aname);
483 if (code != 5) return AFSCONF_SYNTAX;
484 addr->sin_family = AF_INET;
486 tp = (char *) &addr->sin_addr;
494 /* parse a line of the form
495 * ">cellname [linkedcellname] [#comments]"
496 * into the appropriate pieces.
498 static ParseCellLine(aline, aname, alname)
499 register char *aline, *aname, *alname; {
501 code = sscanf(aline, ">%s %s", aname, alname);
502 if (code == 1) *alname = '\0';
504 if (*alname == '#') {
508 return (code > 0 ? 0 : AFSCONF_SYNTAX);
511 /* call aproc(entry, arock, adir) for all cells. Proc must return 0, or we'll stop early and return the code it returns */
512 afsconf_CellApply(adir, aproc, arock)
513 struct afsconf_dir *adir;
516 register struct afsconf_entry *tde;
517 register afs_int32 code;
519 for(tde=adir->entries; tde; tde=tde->next) {
520 code = (*aproc)(&tde->cellInfo, arock, adir);
530 afs_int32 afsconf_SawCell = 0;
532 afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones)
533 struct afsconf_dir *adir;
536 struct afsconf_cell *acellInfo;
542 code = afsconf_GetCellInfo(adir, acellName, aservice, acellInfo);
549 cell = (char *) &acellInfo->name;
551 code = afsconf_OpenInternal(adir, cell, clones);
556 afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
559 struct afsconf_cell *acellInfo;
564 unsigned char answer[1024];
570 /* The resolver isn't always MT-safe.. Perhaps this ought to be
571 * replaced with a more fine-grained lock just for the resolver
575 len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
579 return AFSCONF_NOTFOUND;
581 p = answer + sizeof(HEADER); /* Skip header */
582 code = dn_expand(answer, answer + len, p, host, sizeof(host));
584 return AFSCONF_NOTFOUND;
585 strncpy(acellInfo->name, host, sizeof(acellInfo->name));
587 p += code + QFIXEDSZ; /* Skip name */
589 while (p < answer + len) {
592 code = dn_expand(answer, answer + len, p, host, sizeof(host));
594 return AFSCONF_NOTFOUND;
596 p += code; /* Skip the name */
597 type = (p[0] << 8) | p[1];
598 p += 4; /* Skip type and class */
599 ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
600 p += 4; /* Skip the TTL */
601 size = (p[0] << 8) | p[1];
602 p += 2; /* Skip the size */
604 if (type == T_AFSDB) {
608 afsdb_type = (p[0] << 8) | p[1];
609 code = dn_expand(answer, answer+len, p+2, host, sizeof(host));
611 return AFSCONF_NOTFOUND;
613 if ((afsdb_type == 1) &&
614 (server_num < MAXHOSTSPERCELL) &&
615 /* Do we want to get TTL data for the A record as well? */
616 (he = gethostbyname(host))) {
618 memcpy(&ipaddr, he->h_addr, he->h_length);
619 acellInfo->hostAddr[server_num].sin_addr.s_addr = ipaddr;
620 strncpy(acellInfo->hostName[server_num], host,
621 sizeof(acellInfo->hostName[server_num]));
624 if (!minttl || ttl < minttl) minttl = ttl;
631 if (server_num == 0) /* No AFSDB records */
632 return AFSCONF_NOTFOUND;
633 acellInfo->numServers = server_num;
636 tservice = afsconf_FindService(aservice);
638 return AFSCONF_NOTFOUND; /* service not found */
639 for (i=0; i<acellInfo->numServers; i++) {
640 acellInfo->hostAddr[i].sin_port = tservice;
644 acellInfo->timeout = minttl ? (time(0) + minttl) : 0;
648 #endif /* AFS_AFSDB_ENV */
650 afsconf_GetCellInfo(adir, acellName, aservice, acellInfo)
651 struct afsconf_dir *adir;
654 struct afsconf_cell *acellInfo; {
655 register struct afsconf_entry *tce;
656 struct afsconf_entry *bestce;
657 register afs_int32 i;
665 if (adir) afsconf_Check(adir);
668 cnLen = strlen(tcell)+1;
669 lcstring (tcell, tcell, cnLen);
670 afsconf_SawCell = 1; /* will ignore the AFSCELL switch on future */
671 /* call to afsconf_GetLocalCell: like klog */
673 i = afsconf_GetLocalCell(adir, tbuffer, sizeof(tbuffer));
680 cnLen = strlen(tcell);
681 bestce = (struct afsconf_entry *) 0;
687 for(tce=adir->entries;tce;tce=tce->next) {
688 if (strcasecmp(tce->cellInfo.name, tcell) == 0) {
694 if (strlen(tce->cellInfo.name) < cnLen) continue; /* clearly wrong */
695 if (strncasecmp(tce->cellInfo.name, tcell, cnLen) == 0) {
696 if (bestce) ambig = 1; /* ambiguous unless we get exact match */
700 if (!ambig && bestce) {
701 *acellInfo = bestce->cellInfo; /* structure assignment */
703 tservice = afsconf_FindService(aservice);
706 return AFSCONF_NOTFOUND; /* service not found */
708 for(i=0;i<acellInfo->numServers;i++) {
709 acellInfo->hostAddr[i].sin_port = tservice;
712 acellInfo->timeout = 0;
719 return afsconf_GetAfsdbInfo(acellName, aservice, acellInfo);
721 return AFSCONF_NOTFOUND;
722 #endif /* AFS_AFSDB_ENV */
726 afsconf_GetLocalCell(adir, aname, alen)
727 register struct afsconf_dir *adir;
730 static int afsconf_showcell = 0;
737 * If a cell switch was specified in a command, then it should override the
738 * AFSCELL variable. If a cell was specified, then the afsconf_SawCell flag
739 * is set and the cell name in the adir structure is used.
740 * Read the AFSCELL var each time: in case it changes (unsetenv AFSCELL).
742 if ( !afsconf_SawCell && (afscell_path= getenv("AFSCELL")) ) {
743 if ( !afsconf_showcell ) {
744 fprintf(stderr, "Note: Operation is performed on cell %s\n", afscell_path);
745 afsconf_showcell = 1;
747 strncpy(aname, afscell_path, alen);
750 if (adir->cellName) {
751 strncpy(aname, adir->cellName, alen);
753 else code = AFSCONF_UNKNOWN;
761 struct afsconf_dir *adir; {
763 afsconf_CloseInternal(adir);
764 if (adir->name) free(adir->name);
770 static int afsconf_CloseInternal(adir)
771 register struct afsconf_dir *adir; {
772 register struct afsconf_entry *td, *nd;
773 register char *tname;
775 tname = adir->name; /* remember name, since that's all we preserve */
777 /* free everything we can find */
778 if (adir->cellName) free(adir->cellName);
779 for(td=adir->entries;td;td=nd) {
781 if (td->cellInfo.linkedCell)
782 free(td->cellInfo.linkedCell);
785 if (adir->keystr) free(adir->keystr);
788 memset(adir, 0, sizeof(struct afsconf_dir));
789 adir->name = tname; /* restore it */
793 static int afsconf_Reopen(adir)
794 register struct afsconf_dir *adir; {
795 register afs_int32 code;
796 code = afsconf_CloseInternal(adir);
797 if (code) return code;
798 code = afsconf_OpenInternal(adir, 0, 0);
802 /* called during opening of config file */
803 afsconf_IntGetKeys(adir)
804 struct afsconf_dir *adir;
808 struct afsconf_keys *tstr;
809 register afs_int32 code;
812 /* NT client config dir has no KeyFile; don't risk attempting open
813 * because there might be a random file of this name if dir is shared.
815 if (IsClientConfigDirectory(adir->name)) {
816 adir->keystr = ((struct afsconf_keys *)
817 malloc(sizeof(struct afsconf_keys)));
818 adir->keystr->nkeys = 0;
821 #endif /* AFS_NT40_ENV */
824 /* compute the key name and other setup */
826 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL);
827 tstr = (struct afsconf_keys *) malloc(sizeof (struct afsconf_keys));
831 fd = open(tbuffer, O_RDONLY);
837 code = read(fd, tstr, sizeof(struct afsconf_keys));
839 if (code < sizeof(afs_int32)) {
845 /* convert key structure to host order */
846 tstr->nkeys = ntohl(tstr->nkeys);
847 for(fd=0;fd<tstr->nkeys;fd++)
848 tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno);
854 /* get keys structure */
855 afsconf_GetKeys(adir, astr)
856 struct afsconf_dir *adir;
857 struct afsconf_keys *astr;
859 register afs_int32 code;
862 code = afsconf_Check(adir);
864 return AFSCONF_FAILURE;
865 memcpy(astr, adir->keystr, sizeof(struct afsconf_keys));
871 afs_int32 afsconf_GetLatestKey(adir, avno, akey)
872 IN struct afsconf_dir *adir;
878 register struct afsconf_key *tk;
879 register afs_int32 best;
880 struct afsconf_key *bestk;
881 register afs_int32 code;
884 code = afsconf_Check(adir);
886 return AFSCONF_FAILURE;
887 maxa = adir->keystr->nkeys;
889 best = -1; /* highest kvno we've seen yet */
890 bestk = (struct afsconf_key *) 0; /* ptr to structure providing best */
891 for(tk = adir->keystr->key,i=0;i<maxa;i++,tk++) {
892 if (tk->kvno == 999) continue; /* skip bcrypt keys */
893 if (tk->kvno > best) {
898 if (bestk) { /* found any */
899 if (akey) memcpy(akey, bestk->key, 8); /* copy out latest key */
900 if (avno) *avno = bestk->kvno; /* and kvno to caller */
905 return AFSCONF_NOTFOUND; /* didn't find any keys */
908 /* get a particular key */
909 afsconf_GetKey(adir, avno, akey)
910 struct afsconf_dir *adir;
914 register int i, maxa;
915 register struct afsconf_key *tk;
916 register afs_int32 code;
919 code = afsconf_Check(adir);
921 return AFSCONF_FAILURE;
922 maxa = adir->keystr->nkeys;
924 for(tk = adir->keystr->key,i=0;i<maxa;i++,tk++) {
925 if (tk->kvno == avno) {
926 memcpy(akey, tk->key, 8);
933 return AFSCONF_NOTFOUND;
936 /* save the key structure in the appropriate file */
937 static SaveKeys(adir)
938 struct afsconf_dir *adir;
940 struct afsconf_keys tkeys;
942 register afs_int32 i;
945 memcpy(&tkeys, adir->keystr, sizeof(struct afsconf_keys));
947 /* convert it to net byte order */
948 for(i = 0; i<tkeys.nkeys; i++ )
949 tkeys.key[i].kvno = htonl(tkeys.key[i].kvno);
950 tkeys.nkeys = htonl(tkeys.nkeys);
952 /* rewrite keys file */
953 strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL);
954 fd = open(tbuffer, O_RDWR | O_CREAT | O_TRUNC, 0600);
955 if (fd < 0) return AFSCONF_FAILURE;
956 i = write(fd, &tkeys, sizeof(tkeys));
957 if (i != sizeof(tkeys)) {
959 return AFSCONF_FAILURE;
961 if (close(fd) < 0) return AFSCONF_FAILURE;
965 afsconf_AddKey(adir, akvno, akey, overwrite)
966 struct afsconf_dir *adir;
967 afs_int32 akvno, overwrite;
970 register struct afsconf_keys *tk;
971 register struct afsconf_key *tkey;
972 register afs_int32 i;
979 if (akvno < 0 || akvno > 255) {
985 for(i=0, tkey = tk->key; i<tk->nkeys; i++, tkey++) {
986 if (tkey->kvno == akvno) {
989 return AFSCONF_KEYINUSE;
996 if (tk->nkeys >= AFSCONF_MAXKEYS) {
1000 tkey = &tk->key[tk->nkeys++];
1003 memcpy(tkey->key, akey, 8);
1005 afsconf_Touch(adir);
1010 /* this proc works by sliding the other guys down, rather than using a funny
1011 kvno value, so that callers can count on getting a good key in key[0].
1013 afsconf_DeleteKey(adir, akvno)
1014 struct afsconf_dir *adir;
1017 register struct afsconf_keys *tk;
1018 register struct afsconf_key *tkey;
1025 for(i=0, tkey = tk->key; i<tk->nkeys; i++, tkey++) {
1026 if (tkey->kvno == akvno) {
1033 return AFSCONF_NOTFOUND;
1036 /* otherwise slide the others down. i and tkey point at the guy to delete */
1037 for(;i<tk->nkeys-1; i++,tkey++) {
1038 tkey->kvno = (tkey+1)->kvno;
1039 memcpy(tkey->key, (tkey+1)->key, 8);
1043 afsconf_Touch(adir);