diff options
author | Rich Megginson <rmeggins@redhat.com> | 2005-03-15 04:07:49 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2005-03-15 04:07:49 +0000 |
commit | 3d8c5863ce389c83359cb6a5e285fd535ac77e86 (patch) | |
tree | 62d2f6a0f091dbb85c9cdf6013b12f738035296b /ldap | |
parent | 4fae1bc846878534f847aa783505ee960eab261a (diff) | |
download | ds-3d8c5863ce389c83359cb6a5e285fd535ac77e86.tar.gz ds-3d8c5863ce389c83359cb6a5e285fd535ac77e86.tar.xz ds-3d8c5863ce389c83359cb6a5e285fd535ac77e86.zip |
When creating a script, if the destination directory does not exist, just print a notice and skip that script. This is to allow the open source instance creator to skip creating the repl monitor script in admin/admin which does not yet exist.
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/admin/src/create_instance.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c index 301584c6..c0883542 100644 --- a/ldap/admin/src/create_instance.c +++ b/ldap/admin/src/create_instance.c @@ -736,6 +736,11 @@ char *gen_perl_script(char *s_root, char *cs_path, char *name, char *fmt, ...) FILE *f; va_list args; + if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) { + printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name); + return NULL; + } + PR_snprintf(fn, sizeof(fn), "%s%c%s", cs_path, FILE_PATHSEP, name); PR_snprintf(myperl, sizeof(myperl), "%s%cbin%cslapd%cadmin%cbin%cperl", s_root, FILE_PATHSEP, FILE_PATHSEP, @@ -777,6 +782,11 @@ char *gen_perl_script_auto(char *s_root, char *cs_path, char *name, char fn[PATH_SIZE], ofn[PATH_SIZE]; const char *table[10][2]; + if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) { + printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name); + return NULL; + } + PR_snprintf(ofn, sizeof(ofn), "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s", s_root, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, name); |