Commit ced6c68a authored by Jonathon Duerig's avatar Jonathon Duerig

Update 22: Update flash policy server on protogeni installs.

parent 5f939002
......@@ -15,7 +15,7 @@ use vars qw(@EXPORT $TOP_OBJDIR $TOP_SRCDIR
$PORTSDIR $VARRUN $RCDIR $MYSQL $DBNAME
$PROJROOT $PROTOUSER $WAP
$SQL_UPDATE_MAJOR_REVISION $INSTALL_UPDATE_MAJOR_REVISION
$HAVE_XERCES $PROTOGENI_RPCNAME
$HAVE_XERCES $PROTOGENI_RPCNAME $PROTOGENI_RPCPORT
$INSTALL_APACHE_CONFIG $APACHE_VERSION $APACHE_START_COMMAND);
@EXPORT = qw($TOP_OBJDIR $TOP_SRCDIR
......@@ -23,7 +23,7 @@ use vars qw(@EXPORT $TOP_OBJDIR $TOP_SRCDIR
$PORTSDIR $VARRUN $RCDIR $MYSQL $DBNAME
$PROJROOT $PROTOUSER $WAP
$SQL_UPDATE_MAJOR_REVISION $INSTALL_UPDATE_MAJOR_REVISION
$HAVE_XERCES $PROTOGENI_RPCNAME
$HAVE_XERCES $PROTOGENI_RPCNAME $PROTOGENI_RPCPORT
$INSTALL_APACHE_CONFIG $APACHE_VERSION $APACHE_START_COMMAND);
# Configure variables
......@@ -50,6 +50,7 @@ $INSTALL_APACHE_CONFIG = "@INSTALL_APACHE_CONFIG@";
$APACHE_VERSION = "@APACHE_VERSION@";
$APACHE_START_COMMAND = "@APACHE_START_COMMAND@";
$PROTOGENI_RPCNAME = "@PROTOGENI_RPCNAME@";
$PROTOGENI_RPCPORT = "@PROTOGENI_RPCPORT@";
# Change these if the major numbers in sql/updates or install/updates
# are changed.
......
#
# Update Flash policy server implemented via inetd
#
use strict;
use libinstall;
my $SERVICES_CONF = "/etc/services";
my $INETD_CONF = "/etc/inetd.conf";
my $INET_LINE = "'flashpolicy stream tcp nowait root /bin/echo /bin/echo '\\''<cross-domain-policy> <site-control permitted-cross-domain-policies=\"master-only\"/> <allow-access-from domain=\"*\" to-ports=\"80,443,$PROTOGENI_RPCPORT\"/> </cross-domain-policy>'\\'";
my $SERVICES_LINE = "'flashpolicy 843/tcp'";
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
if ($PGENISUPPORT) {
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
Phase "services", "Updating $SERVICES_CONF", sub {
PhaseSkip("Already updated")
if `grep 'flashpolicy' $SERVICES_CONF`;
BackUpFileFatal($SERVICES_CONF);
ExecQuietFatal("echo $SERVICES_LINE >> $SERVICES_CONF");
};
Phase "inetd", "Updating inetd services", sub {
Phase "inetd.conf", "Updating $INETD_CONF", sub {
BackUpFileFatal($INETD_CONF);
ExecQuietFatal("sed -i .orig -e '/^flashpolicy/d' $INETD_CONF");
ExecQuietFatal("echo $INET_LINE >> $INETD_CONF");
};
Phase "inetd", "Restarting inetd", sub {
HUPDaemon("inetd");
};
};
}
}
return 0;
}
1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment