/[smeserver]/rpms/e-smith-openssh/sme10/e-smith-openssh-2.6.0-bz11147-bz11109-systemd-update.patch
ViewVC logotype

Annotation of /rpms/e-smith-openssh/sme10/e-smith-openssh-2.6.0-bz11147-bz11109-systemd-update.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Fri Dec 11 20:54:52 2020 UTC (3 years, 11 months ago) by jpp
Branch: MAIN
Changes since 1.1: +1 -1 lines
* Fri Dec 11 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-4.sme
- add support for denyhost [SME: 10939]
- move sshd to systemd [SME: 11109]
- create -update event [SME: 11147]
- add ed25519 and ecdsa hostkeys [SME: 10940]

1 jpp 1.1 diff -Nur e-smith-openssh-2.6.0.old/createlinks e-smith-openssh-2.6.0/createlinks
2     --- e-smith-openssh-2.6.0.old/createlinks 2013-02-13 18:00:35.000000000 -0500
3     +++ e-smith-openssh-2.6.0/createlinks 2020-12-11 15:30:31.663000000 -0500
4     @@ -12,6 +12,7 @@
5     console-save
6     bootstrap-console-save
7     remoteaccess-update
8     + e-smith-openssh-update
9     ));
10     }
11    
12     @@ -27,13 +28,16 @@
13     user-create
14     user-delete
15     user-modify
16     + e-smith-openssh-update
17     ));
18     }
19    
20     foreach my $event (
21     "console-save",
22     "bootstrap-console-save",
23     - "remoteaccess-update")
24     + "remoteaccess-update",
25     + "e-smith-openssh-update"
26     +)
27     {
28     event_link("sshd-conf", $event, "65");
29     }
30     @@ -42,12 +46,12 @@
31     "console-save",
32     "remoteaccess-update")
33     {
34     - safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/sshd");
35     + safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/sshd");
36     }
37    
38     -# Set up links to daemontools. Note: /etc/init.d/sshd is now obsolete.
39     -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/sshd");
40 jpp 1.2 +my $event="e-smith-openssh-update";
41 jpp 1.1 +# systemd-specific action mandatory for this package-update event
42     +event_link("systemd-reload", $event, "89");
43     +event_link("systemd-default", $event, "88");
44     +safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/sshd");
45    
46     -service_link_enhanced("sshd", "S85", "7");
47     -safe_symlink("../init.d/supervise/sshd", "root/etc/rc.d/rc6.d/K25sshd");
48     -safe_symlink("../init.d/supervise/sshd", "root/etc/rc.d/rc0.d/K25sshd");
49     diff -Nur e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA
50     --- e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA 1969-12-31 19:00:00.000000000 -0500
51     +++ e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA 2020-12-11 15:39:26.040000000 -0500
52     @@ -0,0 +1 @@
53     +HostKey /etc/ssh/ssh_host_ecdsa_key
54     diff -Nur e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519
55     --- e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 1969-12-31 19:00:00.000000000 -0500
56     +++ e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 2020-12-11 15:39:49.597000000 -0500
57     @@ -0,0 +1,2 @@
58     +HostKey /etc/ssh/ssh_host_ed25519_key
59     +
60     diff -Nur e-smith-openssh-2.6.0.old/root/sbin/e-smith/systemd/sshd-prepare e-smith-openssh-2.6.0/root/sbin/e-smith/systemd/sshd-prepare
61     --- e-smith-openssh-2.6.0.old/root/sbin/e-smith/systemd/sshd-prepare 1969-12-31 19:00:00.000000000 -0500
62     +++ e-smith-openssh-2.6.0/root/sbin/e-smith/systemd/sshd-prepare 2020-12-11 15:20:35.831000000 -0500
63     @@ -0,0 +1,97 @@
64     +#!/bin/sh
65     +
66     +# Generate host keys if they are not already present. Taken from sshd
67     +# initscript.
68     +KEYGEN=/usr/bin/ssh-keygen
69     +SSHD=/usr/sbin/sshd
70     +RSA1_KEY=/etc/ssh/ssh_host_key
71     +RSA_KEY=/etc/ssh/ssh_host_rsa_key
72     +DSA_KEY=/etc/ssh/ssh_host_dsa_key
73     +ECDSA_KEY=/etc/ssh/ssh_host_ecdsa_key
74     +ED25519_KEY=/etc/ssh/ssh_host_ed25519_key
75     +
76     +do_rsa1_keygen() {
77     + if [ ! -s $RSA1_KEY ]; then
78     + echo -n $"Generating SSH1 RSA host key: "
79     + if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
80     + chmod 600 $RSA1_KEY
81     + chmod 644 $RSA1_KEY.pub
82     + echo "Success: RSA1 key generation"
83     + echo
84     + else
85     + echo "Failure: RSA1 key generation"
86     + echo
87     + exit 1
88     + fi
89     + fi
90     +}
91     +
92     +do_rsa_keygen() {
93     + if [ ! -s $RSA_KEY ]; then
94     + echo -n $"Generating SSH2 RSA host key: "
95     + if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then
96     + chmod 600 $RSA_KEY
97     + chmod 644 $RSA_KEY.pub
98     + echo "Success: RSA key generation"
99     + echo
100     + else
101     + echo "Failure: RSA key generation"
102     + echo
103     + exit 1
104     + fi
105     + fi
106     +}
107     +do_dsa_keygen() {
108     + if [ ! -s $DSA_KEY ]; then
109     + echo -n $"Generating SSH2 DSA host key: "
110     + if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then
111     + chmod 600 $DSA_KEY
112     + chmod 644 $DSA_KEY.pub
113     + echo "Success: DSA key generation"
114     + echo
115     + else
116     + echo "Failure: DSA key generation"
117     + echo
118     + exit 1
119     + fi
120     + fi
121     +}
122     +
123     +do_ecdsa_keygen() {
124     + if [ ! -s $ECDSA_KEY ]; then
125     + echo -n $"Generating SSH2 ECDSA host key: "
126     + if $KEYGEN -q -t ecdsa -f $ECDSA_KEY -C '' -N '' >&/dev/null; then
127     + chmod 600 $ECDSA_KEY
128     + chmod 644 $ECDSA_KEY.pub
129     + echo "Success: ECDSA key generation"
130     + echo
131     + else
132     + echo "Failure: ECDSA key generation"
133     + echo
134     + exit 1
135     + fi
136     + fi
137     +}
138     +
139     +do_ed25519_keygen() {
140     + if [ ! -s $ED25519_KEY ]; then
141     + echo -n $"Generating SSH2 ED25519 host key: "
142     + if $KEYGEN -q -t ed25519 -f $ED25519_KEY -C '' -N '' >&/dev/null; then
143     + chmod 600 $ED25519_KEY
144     + chmod 644 $ED25519_KEY.pub
145     + echo "Success: ED25519 key generation"
146     + echo
147     + else
148     + echo "Failure: ED25519 key generation"
149     + echo
150     + exit 1
151     + fi
152     + fi
153     +}
154     +
155     +do_rsa1_keygen
156     +do_rsa_keygen
157     +do_dsa_keygen
158     +do_ecdsa_keygen
159     +do_ed25519_keygen
160     +exit 0;
161     diff -Nur e-smith-openssh-2.6.0.old/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf e-smith-openssh-2.6.0/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf
162     --- e-smith-openssh-2.6.0.old/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf 1969-12-31 19:00:00.000000000 -0500
163     +++ e-smith-openssh-2.6.0/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf 2020-12-11 15:25:37.919000000 -0500
164     @@ -0,0 +1,6 @@
165     +[Service]
166     +ExecStartPre=/sbin/e-smith/service-status sshd
167     +ExecStartPre=/sbin/e-smith/systemd/sshd-prepare
168     +
169     +[Install]
170     +WantedBy=sme-server.target

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed