-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
In the presumably rare situation where a user's owning group is not found, e.g.:
$ id -gn
id: cannot find name for group ID 3468
3468eigerDetector::writeOctet causes a segmentation fault due to dereferencing a null pointer which is returned from getgrgid() if the group isn't found. The segfault occurs shortly after IOC init and there is no helpful error message to diagnose the problem.
ADEiger/eigerApp/src/eigerDetector.cpp
Line 728 in 7f52423
| mFileOwnerGroup->put(getgrgid(mFsGid)->gr_name); |
I tested this situation with a minimal example program and compared the results for an account with a valid group and another with an invalid group ID:
// file: check_gid.cpp
#include <iostream>
#include <unistd.h>
#include <grp.h>
int main() {
struct group* p_group = getgrgid(getgid());
std::cout << p_group->gr_name << std::endl;# Account with valid gid
$ id -gn
aesbc
$ ./check_gid
aesbc
# Account with invalid gid
$ id -gn
id: cannot find name for group ID 3468
3468
$ ./check_gid
Segmentation fault (core dumped)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels