From 2899837875ed32015f8b1d970a1b23af52abb76b Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Wed, 29 Mar 2017 15:58:24 -0400 Subject: [PATCH] bozo: Do not create client directory and symlinks Each time the bosserver starts, it checks for the presence of the client configuration directory and the CellServDB and ThisCell files within it. When not found, the bosserver creates the client cell configuration directory. When the CellServDB and ThisCell files are not present in the client configuration directory, the bosserver creates symlinks to the server's CellServDB and ThisCell files. This feature of the bosserver was a convenience when older versions of vos and pts required a client configuration directory. However, modern deployments tend to use packaging, with separate client and server packages. The client configuration directory and files in it are typically managed by the client packaging. Currently, packagers must work around these symlinks created by the bosserver. Additionally, the CellServDB and ThisCell symlinks are hazardous since writing to the client-side configuration will overwrite the server configuration. This commit removes the creation the client configuration directory and the CellServDB and ThisCell symlinks during bosserver startup. This change is intended to decouple the server from the client, help to avoid overwriting the server configuration, and avoid requiring client artifacts on a server. Reviewed-on: https://gerrit.openafs.org/12586 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk (cherry picked from commit c8aae4da4fcfd22c19fc9c8835960005554ac9d6) Change-Id: I76d24eadaecd19d21f12b8bd85eca2a4888d3e4c Reviewed-on: https://gerrit.openafs.org/15512 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand --- src/bozo/bosserver.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 7286b67271..ea75030383 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -246,13 +246,9 @@ MakeDir(const char *adir) static int CreateDirs(const char *coredir) { - if ((!strncmp - (AFSDIR_USR_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, - strlen(AFSDIR_USR_DIRPATH))) - || - (!strncmp + if (!strncmp (AFSDIR_USR_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, - strlen(AFSDIR_USR_DIRPATH)))) { + strlen(AFSDIR_USR_DIRPATH))) { if (MakeDir(AFSDIR_USR_DIRPATH)) return errno; } @@ -272,29 +268,6 @@ CreateDirs(const char *coredir) return errno; if (MakeDir(AFSDIR_SERVER_LOGS_DIRPATH)) return errno; -#ifndef AFS_NT40_ENV - if (!strncmp - (AFSDIR_CLIENT_VICE_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, - strlen(AFSDIR_CLIENT_VICE_DIRPATH))) { - if (MakeDir(AFSDIR_CLIENT_VICE_DIRPATH)) - return errno; - } - if (MakeDir(AFSDIR_CLIENT_ETC_DIRPATH)) - return errno; - - if (symlink(AFSDIR_SERVER_THISCELL_FILEPATH, - AFSDIR_CLIENT_THISCELL_FILEPATH)) { - if (errno != EEXIST) { - return errno; - } - } - if (symlink(AFSDIR_SERVER_CELLSERVDB_FILEPATH, - AFSDIR_CLIENT_CELLSERVDB_FILEPATH)) { - if (errno != EEXIST) { - return errno; - } - } -#endif /* AFS_NT40_ENV */ if (coredir) { if (MakeDir(coredir)) return errno;