Is it required to lock /etc/group before calling getgrouplist() syscall.
Assume some other process is modifying /etc/group using command/ or syscall ?
So is it required any preventive mechanism to avoid any race condition/file corruption ?
getgrouplist requires file locking
Re: getgrouplist requires file locking
(unless I misunderstand you). Yes, it's locked - assuming write exclusive lock - you can spin around waiting for the lock to be released or fail.