- return (EXIT_SUCCESS);
-}
-
-/* ________________________________________________________________________ */
-int deluser_main(int argc, char **argv)
-{
- /* int successful; */
- int failure;
-
- if (argc != 2) {
- show_usage();
- } else {
-
- failure = del_line_matching(argv[1], PASSWD_FILE);
- /* if (!successful) { */
- if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], PASSWD_FILE);
- }
-#ifdef CONFIG_FEATURE_SHADOWPASSWDS
- failure = del_line_matching(argv[1], SHADOW_FILE);
- /* if (!successful) { */
- if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], SHADOW_FILE);
- }
- failure = del_line_matching(argv[1], GSHADOW_FILE);
- /* if (!successful) { */
- if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], GSHADOW_FILE);
- }
-#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
- failure = del_line_matching(argv[1], GROUP_FILE);
- /* if (!successful) { */
- if (failure) {
- error_msg_and_die("%s: User could not be removed from %s\n",
- argv[1], GROUP_FILE);
- }
-
+ if (del_line_matching(argv, bb_path_group_file) < 0)
+ return EXIT_FAILURE;
+ if (ENABLE_FEATURE_SHADOWPASSWDS) {
+ del_line_matching(argv, bb_path_gshadow_file);