Not so fast:
1. Are you certain that the marketing carrier of SFO-BOS is UA? While the segment is certainly operated by UA, it is odd that the ticket is issued by LH with a first segment marketed by another carrier. Could be, but worth double-checking.
2. Is the friend connecting at BOS or is that a stopover? If bags are checked to at least FRA, the friend will have the SFO-FRA allowance.