Use log_warning() instead of log_fatal() if the ticket or lecture
path is too long and just return an error. This can only happen from a misconfiguration so just ignoring the ticket/lecture file is safe.
This commit is contained in:
@@ -310,8 +310,9 @@ build_timestamp(struct passwd *pw)
|
|||||||
len = snprintf(timestamp_file, sizeof(timestamp_file), "%s/%s",
|
len = snprintf(timestamp_file, sizeof(timestamp_file), "%s/%s",
|
||||||
def_timestampdir, user_name);
|
def_timestampdir, user_name);
|
||||||
if (len <= 0 || (size_t)len >= sizeof(timestamp_file)) {
|
if (len <= 0 || (size_t)len >= sizeof(timestamp_file)) {
|
||||||
log_fatal(0, N_("timestamp path too long: %s/%s"),
|
log_warning(0, N_("timestamp path too long: %s/%s"),
|
||||||
def_timestampdir, user_name);
|
def_timestampdir, user_name);
|
||||||
|
len = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_return_int(len);
|
debug_return_int(len);
|
||||||
@@ -598,11 +599,11 @@ already_lectured(int unused)
|
|||||||
if (ts_secure_dir(def_lecture_status_dir, false, true)) {
|
if (ts_secure_dir(def_lecture_status_dir, false, true)) {
|
||||||
len = snprintf(status_file, sizeof(status_file), "%s/%s",
|
len = snprintf(status_file, sizeof(status_file), "%s/%s",
|
||||||
def_lecture_status_dir, user_name);
|
def_lecture_status_dir, user_name);
|
||||||
if (len <= 0 || (size_t)len >= sizeof(status_file)) {
|
if (len > 0 && (size_t)len < sizeof(status_file)) {
|
||||||
log_fatal(0, N_("lecture status path too long: %s/%s"),
|
debug_return_bool(stat(status_file, &sb) == 0);
|
||||||
def_lecture_status_dir, user_name);
|
|
||||||
}
|
}
|
||||||
debug_return_bool(stat(status_file, &sb) == 0);
|
log_warning(0, N_("lecture status path too long: %s/%s"),
|
||||||
|
def_lecture_status_dir, user_name);
|
||||||
}
|
}
|
||||||
debug_return_bool(false);
|
debug_return_bool(false);
|
||||||
}
|
}
|
||||||
@@ -621,8 +622,9 @@ set_lectured(void)
|
|||||||
len = snprintf(lecture_status, sizeof(lecture_status), "%s/%s",
|
len = snprintf(lecture_status, sizeof(lecture_status), "%s/%s",
|
||||||
def_lecture_status_dir, user_name);
|
def_lecture_status_dir, user_name);
|
||||||
if (len <= 0 || (size_t)len >= sizeof(lecture_status)) {
|
if (len <= 0 || (size_t)len >= sizeof(lecture_status)) {
|
||||||
log_fatal(0, N_("lecture status path too long: %s/%s"),
|
log_warning(0, N_("lecture status path too long: %s/%s"),
|
||||||
def_lecture_status_dir, user_name);
|
def_lecture_status_dir, user_name);
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sanity check lecture dir and create if missing. */
|
/* Sanity check lecture dir and create if missing. */
|
||||||
|
Reference in New Issue
Block a user