From f35d4ae72ed83c2ebb087d876d2342819189c38a Mon Sep 17 00:00:00 2001 From: "Jan F. Chadima" Date: Tue, 21 Jul 2009 08:59:16 +0000 Subject: [PATCH] changed internal-sftp context to sftpd_t --- openssh-5.2p1-sesftp.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openssh-5.2p1-sesftp.patch b/openssh-5.2p1-sesftp.patch index 7d3001b..a82cf10 100644 --- a/openssh-5.2p1-sesftp.patch +++ b/openssh-5.2p1-sesftp.patch @@ -1,6 +1,6 @@ diff -up openssh-5.2p1/session.c.sesftp openssh-5.2p1/session.c ---- openssh-5.2p1/session.c.sesftp 2009-07-16 22:34:26.000000000 +0200 -+++ openssh-5.2p1/session.c 2009-07-16 22:59:22.000000000 +0200 +--- openssh-5.2p1/session.c.sesftp 2009-07-10 20:32:04.348435048 +0200 ++++ openssh-5.2p1/session.c 2009-07-10 21:10:42.247557847 +0200 @@ -58,6 +58,7 @@ #include #include @@ -9,11 +9,13 @@ diff -up openssh-5.2p1/session.c.sesftp openssh-5.2p1/session.c #include "openbsd-compat/sys-queue.h" #include "xmalloc.h" -@@ -1816,6 +1817,7 @@ do_child(Session *s, const char *command +@@ -1816,6 +1817,9 @@ do_child(Session *s, const char *command argv[i] = NULL; optind = optreset = 1; __progname = argv[0]; -+ setcon ("system_u:system_r:sftpd_t"); ++ if (setcon ("unconfined_u:system_r:sftpd_t:s0-s0:c0.c1023") < 0) ++ logit("do_child: setcon failed witch %s", strerror (errno)); ++ exit(sftp_server_main(i, argv, s->pw)); }