mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
iucvterm/ts-shell: Add Perl taint tests for auditdir and getpwuid()
The audit directory ts-shell configuration and also the output of getpwuid() are considered tainted when running in Perl taint (-T) mode. Provide untaint checks with validating the content. Reviewed-by: Jan Höppner <hoeppner@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:
committed by
Jan Höppner
parent
f216862052
commit
b3dd05e16d
@@ -227,6 +227,16 @@ sub checkConfiguration(\%)
|
|||||||
exit 7;
|
exit 7;
|
||||||
}
|
}
|
||||||
$cfg->{iucvconn} = $1;
|
$cfg->{iucvconn} = $1;
|
||||||
|
|
||||||
|
# Validate transcript-directory to untaint for later use
|
||||||
|
unless ($cfg->{auditdir} =~ m#^(/[\w./-]+)$#) {
|
||||||
|
log_error "Invalid transcript-directory configuration";
|
||||||
|
exit 8;
|
||||||
|
}
|
||||||
|
$cfg->{auditdir} = $1;
|
||||||
|
|
||||||
|
# Untaint user name (tainted by getpwuid) for use in filesystem paths
|
||||||
|
($cfg->{user}) = ($cfg->{user} =~ /^([\w.-]+)$/);
|
||||||
}
|
}
|
||||||
|
|
||||||
# loadAuthorization() - Load system authorizations from file
|
# loadAuthorization() - Load system authorizations from file
|
||||||
|
|||||||
Reference in New Issue
Block a user