mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-26 23:34:55 +02:00
avoid inclusion of deprecated selinux/flask.h
Use string_to_security_class() instead.
This commit is contained in:
parent
2e39643936
commit
bda709b8e1
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
#include <selinux/selinux.h>
|
#include <selinux/selinux.h>
|
||||||
#include <selinux/flask.h>
|
|
||||||
#include <selinux/get_context_list.h>
|
#include <selinux/get_context_list.h>
|
||||||
|
|
||||||
#ifndef SSH_SELINUX_UNCONFINED_TYPE
|
#ifndef SSH_SELINUX_UNCONFINED_TYPE
|
||||||
@ -139,6 +138,7 @@ ssh_selinux_setup_pty(char *pwname, const char *tty)
|
|||||||
security_context_t new_tty_ctx = NULL;
|
security_context_t new_tty_ctx = NULL;
|
||||||
security_context_t user_ctx = NULL;
|
security_context_t user_ctx = NULL;
|
||||||
security_context_t old_tty_ctx = NULL;
|
security_context_t old_tty_ctx = NULL;
|
||||||
|
security_class_t chrclass;
|
||||||
|
|
||||||
if (!ssh_selinux_enabled())
|
if (!ssh_selinux_enabled())
|
||||||
return;
|
return;
|
||||||
@ -153,9 +153,12 @@ ssh_selinux_setup_pty(char *pwname, const char *tty)
|
|||||||
error("%s: getfilecon: %s", __func__, strerror(errno));
|
error("%s: getfilecon: %s", __func__, strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if ((chrclass = string_to_security_class("chr_file")) == 0) {
|
||||||
|
error("%s: couldn't get security class for chr_file", __func__);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
if (security_compute_relabel(user_ctx, old_tty_ctx,
|
if (security_compute_relabel(user_ctx, old_tty_ctx,
|
||||||
SECCLASS_CHR_FILE, &new_tty_ctx) != 0) {
|
chrclass, &new_tty_ctx) != 0) {
|
||||||
error("%s: security_compute_relabel: %s",
|
error("%s: security_compute_relabel: %s",
|
||||||
__func__, strerror(errno));
|
__func__, strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user