From fa61c4b13aa362f0124b4a7a3f5ae37b0a9de696 Mon Sep 17 00:00:00 2001 From: Michael DiBernardo Date: Sat, 9 Apr 2016 10:54:38 -0400 Subject: [PATCH] Set figure sizes for all figures. --- cluster/cluster.markdown | 13 +++++------ contingent/contingent.markdown | 2 +- image-filters/image-filters.markdown | 6 ++--- .../same-origin-policy.markdown | 22 +++++++++---------- sampler/sampler.markdown | 2 +- spreadsheet/spreadsheet.markdown | 14 ++++++------ tex/cluster.tex | 20 ++++++++++------- tex/contingent.tex | 2 +- tex/image-filters.tex | 6 ++--- tex/same-origin-policy.tex | 22 +++++++++---------- tex/sampler.tex | 2 +- tex/spreadsheet.tex | 14 ++++++------ tex/template-engine.tex | 21 ++++-------------- tex/web-server.tex | 6 ++--- web-server/web-server.markdown | 6 ++--- 15 files changed, 74 insertions(+), 84 deletions(-) diff --git a/cluster/cluster.markdown b/cluster/cluster.markdown index 6e0342f4e..3c00fed35 100644 --- a/cluster/cluster.markdown +++ b/cluster/cluster.markdown @@ -97,8 +97,7 @@ The protocol operates in a series of ballots, each led by a single member of the Each ballot has a unique ballot number based on an integer and the proposer's identity. The proposer's goal is to get a majority of cluster members, acting as acceptors, to accept its value, but only if another value has not already been decided. - -\aosafigure{cluster-images/ballot.png}{A Ballot}{500l.cluster.ballot} +\aosafigure[240pt]{cluster-images/ballot.png}{A Ballot}{500l.cluster.ballot} A ballot begins with the proposer sending a ``Prepare`` message with the ballot number *N* to the acceptors and waiting to hear from a majority (\aosafigref{500l.cluster.ballot}.) @@ -420,7 +419,7 @@ The ``Replica`` class is the most complicated role class, as it has a few closel The replica creates new proposals in response to ``Invoke`` messages from clients, selecting what it believes to be an unused slot and sending a ``Propose`` message to the current leader (\aosafigref{500l.cluster.replica}.) Furthermore, if the consensus for the selected slot is for a different proposal, the replica must re-propose with a new slot. -\aosafigure{cluster-images/replica.png}{Replica Role Control Flow}{500l.cluster.replica} +\aosafigure[240pt]{cluster-images/replica.png}{Replica Role Control Flow}{500l.cluster.replica} ``Decision`` messages represent slots on which the cluster has come to consensus. Here, replicas store the new decision, then run the state machine until it reaches an undecided slot. @@ -450,14 +449,14 @@ When the acceptor role sends a ``Promise`` to a new leader, it sends an ``Accept The active leader sends ``Active`` messages as a heartbeat (\aosafigref{500l.cluster.active}.) If no such message arrives before the ``LEADER_TIMEOUT`` expires, the replica assumes the leader is dead and moves on to the next leader. In this case, it's important that all replicas choose the *same* new leader, which we accomplish by sorting the members and selecting the next one in the list. -\aosafigure{cluster-images/active.png}{Active}{500l.cluster.active} +\aosafigure[240pt]{cluster-images/active.png}{Active}{500l.cluster.active} Finally, when a node joins the network, the bootstrap role sends a ``Join`` message (\aosafigref{500l.cluster.bootstrap}.) The replica responds with a ``Welcome`` message containing its most recent state, allowing the new node to come up to speed quickly. -\aosafigure{cluster-images/bootstrap.png}{Bootstrap}{500l.cluster.bootstrap} +\aosafigure[240pt]{cluster-images/bootstrap.png}{Bootstrap}{500l.cluster.bootstrap} ```python @@ -646,7 +645,7 @@ The leader creates a scout role when it wants to become active, in response to r The scout sends (and re-sends, if necessary) a ``Prepare`` message, and collects ``Promise`` responses until it has heard from a majority of its peers or until it has been preempted. It communicates the result back to the leader with an ``Adopted`` or ``Preempted`` message, respectively. -\aosafigure{cluster-images/leaderscout.png}{Scout}{500l.cluster.leaderscout} +\aosafigure[240pt]{cluster-images/leaderscout.png}{Scout}{500l.cluster.leaderscout} ```python @@ -705,7 +704,7 @@ Like a scout, a commander sends and re-sends ``Accept`` messages and waits for a When a proposal is accepted, the commander broadcasts a ``Decision`` message to all nodes. It responds to the leader with either ``Decided`` or ``Preempted``. -\aosafigure{cluster-images/leadercommander.png}{Commander}{500l.cluster.leadercommander} +\aosafigure[240pt]{cluster-images/leadercommander.png}{Commander}{500l.cluster.leadercommander} ```python diff --git a/contingent/contingent.markdown b/contingent/contingent.markdown index 5ee91d1f7..14705efaf 100644 --- a/contingent/contingent.markdown +++ b/contingent/contingent.markdown @@ -341,7 +341,7 @@ is as a collection of boxes and arrows — or, in mathematical terminology, *nodes* and *edges* — to form a *graph* (\aosafigref{500l.contingent.graph}). -\aosafigure[240pt]{contingent-images/figure1.png}{Three files generated by parsing three input texts.}{500l.contingent.graph} +\aosafigure[180pt]{contingent-images/figure1.png}{Three files generated by parsing three input texts.}{500l.contingent.graph} Each language in which a programmer might tackle writing a build system diff --git a/image-filters/image-filters.markdown b/image-filters/image-filters.markdown index 749ae70b2..274eadcdc 100644 --- a/image-filters/image-filters.markdown +++ b/image-filters/image-filters.markdown @@ -30,7 +30,7 @@ extracted wasn’t generally the most appealing shade, the creation took a long time (a couple of seconds per image), and it took hundreds of images to make something cool (\aosafigref{500l.imagefilters.sunflower}). -\aosafigure[240pt]{image-filters-images/sunflower.jpg}{Sunflower layout}{500l.imagefilters.sunflower} +\aosafigure[180pt]{image-filters-images/sunflower.jpg}{Sunflower layout}{500l.imagefilters.sunflower} You might think this would be discouraging, but by the time I got to this point I had learned many things that hadn’t come my way before — about color @@ -137,9 +137,9 @@ In \aosafigref{500l.imagefilters.animals}, we see a high-resolution picture of s MoMA in NYC. \aosafigref{500l.imagefilters.pixelanimals} is the same image blown up, but with just 24 x 32 pixels. -\aosafigure[240pt]{image-filters-images/animals.jpg}{Blow-up animals at MoMA NY}{500l.imagefilters.animals} +\aosafigure[180pt]{image-filters-images/animals.jpg}{Blow-up animals at MoMA NY}{500l.imagefilters.animals} -\aosafigure[240pt]{image-filters-images/pixelanimals.jpg}{Blow-up animals, blown up}{500l.imagefilters.pixelanimals} +\aosafigure[180pt]{image-filters-images/pixelanimals.jpg}{Blow-up animals, blown up}{500l.imagefilters.pixelanimals} See how it's so blurry? We call that _pixelation_, which means the image is too big for the number of pixels it diff --git a/same-origin-policy/same-origin-policy.markdown b/same-origin-policy/same-origin-policy.markdown index 9511d3123..89bf08467 100644 --- a/same-origin-policy/same-origin-policy.markdown +++ b/same-origin-policy/same-origin-policy.markdown @@ -314,9 +314,9 @@ check { Given this `check` command, the analyzer explores every possible behavior of the system (up to the specified bound), and when it finds one that violates the property, displays that instance as a *counterexample*, as shown in \aosafigref{500l.same-origin-policy.fig-http-2a} and \aosafigref{500l.same-origin-policy.fig-http-2b}. -\aosafigure[240pt]{same-origin-policy-images/fig-http-2a.png}{Counterexample at time 0}{500l.same-origin-policy.fig-http-2a} +\aosafigure[180pt]{same-origin-policy-images/fig-http-2a.png}{Counterexample at time 0}{500l.same-origin-policy.fig-http-2a} -\aosafigure[240pt]{same-origin-policy-images/fig-http-2b.png}{Counterexample at time 1}{500l.same-origin-policy.fig-http-2b} +\aosafigure[180pt]{same-origin-policy-images/fig-http-2b.png}{Counterexample at time 1}{500l.same-origin-policy.fig-http-2b} This counterexample again shows an HTTP request being made by a client, but with two different servers. (In the Alloy visualizer, @@ -798,14 +798,14 @@ confidentiality property, the analyzer generates the scenario seen in \aosafigref{500l.same-origin-policy.fig-attack-1b}, which shows how `EvilScript` may access a piece of critical data (`MyInboxInfo`). -\aosafigure[240pt]{same-origin-policy-images/fig-attack-1a.png}{Confidentiality counterexample at time 0}{500l.same-origin-policy.fig-attack-1a} -\aosafigure[240pt]{same-origin-policy-images/fig-attack-1b.png}{Confidentiality counterexample at time 1}{500l.same-origin-policy.fig-attack-1b} +\aosafigure[180pt]{same-origin-policy-images/fig-attack-1a.png}{Confidentiality counterexample at time 0}{500l.same-origin-policy.fig-attack-1a} +\aosafigure[180pt]{same-origin-policy-images/fig-attack-1b.png}{Confidentiality counterexample at time 1}{500l.same-origin-policy.fig-attack-1b} This counterexample involves two steps. In the first step (\aosafigref{500l.same-origin-policy.fig-attack-1a}), `EvilScript`, executing inside `AdBanner` from `EvilDomain`, reads the content of `InboxPage`, which originates from `EmailDomain`. In the next step (\aosafigref{500l.same-origin-policy-fig-attack-1b}), `EvilScript` sends the same content (`MyInboxInfo`) to `EvilServer` by making an `XmlHtttpRequest` call. The core of the problem here is that a script executing under one domain is able to read the content of a document from another domain; as we will see in the next section, this is exactly one of the scenarios that the SOP is designed to prevent. There may be multiple counterexamples to a single assertion. Consider \aosafigref{500l.same-origin-policy.fig-attack-2}, which shows a different way in which the system may violate the confidentiality property. -\aosafigure[240pt]{same-origin-policy-images/fig-attack-2.png}{Another confidentiality violation}{500l.same-origin-policy.fig-attack-2} +\aosafigure[180pt]{same-origin-policy-images/fig-attack-2.png}{Another confidentiality violation}{500l.same-origin-policy.fig-attack-2} In this scenario, instead of reading the content of the inbox page, `EvilScript` directly makes a `GetInboxInfo` request to `EmailServer`. @@ -1017,13 +1017,13 @@ accessing each other's DOM. The scripts running inside the documents modify their domain properties to `ExampleDomain` (which is allowed because `ExampleDomain` is a superdomain of the original domain). -\aosafigure[240pt]{same-origin-policy-images/fig-setdomain-1a.png}{Cross-origin counterexample at time 0}{500l.same-origin-policy.fig-setdomain-1a} -\aosafigure[240pt]{same-origin-policy-images/fig-setdomain-1b.png}{Cross-origin counterexample at time 1}{500l.same-origin-policy.fig-setdomain-1b} +\aosafigure[180pt]{same-origin-policy-images/fig-setdomain-1a.png}{Cross-origin counterexample at time 0}{500l.same-origin-policy.fig-setdomain-1a} +\aosafigure[180pt]{same-origin-policy-images/fig-setdomain-1b.png}{Cross-origin counterexample at time 1}{500l.same-origin-policy.fig-setdomain-1b} Having done this, they can now access each other's DOM by executing `ReadDom` or `WriteDom` operations, as in \aosafigref{500l.same-origin-policy.fig-setdomain-1c}. -\aosafigure[240pt]{same-origin-policy-images/fig-setdomain-1c.png}{Cross-origin counterexample at time 2}{500l.same-origin-policy.fig-setdomain-1c} +\aosafigure[180pt]{same-origin-policy-images/fig-setdomain-1c.png}{Cross-origin counterexample at time 2}{500l.same-origin-policy.fig-setdomain-1c} Note that when you set the domain property of both "email.example.com" and "calendar.example.com" to "example.com", you are allowing not only @@ -1033,11 +1033,11 @@ other page that has "example.com" as a superdomain constructs a special script (`EvilScript`) that runs inside the attacker's blog page (`BlogPage`). In the next step (\aosafigref{500l.same-origin-policy.fig-setdomain-2a}), the script executes the `SetDomain` operation to modify the domain property of `BlogPage` to `ExampleDomain`. -\aosafigure[240pt]{same-origin-policy-images/fig-setdomain-2a.png}{Cross-origin counterexample at time 3}{500l.same-origin-policy.fig-setdomain-2a} +\aosafigure[180pt]{same-origin-policy-images/fig-setdomain-2a.png}{Cross-origin counterexample at time 3}{500l.same-origin-policy.fig-setdomain-2a} Now that `BlogPage` has the same domain property as the other two documents, it can successfully execute the `ReadDOM` operation to access their content (\aosafigref{500l.same-origin-policy.fig-setdomain-2b}.) -\aosafigure[240pt]{same-origin-policy-images/fig-setdomain-2b.png}{Cross-origin counterexample at time 4}{500l.same-origin-policy.fig-setdomain-2b} +\aosafigure[180pt]{same-origin-policy-images/fig-setdomain-2b.png}{Cross-origin counterexample at time 4}{500l.same-origin-policy.fig-setdomain-2b} This attack points out one crucial weakness of the domain property method for cross-origin communication: The security of an application @@ -1159,7 +1159,7 @@ resource (`MySchedule`) wrapped inside the padding `Leak` (\aosafigref{500l.same In the next step (\aosafigref{500l.same-origin-policy.fig-jsonp-2}), the browser interprets the JSONP response as a call to `Leak(MySchedule)`. The rest of the attack is simple; `Leak` can simply be programmed to forward the input argument to `EvilServer`, allowing the attacker to access the victim's sensitive information. -\aosafigure[240pt]{same-origin-policy-images/fig-jsonp-2.png}{JSONP counterexample at time 1}{500l.same-origin-policy.fig-jsonp-2} +\aosafigure[180pt]{same-origin-policy-images/fig-jsonp-2.png}{JSONP counterexample at time 1}{500l.same-origin-policy.fig-jsonp-2} This attack, an example of _cross-site request forgery_ (CSRF), shows an inherent weakness of JSOPN; _any_ site on the web can make a JSONP request simply by including a `