|
Jan F. Chadima |
1b8a26 |
diff -up openssh-5.6p1/contrib/ssh-copy-id.selabel openssh-5.6p1/contrib/ssh-copy-id
|
|
Jan F. Chadima |
1b8a26 |
--- openssh-5.6p1/contrib/ssh-copy-id.selabel 2010-08-10 05:36:09.000000000 +0200
|
|
Jan F. Chadima |
1b8a26 |
+++ openssh-5.6p1/contrib/ssh-copy-id 2010-08-23 12:50:20.000000000 +0200
|
|
Jan F. Chadima |
1b8a26 |
@@ -41,7 +41,7 @@ fi
|
|
Jan F. Chadima |
1b8a26 |
# strip any trailing colon
|
|
Jan F. Chadima |
1b8a26 |
host=`echo $1 | sed 's/:$//'`
|
|
Jan F. Chadima |
ca05b3 |
|
|
Jan F. Chadima |
1b8a26 |
-{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys" || exit 1
|
|
Jan F. Chadima |
1b8a26 |
+{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys; test -x /sbin/restorecon && /sbin/restorecon ~/.ssh ~/.ssh/authorized_keys" || exit 1
|
|
Jan F. Chadima |
ca05b3 |
|
|
Jan F. Chadima |
ca05b3 |
cat <
|
|
Jan F. Chadima |
1b8a26 |
Now try logging into the machine, with "ssh '$host'", and check in:
|
|
Jan F. Chadima |
1b8a26 |
diff -up openssh-5.6p1/Makefile.in.selabel openssh-5.6p1/Makefile.in
|
|
Jan F. Chadima |
1b8a26 |
--- openssh-5.6p1/Makefile.in.selabel 2010-08-23 12:47:39.000000000 +0200
|
|
Jan F. Chadima |
1b8a26 |
+++ openssh-5.6p1/Makefile.in 2010-08-23 12:47:39.000000000 +0200
|
|
Jan F. Chadima |
1b8a26 |
@@ -141,7 +141,7 @@ libssh.a: $(LIBSSH_OBJS)
|
|
Jan F. Chadima |
ca05b3 |
$(RANLIB) $@
|
|
Jan F. Chadima |
ca05b3 |
|
|
Jan F. Chadima |
ca05b3 |
ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
|
|
Jan F. Chadima |
ca05b3 |
- $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Jan F. Chadima |
ca05b3 |
+ $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck -lselinux $(LIBS)
|
|
Jan F. Chadima |
ca05b3 |
|
|
Jan F. Chadima |
ca05b3 |
sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS)
|
|
Jan F. Chadima |
c54a8b |
$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(SSHDLIBS) $(LIBS)
|
|
Jan F. Chadima |
1b8a26 |
diff -up openssh-5.6p1/ssh.c.selabel openssh-5.6p1/ssh.c
|
|
Jan F. Chadima |
1b8a26 |
--- openssh-5.6p1/ssh.c.selabel 2010-08-23 12:47:39.000000000 +0200
|
|
Jan F. Chadima |
1b8a26 |
+++ openssh-5.6p1/ssh.c 2010-08-23 12:47:39.000000000 +0200
|
|
Jan F. Chadima |
ca05b3 |
@@ -74,6 +74,7 @@
|
|
Jan F. Chadima |
ca05b3 |
#include <openssl/err.h>
|
|
Jan F. Chadima |
ca05b3 |
#include <openssl/fips.h>
|
|
Jan F. Chadima |
ca05b3 |
#include <fipscheck.h>
|
|
Jan F. Chadima |
ca05b3 |
+#include <selinux/selinux.h>
|
|
Jan F. Chadima |
ca05b3 |
#include "openbsd-compat/openssl-compat.h"
|
|
Jan F. Chadima |
ca05b3 |
#include "openbsd-compat/sys-queue.h"
|
|
Jan F. Chadima |
ca05b3 |
|
|
Jan F. Chadima |
1b8a26 |
@@ -848,10 +849,15 @@ main(int ac, char **av)
|
|
Jan F. Chadima |
ca05b3 |
*/
|
|
Jan F. Chadima |
3d6b00 |
r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir,
|
|
Jan F. Chadima |
ca05b3 |
strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR);
|
|
Jan F. Chadima |
3d6b00 |
- if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0)
|
|
Jan F. Chadima |
3d6b00 |
+ if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) {
|
|
Jan F. Chadima |
ca05b3 |
+ char *scon;
|
|
Jan F. Chadima |
ca05b3 |
+
|
|
Jan F. Chadima |
ca05b3 |
+ matchpathcon(buf, 0700, &scon);
|
|
Jan F. Chadima |
ca05b3 |
+ setfscreatecon(scon);
|
|
Jan F. Chadima |
ca05b3 |
if (mkdir(buf, 0700) < 0)
|
|
Jan F. Chadima |
ca05b3 |
error("Could not create directory '%.200s'.", buf);
|
|
Jan F. Chadima |
ca05b3 |
-
|
|
Jan F. Chadima |
ca05b3 |
+ setfscreatecon(NULL);
|
|
Jan F. Chadima |
ca05b3 |
+ }
|
|
Jan F. Chadima |
ca05b3 |
/* load options.identity_files */
|
|
Jan F. Chadima |
ca05b3 |
load_public_identity_files();
|
|
Jan F. Chadima |
ca05b3 |
|