- else if (st.st_mode & (S_IRWXG | S_IRWXO))
- complain(p, "non-owner access permitted", 0);
+ else if (st.st_mode & S_IRWXO)
+ complain(p, "other access permitted", 0);
+ else if (!((flags & F_PRIVGRP) && st.st_gid != mygroup) &&
+ (st.st_mode & S_IRWXG))
+ complain(p, "other-group access permitted", 0);