[webmin-devel] Patches for sshd and init
David Lam <[email protected]> Fri, 27 Jul 2012 11:16:44 -0500
| Newsgroups | gmane.comp.web.webmin.devel |
|---|---|
| Message-ID | <OF16B9E56D.62A46D4E-ON87257A48.00594AB0-86257A48.00596C6D@us.ibm.com> |
--===============0125460355414736534==
Content-type: multipart/alternative;
Boundary="0__=08BBF0DBDFCACC208f9e8a93df938690918c08BBF0DBDFCACC20"
Content-Disposition: inline
--0__=08BBF0DBDFCACC208f9e8a93df938690918c08BBF0DBDFCACC20
Content-type: text/plain; charset=US-ASCII
Hi,
Sorry for the previous posts - should have sent reply in plain-text.
I think these two patches are correct.
init-lib.patch - Upstart services should call "initctl" instead of
"service".
diff --git init/init-lib.pl init/init-lib.pl
index 89301d5..37eb8dc 100755
--- init/init-lib.pl
+++ init/init-lib.pl
@@ -1695,7 +1695,7 @@ sub start_upstart_service
{
my ($name) = @_;
my $out = &backquote_logged(
- "service ".quotemeta($name)." start 2>&1 </dev/null");
+ "initctl start ".quotemeta($name)." 2>&1 </dev/null");
return (!$?, $out);
}
@@ -1708,7 +1708,7 @@ sub stop_upstart_service
{
my ($name) = @_;
my $out = &backquote_logged(
- "service ".quotemeta($name)." stop 2>&1 </dev/null");
+ "initctl stop ".quotemeta($name)." 2>&1 </dev/null");
return (!$?, $out);
}
@@ -1721,7 +1721,7 @@ sub restart_upstart_service
{
my ($name) = @_;
my $out = &backquote_logged(
- "service ".quotemeta($name)." restart 2>&1 </dev/null");
+ "initctl restart ".quotemeta($name)." 2>&1 </dev/null");
return (!$?, $out);
}
webmin-sshd.patch - Fixed typo and changed "rsa" to "dsa". Added 'AUTHPRIV'
to list of syslog facility codes.
diff --git sshd/edit_users.cgi sshd/edit_users.cgi
index a72f1ff..8acb0b0 100755
--- sshd/edit_users.cgi
+++ sshd/edit_users.cgi
@@ -84,7 +84,7 @@ if ($version{'type'} ne 'ssh' || $version{'number'} < 3)
{
# SSH 2 DSA authentication
if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) {
- $rsa = &find_value("PubkeyAuthentication", $conf);
+ $dsa = &find_value("PubkeyAuthentication", $conf);
print &ui_table_row($text{'users_dsa'},
&ui_yesno_radio('dsa', lc($dsa) ne 'no'));
}
diff --git sshd/sshd-lib.pl sshd/sshd-lib.pl
index fcbd50f..bb910b1 100755
--- sshd/sshd-lib.pl
+++ sshd/sshd-lib.pl
@@ -356,7 +356,7 @@ if (&foreign_check("syslog")) {
@facils = map { uc($_) } split(/\s+/, $sconfig{'facilities'});
}
if (!@facils) {
- @facils = ( 'DAEMON', 'USER', 'AUTH', 'LOCAL0', 'LOCAL1', 'LOCAL2',
+ @facils = ( 'DAEMON', 'USER', 'AUTH', 'AUTHPRIV', 'LOCAL0', 'LOCAL1',
'LOCAL2',
'LOCAL3', 'LOCAL4', 'LOCAL5', 'LOCAL6', 'LOCAL7' );
}
return @facils;
Thanks!
-David Lam
--0__=08BBF0DBDFCACC208f9e8a93df938690918c08BBF0DBDFCACC20
Content-type: text/html; charset=US-ASCII
Content-Disposition: inline
<html><body>
<p><tt><font size="2">Hi, </font></tt><br>
<br>
<tt><font size="2">Sorry for the previous posts - should have sent reply in plain-text.</font></tt><br>
<br>
<tt><font size="2">I think these two patches are correct.</font></tt><tt><font size="2"><br>
</font></tt><tt><font size="2"><br>
init-lib.patch - Upstart services should call "initctl" instead of "service". </font></tt><br>
<br>
<tt><font size="2">diff --git init/init-lib.pl init/init-lib.pl</font></tt><br>
<tt><font size="2">index 89301d5..37eb8dc 100755</font></tt><br>
<tt><font size="2">--- init/init-lib.pl</font></tt><br>
<tt><font size="2">+++ init/init-lib.pl</font></tt><br>
<tt><font size="2">@@ -1695,7 +1695,7 @@ sub start_upstart_service</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> my ($name) = @_;</font></tt><br>
<tt><font size="2"> my $out = &backquote_logged(</font></tt><br>
<tt><font size="2">- "service ".quotemeta($name)." start 2>&1 </dev/null");</font></tt><br>
<tt><font size="2">+ "initctl start ".quotemeta($name)." 2>&1 </dev/null");</font></tt><br>
<tt><font size="2"> return (!$?, $out);</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -1708,7 +1708,7 @@ sub stop_upstart_service</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> my ($name) = @_;</font></tt><br>
<tt><font size="2"> my $out = &backquote_logged(</font></tt><br>
<tt><font size="2">- "service ".quotemeta($name)." stop 2>&1 </dev/null");</font></tt><br>
<tt><font size="2">+ "initctl stop ".quotemeta($name)." 2>&1 </dev/null");</font></tt><br>
<tt><font size="2"> return (!$?, $out);</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -1721,7 +1721,7 @@ sub restart_upstart_service</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> my ($name) = @_;</font></tt><br>
<tt><font size="2"> my $out = &backquote_logged(</font></tt><br>
<tt><font size="2">- "service ".quotemeta($name)." restart 2>&1 </dev/null");</font></tt><br>
<tt><font size="2">+ "initctl restart ".quotemeta($name)." 2>&1 </dev/null");</font></tt><br>
<tt><font size="2"> return (!$?, $out);</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> <br>
</font></tt><tt><font size="2"><br>
webmin-sshd.patch - Fixed typo and changed "rsa" to "dsa". Added 'AUTHPRIV' to list of syslog facility codes.</font></tt><br>
<br>
<tt><font size="2">diff --git sshd/edit_users.cgi sshd/edit_users.cgi</font></tt><br>
<tt><font size="2">index a72f1ff..8acb0b0 100755</font></tt><br>
<tt><font size="2">--- sshd/edit_users.cgi</font></tt><br>
<tt><font size="2">+++ sshd/edit_users.cgi</font></tt><br>
<tt><font size="2">@@ -84,7 +84,7 @@ if ($version{'type'} ne 'ssh' || $version{'number'} < 3) {</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> # SSH 2 DSA authentication</font></tt><br>
<tt><font size="2"> if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) {</font></tt><br>
<tt><font size="2">- $rsa = &find_value("PubkeyAuthentication", $conf);</font></tt><br>
<tt><font size="2">+ $dsa = &find_value("PubkeyAuthentication", $conf);</font></tt><br>
<tt><font size="2"> print &ui_table_row($text{'users_dsa'},</font></tt><br>
<tt><font size="2"> &ui_yesno_radio('dsa', lc($dsa) ne 'no'));</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2">diff --git sshd/sshd-lib.pl sshd/sshd-lib.pl</font></tt><br>
<tt><font size="2">index fcbd50f..bb910b1 100755</font></tt><br>
<tt><font size="2">--- sshd/sshd-lib.pl</font></tt><br>
<tt><font size="2">+++ sshd/sshd-lib.pl</font></tt><br>
<tt><font size="2">@@ -356,7 +356,7 @@ if (&foreign_check("syslog")) {</font></tt><br>
<tt><font size="2"> @facils = map { uc($_) } split(/\s+/, $sconfig{'facilities'});</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> if (!@facils) {</font></tt><br>
<tt><font size="2">- @facils = ( 'DAEMON', 'USER', 'AUTH', 'LOCAL0', 'LOCAL1', 'LOCAL2',</font></tt><br>
<tt><font size="2">+ @facils = ( 'DAEMON', 'USER', 'AUTH', 'AUTHPRIV', 'LOCAL0', 'LOCAL1', 'LOCAL2',</font></tt><br>
<tt><font size="2"> 'LOCAL3', 'LOCAL4', 'LOCAL5', 'LOCAL6', 'LOCAL7' );</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> return @facils;<br>
</font></tt><tt><font size="2"><br>
Thanks!</font></tt><br>
<tt><font size="2">-David Lam</font></tt></body></html>
--0__=08BBF0DBDFCACC208f9e8a93df938690918c08BBF0DBDFCACC20--
--===============0125460355414736534==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
--===============0125460355414736534==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel
--===============0125460355414736534==--