Hi, > I would appreciate help typing in the additional code and submitting > that to upstream, so we don't have to diverge from upstream forever.
I did the typing-in part and have a small patch [1]. Before seding the PR I'd appreciate a quick sync with you. My approach was to simply add the second argument, making an sg symlink trivially work. Possible objection may be that original newgrp did not accept the command argument, thus `newgrp group some-cmd` would execute some-cmd instead of ignoring it. Also upstream advises against adding new short options [2] but I can argue that in case of `newgrp` we are returning to some established behavior (sg), or that the cited SUSv2 is not followed to the letter anyway as eg. it prescribes accepting '-' as the group name, which upstream does not do. A solution complicating the patch would be to test for argv[0] if we're called as `sg` but I found that ugly and can't decide. I'd appreciate your thoughts. BR, Gábor [1] https://github.com/util-linux/util-linux/commit/6e715fbee1893877e10098ccb8a9f388fac22958 [2] https://github.com/util-linux/util-linux/blob/25c6fc917ae4d30243ba655081ee84a839f338ba/Documentation/howto-contribute.txt#L242