The following procedures should help you quickly address any issues relating to the policy file changes in Flash Player 9,0,115,0. Adobe recommends using these sections as a reference after reading the corresponding introductory sections earlier in this article.
Flash Player 9,0,115,0 introduces policy file logging, a new feature. The policy file log shows messages for every event relating to policy files—attempts to retrieve them, successes and failures in processing them, the fates of the requests that depend on them. A complete reference to the messages you will find in the policy file log can be found in Appendix B.
To use the policy file log:
Find
the location of your mm.cfg configuration file. This is a general debugging configuration file that Debug
versions of Flash Player read on startup. mm.cfg is located in your "home"
directory; here are some typical examples:
Windows: C:\Documents and Settings\username
Windows Vista: C:\Users\username
Macintosh and Linux: /home/username
Create mm.cfg if it does
not exist, then add one or both of the following lines to it:
PolicyFileLog=1 # Enables policy file logging PolicyFileLogAppend=1 # Optional; do not clear log at startup
If PolicyFileLogAppend is not enabled, each
new root-level SWF will clear the log file. If PolicyFileLogAppend is enabled, the
previous contents of the log file will always be kept, and the log file will
grow at the end.
If many different root-level SWF
files are loaded during your testing, you will probably want to enable PolicyFileLogAppend. However,
if you enable PolicyFileLogAppend,
you will probably need to manually rename or delete the log file from time to
time, since otherwise it will grow enormous, and it will be difficult to
determine where previous output ends and new output begins.
Find the location where policyfiles.txt, the policy file log, will be written. It will not necessarily exist yet; Flash Player will create it the next time a SWF file is run. You can find policyfiles.txt in the following locations:
Windows: C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs
Windows Vista: C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs
Macintosh: /Users/username/Library/Preferences/Macromedia/Flash
Player/Logs (it is unconventional for a program to write log
files to the Preferences directory, but that is in fact the case)
Linux: /home/username/.macromedia/Flash_Player/Logs
Logs directory. Verify that it has a recent modification time. Open it and verify
that at least one message appears ("Root-level SWF loaded"). If so,
policy file logging is working.As described in the section on immediate strictness, a few of the changes in Flash Player 9,0,115,0 will affect SWF content immediately, possibly causing undesired behavior in a small percentage of SWF files. If you maintain SWF content, then as soon as possible, you should do the following:
[strict]. This label is
an indication of a potential immediate issue.Make a note of any aspect of your content that does not work as you expect it to—such cases may indicate problems that you will need to debug. You should try to correlate such cases with the contents of the policy file log, and you should try to verify that such cases really do behave differently in Flash Player 9,0,115,0, by retesting these cases with an older version of Flash Player. Any cases that do not behave differently between older and newer versions of Flash Player are not issues related to policy file strictness.
If you need to uninstall Flash Player to downgrade to an older version, use the Flash Player Uninstaller. Due to security features in the ActiveX control, you will need to run the uninstaller using the "/clean" command:
uninstall_flash_player.exe /clean
To obtain an earlier version of Flash Player to test with, visit this TechNote: Archived Flash players available for testing purposes.
Classify
any [strict] messages that you find in your policy file log. These messages can include:
Content-Type declared
by the server, and will be ignored, possibly causing cross-domain access to be
denied. See this log message explanation and the
section on the Content-Type whitelist.Content-Type declared by the server, and
will be ignored, possibly causing cross-domain access to be denied. See this log message explanation and the section on the Content-Type whitelist.localhost. Strict socket rules are being applied
immediately, and access is denied. See this log
message explanation and the section on immediately strict sockets.As described in the section on meta-policies, there are two reasons you should choose and declare a meta-policy on an HTTP, HTTPS, or FTP server:
all is not applied for users of Phase 1
versions of Flash Player.If you are operating a site on a server that you do not administer, be sure to read the section on considerations for users of hosted services.
To configure a meta-policy on a server that you control:
Read the list of available meta-policies. Decide which is most appropriate for your server. Some guidelines for HTTP and HTTPS servers (FTP servers are analogous, but slightly different in the details):
none.all,
and if you choose by-content-type,
this helps ensure that the criteria for assigning a Content-Type of text/x-cross-domain-policy are impossible
for user-defined content to satisfy.all.master-only,
and help ensure that only trusted personnel can alter the contents of the master
policy file at /crossdomain.xml.If you want to permit non-master policy files at individually
approved locations, choose a meta-policy of by-content-type, and assign a Content-Type of text/x-cross-domain-policy for individually specified locations. Here is an example of an Apache configuration snippet to achieve
this:
<Location /crossdomain.xml> ForceType text/x-cross-domain-policy </Location> <Location /another/place/crossdomain.xml> ForceType text/x-cross-domain-policy </Location>
If you want to permit non-master policy files at a predetermined
set of locations, for example any file with the name crossdomain.xml, choose a meta-policy of by-content-type,
and assign a Content-Type of text/x-cross-domain-policy for any location that meets your criteria. Here is an example of an Apache configuration snippet to achieve
this:
<Files crossdomain.xml> ForceType text/x-cross-domain-policy </Files>
If your server hosts scripts that you do not want to permit to
generate policy files, add the special meta-policy none-this-response to the output of any
such scripts. Here is an example of an Apache configuration snippet to achieve this:
<Location /cgi-bin> Header set X-Permitted-Cross-Domain-Policies none-this-response </Location>
If you are
declaring your meta-policy in the master policy file, write a <site-control> tag into the master
policy file at /crossdomain.xml.
Here is an example:
<cross-domain-policy> <site-control permitted-cross-domain-policies="by-content-type"/> </cross-domain-policy>
If you are
declaring your meta-policy in an HTTP response header, configure your server to
return the appropriate X-Permitted-Cross-Domain-Policies header. Here is an example of an Apache configuration snippet to achieve this:
<Location /> Header set X-Permitted-Cross-Domain-Policies master-only </Location>
If you operate a site on a hosted service, or a server that you otherwise don't entirely control, and you serve policy files:
Use the following if you only want to use a single policy file on your site:
<site-control permitted-cross-domain-policies="master-only"/>
Use the following if you don't want any restrictions on the creation of policy files on your site:
<site-control permitted-cross-domain-policies="all"/>
As described in the section on socket policy files, there are two reasons you may want to serve a socket master policy file from port 843 on your host:
Serving a socket master policy file is not the only way to address these issues, but it is the easiest and most consistent way to address them. If you find for some reason that serving a master socket policy file from port 843 is impractical, you can address these issues on a port-by-port basis, serving non-master socket policy files from individual ports. But a socket master policy file should address an entire host at once.
To serve a socket master policy file:
Write a socket master policy file, declaring your desired socket meta-policy and any permissions that you wish to grant. Here is an example:
<cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="mysite.com" to-ports="999,8080-8082"/> </cross-domain-policy>
Note: Setting up a socket policy file server provides a brief background on the latest Flash Player socket functionality, as well as sample code for creating socket policy file servers in testing environments.