I'd like to start by apologizing if this is not the right SE to ask on, and appreciate any pointers in the right direction.
Something I have noticed in my courses over the years is that in addition to all the online distributions of textbooks (which I understand to be mostly illegal), I can often times find universities posting sections of books online, particularly just the exercises. Doesn't this violate the same copyright law?
Here are some examples of what I am referring to from books I have studied from in the past.
http://fermat.usach.cl/~vguinez/GeoDif/Guias/guia10.pdf (Do Carmo, Differential Geometry of Curves and Surfaces)
Here is a solution manual to about half of Brown and Churchill's book in complex analysis math.sfsu.edu/beck/papers/complex.pdf (sections of the book itself can be found as well, and it may be worth noting that this is not the university the authors were associated with, I don't know).
There are other examples from other pretty well known texts in mathematics.
How is this legal for universities to do? Do they need to consult the publisher or something first?