Constrained and linear Harnack inequalities for parabolic equations