2 Get information about an unknown system from the HDB Permissions file.
4 Copyright (C) 1992 Ian Lance Taylor
6 This file is part of the Taylor UUCP uuconf library.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public License
10 as published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 The author of the program may be contacted at ian@airs.com or
23 c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
29 const char _uuconf_hunk_rcsid[] = "$Id$";
34 /* Get information about an unknown system from the HDB Permissions
35 file. This doesn't run the remote.unknown shell script, because
36 that's too system dependent. */
39 uuconf_hdb_system_unknown (pglobal, qsys)
41 struct uuconf_system *qsys;
43 struct sglobal *qglobal = (struct sglobal *) pglobal;
46 struct shpermissions *qperm;
47 struct uuconf_system *qalt;
49 if (! qglobal->qprocess->fhdb_read_permissions)
51 iret = _uuconf_ihread_permissions (qglobal);
52 if (iret != UUCONF_SUCCESS)
56 _uuconf_uclear_system (qsys);
57 qsys->uuconf_palloc = uuconf_malloc_block ();
58 if (qsys->uuconf_palloc == NULL)
60 qglobal->ierrno = errno;
61 return UUCONF_MALLOC_FAILED | UUCONF_ERROR_ERRNO;
66 for (qperm = qglobal->qprocess->qhdb_permissions;
72 if (qperm->pzlogname == NULL
73 || qperm->pzlogname == (char **) &_uuconf_unset)
76 for (pz = qperm->pzlogname; *pz != NULL; pz++)
85 struct uuconf_system **pq;
87 qalt = ((struct uuconf_system *)
88 uuconf_malloc (qsys->uuconf_palloc,
89 sizeof (struct uuconf_system)));
92 qglobal->ierrno = errno;
93 return UUCONF_MALLOC_FAILED | UUCONF_ERROR_ERRNO;
96 _uuconf_uclear_system (qalt);
97 for (pq = &qsys->uuconf_qalternate;
99 pq = &(*pq)->uuconf_qalternate)
104 /* We recognize LOGNAME=OTHER specially, although this
105 appears to be an SCO innovation. */
106 if (strcmp (*pz, "OTHER") == 0)
107 qalt->uuconf_zcalled_login = (char *) "ANY";
109 qalt->uuconf_zcalled_login = *pz;
110 qalt->uuconf_fcall = FALSE;
111 qsys->uuconf_fcalled = TRUE;
112 if (qperm->frequest >= 0)
113 qsys->uuconf_fsend_request = qperm->frequest;
115 qsys->uuconf_fsend_request = FALSE;
116 qsys->uuconf_fcalled_transfer = qperm->fsendfiles;
117 qsys->uuconf_pzremote_send = qperm->pzread;
118 qsys->uuconf_pzremote_receive = qperm->pzwrite;
119 qsys->uuconf_fcallback = qperm->fcallback;
120 qsys->uuconf_zlocalname = qperm->zmyname;
121 qsys->uuconf_zpubdir = qperm->zpubdir;
126 return UUCONF_NOT_FOUND;
128 /* HDB permits local requests to receive to any directory, which is
129 not the default put in by _uuconf_isystem_basic_default. We set
131 for (qalt = qsys; qalt != NULL; qalt = qalt->uuconf_qalternate)
133 iret = _uuconf_iadd_string (qglobal, (char *) ZROOTDIR,
135 &qalt->uuconf_pzlocal_receive,
136 qsys->uuconf_palloc);
137 if (iret != UUCONF_SUCCESS)
141 return _uuconf_isystem_basic_default (qglobal, qsys);