iucvterm/iucvtty: Validate TERM environment name

Improve handling of TERM environment processing by validating
the received terminal name.  If the terminal name is not valid,
a message will be displayed and the default terminal will be used.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Hendrik Brueckner
2026-07-06 11:30:56 +02:00
committed by Jan Höppner
parent da4b881eac
commit c85b4e54dd
4 changed files with 44 additions and 5 deletions
+1
View File
@@ -62,6 +62,7 @@ extern ssize_t __write(int, const void*, size_t);
extern int strmatch(const char *, const char *);
extern int is_regex_valid(const char *);
extern int is_client_allowed(const char *, const struct iucvterm_cfg *);
extern int is_term_valid(const char *term, size_t len);
extern void userid_cpy(char [9], const char [8]);
extern void iucv_msg_error(const char *, uint32_t);
+1 -1
View File
@@ -86,7 +86,7 @@ static inline struct iucvtty_msg *msg_alloc(uint8_t type, uint16_t size)
{
struct iucvtty_msg *m;
m = malloc(size + MSG_DATA_OFFSET);
m = calloc(1, size + MSG_DATA_OFFSET);
if (m != NULL) {
m->version = MSG_VERSION;
m->type = type;