The electrically operated lock of a door is enclosed in a housing of irregular shape. This housing consists of a main (2) and an auxiliary housing (2') which are bolted together. The joint face between the main and auxiliary parts is sealed with an 0-ring (119) which fits in a groove in the main housing (2). This groove follows the perimeter of the joint face and is of irregular shape. The 0-ring (119) is provided with a number of integrally formed devices consisting of short radial ribs which extend over a short length of the 0-ring. These radial ribs give the 0-ring a star-shaped cross-section in the regions where they occur. These ribs retain the 0-ring in the groove.