Either bullet you listed is actually a frequent asked question in the Japanese grammar, that has its name:
The original sentence is in the Classical Japanese, but you can create a word-for-word translation to the modern grammar to make perfect sense.
守衛が寝ている足を狐に噛まれる
A janitor have his(?) foot bitten by a fox while sleeping.
The so-called "indirect passive" reflects the different origin of Japanese passive than English. Fortunately as in the linked post, a great portion of instances in the form AがBをCにVられる
can be easily transformed into English using A have B V-en by C
or have C V B on A
. Note that English is also equipped with special constructions for this situation.
For the "gapless relative", you can see good examples of several types in the link above too, but in general, Japanese allows you to extract any prop which is "naturally" entailed by the scene a clause describes, as a head noun to the clause. Most people, whether sleeping or not, are expected to have feet, so that 寝ている足 sounds natural and you might translate it like "the foot when (they are) sleeping" or so.