groupdel: fix SIGSEGV when passwd does not exist
When using groupdel with a prefix, groupdel will attempt to read a passwd file to look for any user in the group. When the file does not exist it cores with segmentation fault. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1986111
This commit is contained in:
parent
387da46d73
commit
a757b458ff
@ -288,6 +288,9 @@ extern struct passwd* prefix_getpwent()
|
|||||||
if (!passwd_db_file) {
|
if (!passwd_db_file) {
|
||||||
return getpwent();
|
return getpwent();
|
||||||
}
|
}
|
||||||
|
if (!fp_pwent) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return fgetpwent(fp_pwent);
|
return fgetpwent(fp_pwent);
|
||||||
}
|
}
|
||||||
extern void prefix_endpwent()
|
extern void prefix_endpwent()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user