From d92a9d31416a8366cd065886d7ff352fefce646d Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Fri, 27 Aug 2004 22:47:45 +0000 Subject: Set the define XtransFailSoft to restore the old behavior to fail softly when socket directory cannot chowned/chmod to correct user/group. This should be added on a per OS basis which hasn't been done. --- Xtransutil.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Xtransutil.c b/Xtransutil.c index 05bccca..2432ba7 100644 --- a/Xtransutil.c +++ b/Xtransutil.c @@ -533,7 +533,9 @@ trans_mkdir(char *path, int mode) PRMSG(1, "mkdir: ERROR: euid != 0," "directory %s will not be created.\n", path, 0, 0); +#ifdef FAIL_HARD return -1; +#endif } else { PRMSG(1, "mkdir: Cannot create %s with root ownership\n", path, 0, 0); @@ -544,7 +546,9 @@ trans_mkdir(char *path, int mode) if (chmod(path, mode)) { PRMSG(1, "mkdir: ERROR: Mode of %s should be set to %04o\n", path, mode, 0); +#ifdef FAIL_HARD return -1; +#endif } } else { PRMSG(1, "mkdir: ERROR: Cannot create %s\n", @@ -631,21 +635,25 @@ trans_mkdir(char *path, int mode) #endif if (updateOwner && !updatedOwner) { +#ifdef FAIL_HARD if (status & FAIL_IF_NOT_ROOT) { PRMSG(1, "mkdir: ERROR: Owner of %s must be set to root\n", path, 0, 0); return -1; } +#endif PRMSG(1, "mkdir: Owner of %s should be set to root\n", path, 0, 0); } if (updateMode && !updatedMode) { +#ifdef FAIL_HARD if (status & FAIL_IF_NOMODE) { PRMSG(1, "mkdir: ERROR: Mode of %s must be set to %04o\n", path, mode, 0); return -1; } +#endif PRMSG(1, "mkdir: Mode of %s should be set to %04o\n", path, mode, 0); if (status & WARN_NO_ACCESS) { -- cgit v1.2.1