return code;
}
-/* write ThisCell and CellServDB containing exactly one cell's info specified
- by acellInfo parm. Useful only on the server (which describes only one cell).
-*/
-
static int
VerifyEntries(struct afsconf_cell *aci)
{
return 0;
}
-/* Changed the interface to accept the afsconf_dir datastructure.
- This is a handle to the internal cache that is maintained by the bosserver.
- */
-
+/**
+ * Set cell information (deprecated)
+ *
+ * Write ThisCell and CellServDB containing exactly one cell's info specified
+ * by acellInfo param. Useful only on the server (which describes only one
+ * cell).
+ *
+ * @param adir cell configuation data; may be NULL
+ * @param apath cell configuration path
+ * @param acellInfo cell information
+ *
+ * @note This interface was changed at some point to optionally accept the
+ * afsconf_dir data structure. This is a handle to the internal cache
+ * that is maintained by the bosserver.
+ *
+ * @return 0 on success
+ */
int
afsconf_SetCellInfo(struct afsconf_dir *adir, const char *apath,
struct afsconf_cell *acellInfo)
return code;
}
+/**
+ * Set cell information
+ *
+ * Write ThisCell and CellServDB containing exactly one cell's info specified
+ * by acellInfo param. Useful only on the server (which describes only one
+ * cell).
+ *
+ * @param adir cell configuation data; may be NULL
+ * @param apath cell configuration path
+ * @param acellInfo cell information
+ * @param clones array of booleans to indicate which hosts are clones
+ *
+ * @return 0 on success
+ */
int
afsconf_SetExtendedCellInfo(struct afsconf_dir *adir,
const char *apath,
FILE *tf;
afs_int32 i;
+ opr_Assert(apath);
+ opr_Assert(acellInfo);
+
LOCK_GLOBAL_MUTEX;
/* write ThisCell file */
strcompose(tbuffer, 1024, apath, "/", AFSDIR_THISCELL_FILE, (char *)NULL);
}
/* write CellServDB */
- tf = fopen(adir->cellservDB, "w");
+ if (adir) {
+ tf = fopen(adir->cellservDB, "w");
+ } else {
+ char *cellservDB = NULL;
+ _afsconf_CellServDBPath(apath, &cellservDB);
+ if (cellservDB)
+ tf = fopen(cellservDB, "w");
+ else
+ tf = NULL;
+ free(cellservDB);
+ }
if (!tf) {
UNLOCK_GLOBAL_MUTEX;
return AFSCONF_NOTFOUND;