]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Print more info about failing permissions checks
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Jul 2018 21:39:37 +0000 (17:39 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Jul 2018 21:39:37 +0000 (17:39 -0400)
src/main/cf_file.c

index d7e9b1657ef3ca9d838ff5765c16aea9a03efbe1..8cd740c88903effdfeedd2bb9f204e1bdc9e131c 100644 (file)
@@ -542,27 +542,27 @@ bool cf_file_check(CONF_SECTION *cs, char const *filename, bool check_perms)
 
                if ((conf_check_gid != (gid_t)-1) && ((egid = getegid()) != conf_check_gid)) {
                        if (setegid(conf_check_gid) < 0) {
-                               ERROR("Failed setting effective group ID for file check");
+                               ERROR("Failed setting effective group ID (%i) for file check: %s", fr_syserror(errno));
                                goto error;
                        }
                }
                if ((conf_check_uid != (uid_t)-1) && ((euid = geteuid()) != conf_check_uid)) {
                        if (seteuid(conf_check_uid) < 0) {
-                               ERROR("Failed setting effective user ID for file check");
+                               ERROR("Failed setting effective user ID (%i) for file check: %s", fr_syserror(errno));
                                goto error;
                        }
                }
                fd = open(filename, O_RDONLY);
                if (conf_check_uid != euid) {
                        if (seteuid(euid) < 0) {
-                               ERROR("Failed restoring effective user ID after file check");
+                               ERROR("Failed restoring effective user ID (%i) after file check", fr_syserror(errno));
 
                                goto error;
                        }
                }
                if (conf_check_gid != egid) {
                        if (setegid(egid) < 0) {
-                               ERROR("Failed restoring effective group ID after file check");
+                               ERROR("Failed restoring effective group ID (%i) after file check", fr_syserror(errno));
                                goto error;
                        }
                }
@@ -1842,7 +1842,7 @@ int cf_section_write(FILE *fp, CONF_SECTION *cs, int depth)
         *      out the parsed condition, instead of the input text
         *
         *      cf_data_find(cs, CF_DATA_TYPE_UNLANG, "if");
-        */     
+        */
        if (cs->name2) {
                fr_cond_t *c;