diff --git a/include/applets.h b/include/applets.h
index f0c6f7a..d3b75d0 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -82,7 +82,7 @@
 USE_DC(APPLET(dc, dc_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_DD(APPLET(dd, dd_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_DEALLOCVT(APPLET(deallocvt, deallocvt_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-USE_DELGROUP(APPLET(delgroup, delgroup_main, _BB_DIR_BIN, _BB_SUID_NEVER))
+USE_DELGROUP(APPLET(delgroup, deluser_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_DELUSER(APPLET(deluser, deluser_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_DEVFSD(APPLET(devfsd, devfsd_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_DF(APPLET(df, df_main, _BB_DIR_BIN, _BB_SUID_NEVER))
@@ -95,7 +95,7 @@
 USE_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER, dpkg_deb))
 USE_DU(APPLET(du, du_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_DUMPKMAP(APPLET(dumpkmap, dumpkmap_main, _BB_DIR_BIN, _BB_SUID_NEVER))
-USE_DUMPLEASES(APPLET(dumpleases, dumpleases_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+//USE_DUMPLEASES(APPLET(dumpleases, dumpleases_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_E2FSCK(APPLET(e2fsck, e2fsck_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_E2LABEL(APPLET_NOUSAGE(e2label, tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
 USE_ECHO(APPLET(echo, echo_main, _BB_DIR_BIN, _BB_SUID_NEVER))
@@ -273,8 +273,8 @@
 USE_TRUE(APPLET(true, true_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_TTY(APPLET(tty, tty_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_TUNE2FS(APPLET(tune2fs, tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
-USE_UDHCPC(APPLET(udhcpc, udhcpc_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
-USE_UDHCPD(APPLET(udhcpd, udhcpd_main, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
+//USE_UDHCPC(APPLET(udhcpc, udhcpc_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
+//USE_UDHCPD(APPLET(udhcpd, udhcpd_main, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
 USE_UMOUNT(APPLET(umount, umount_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_UNAME(APPLET(uname, uname_main, _BB_DIR_BIN, _BB_SUID_NEVER))
 USE_UNCOMPRESS(APPLET(uncompress, uncompress_main, _BB_DIR_BIN, _BB_SUID_NEVER))
diff --git a/loginutils/Makefile.in b/loginutils/Makefile.in
index c11bbfc..0063762 100644
--- a/loginutils/Makefile.in
+++ b/loginutils/Makefile.in
@@ -20,7 +20,9 @@
 LOGINUTILS-$(CONFIG_SULOGIN)	+= sulogin.o
 LOGINUTILS-$(CONFIG_VLOCK)	+= vlock.o
 LOGINUTILS-$(CONFIG_DELUSER)	+= deluser.o
-LOGINUTILS-$(CONFIG_DELGROUP)	+= delgroup.o
+LOGINUTILS-$(CONFIG_DELGROUP)	+= deluser.o
+
+LOGINUTILS-y:=$(sort $(LOGINUTILS-y))
 
 ifneq ($(strip $(LOGINUTILS-y)),)
 libraries-y+=$(LOGINUTILS_DIR)$(LOGINUTILS_AR)
diff --git a/loginutils/delgroup.c b/loginutils/delgroup.c
deleted file mode 100644
index 91edf29..0000000
--- a/loginutils/delgroup.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * deluser (remove lusers from the system ;) for TinyLogin
- *
- * Copyright (C) 1999 by Lineo, inc. and John Beppu
- * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "busybox.h"
-
-
-#if ! defined CONFIG_DELUSER
-#include "delline.c"
-#else
-extern int del_line_matching(const char *login, const char *filename);
-#endif
-
-int delgroup_main(int argc, char **argv)
-{
-	/* int successful; */
-	int failure;
-
-	if (argc != 2) {
-		bb_show_usage();
-	} else {
-
-		failure = del_line_matching(argv[1], bb_path_group_file);
-#ifdef CONFIG_FEATURE_SHADOWPASSWDS
-		if (access(bb_path_gshadow_file, W_OK) == 0) {
-			/* EDR the |= works if the error is not 0, so he had it wrong */
-			failure |= del_line_matching(argv[1], bb_path_gshadow_file);
-		}
-#endif
-		if (failure) {
-			bb_error_msg_and_die("%s: Group could not be removed\n", argv[1]);
-		}
-
-	}
-	return (EXIT_SUCCESS);
-}
-
-/* $Id: delgroup.c,v 1.2 2003/07/14 21:50:51 andersen Exp $ */
diff --git a/loginutils/delline.c b/loginutils/delline.c
deleted file mode 100644
index 8d534c8..0000000
--- a/loginutils/delline.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * deluser (remove lusers from the system ;) for TinyLogin
- *
- * Copyright (C) 1999 by Lineo, inc. and John Beppu
- * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "busybox.h"
-
-
-
-/* where to start and stop deletion */
-typedef struct {
-	size_t start;
-	size_t stop;
-} Bounds;
-
-/* An interesting side-effect of boundary()'s
- * implementation is that the first user (typically root)
- * cannot be removed.  Let's call it a feature. */
-static inline Bounds boundary(const char *buffer, const char *login)
-{
-	char needle[256];
-	char *start;
-	char *stop;
-	Bounds b;
-
-	snprintf(needle, 256, "\n%s:", login);
-	needle[255] = 0;
-	start = strstr(buffer, needle);
-	if (!start) {
-		b.start = 0;
-		b.stop = 0;
-		return b;
-	}
-	start++;
-
-	stop = index(start, '\n');	/* index is a BSD-ism */
-	b.start = start - buffer;
-	b.stop = stop - buffer;
-	return b;
-}
-
-/* grep -v ^login (except it only deletes the first match) */
-/* ...in fact, I think I'm going to simplify this later */
-int del_line_matching(const char *login, const char *filename)
-{
-	char *buffer;
-	FILE *passwd;
-	size_t len;
-	Bounds b;
-	struct stat statbuf;
-
-	/* load into buffer */
-	passwd = fopen(filename, "r");
-	if (!passwd) {
-		return 1;
-	}
-	stat(filename, &statbuf);
-	len = statbuf.st_size;
-	buffer = (char *) malloc(len * sizeof(char));
-
-	if (!buffer) {
-		fclose(passwd);
-		return 1;
-	}
-	fread(buffer, len, sizeof(char), passwd);
-
-	fclose(passwd);
-
-	/* find the user to remove */
-	b = boundary(buffer, login);
-	if (b.stop == 0) {
-		free(buffer);
-		return 1;
-	}
-
-	/* write the file w/o the user */
-	passwd = fopen(filename, "w");
-	if (!passwd) {
-		return 1;
-	}
-	fwrite(buffer, (b.start - 1), sizeof(char), passwd);
-	fwrite(&buffer[b.stop], (len - b.stop), sizeof(char), passwd);
-
-	fclose(passwd);
-
-	return 0;
-}
-
-
-/* $Id: delline.c,v 1.2 2003/07/14 21:50:51 andersen Exp $ */
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index 1cd2b01..b647537 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -4,20 +4,9 @@
  *
  * Copyright (C) 1999 by Lineo, inc. and John Beppu
  * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
+ * Unified with delgroup by Tito Ragusa <farmatito@tiscali.it>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  *
  */
 
@@ -28,39 +17,82 @@
 #include <string.h>
 #include "busybox.h"
 
+/* where to start and stop deletion */
+typedef struct {
+	size_t start;
+	size_t stop;
+} Bounds;
 
-#include "delline.c"
+/* An interesting side-effect of boundary()'s
+ * implementation is that the first user (typically root)
+ * cannot be removed.  Let's call it a feature. */
+static inline Bounds boundary(const char *buffer, const char *login)
+{
+	char needle[256];
+	char *start;
+	char *stop;
+	Bounds b;
 
-static const char deluser_format[]="%s: User could not be removed from %s";
+	snprintf(needle, 256, "\n%s:", login);
+	needle[255] = 0;
+	start = strstr(buffer, needle);
+	if (!start) {
+		b.start = 0;
+		b.stop = 0;
+		return b;
+	}
+	start++;
+
+	stop = index(start, '\n');	/* index is a BSD-ism */
+	b.start = start - buffer;
+	b.stop = stop - buffer;
+	return b;
+}
+
+/* grep -v ^login (except it only deletes the first match) */
+/* ...in fact, I think I'm going to simplify this later */
+static void del_line_matching(const char *login, const char *filename)
+{
+	char *buffer;
+	FILE *passwd;
+	Bounds b;
+	struct stat statbuf;
+
+
+	if ((passwd = bb_wfopen(filename, "r"))) {
+		xstat(filename, &statbuf);
+		buffer = (char *) xmalloc(statbuf.st_size * sizeof(char));
+		fread(buffer, statbuf.st_size, sizeof(char), passwd);
+		fclose(passwd);
+		/* find the user to remove */
+		b = boundary(buffer, login);
+		if (b.stop != 0) {
+			/* write the file w/o the user */
+			if ((passwd = bb_wfopen(filename, "w"))) {
+				fwrite(buffer, (b.start - 1), sizeof(char), passwd);
+				fwrite(&buffer[b.stop], (statbuf.st_size - b.stop), sizeof(char), passwd);
+				fclose(passwd);
+			}
+		} else {
+			bb_error_msg("Can't find '%s' in '%s'", login, filename);
+		}
+		free(buffer);
+	}
+}
 
 int deluser_main(int argc, char **argv)
 {
-	/* int successful; */
-	int failure;
-
 	if (argc != 2) {
 		bb_show_usage();
 	} else {
-
-		failure = del_line_matching(argv[1], bb_path_passwd_file);
-		if (failure) {
-			bb_error_msg_and_die(deluser_format, argv[1], bb_path_passwd_file);
+		if (ENABLE_DELUSER && bb_applet_name[3] == 'u') {
+			del_line_matching(argv[1], bb_path_passwd_file);
+			if (ENABLE_FEATURE_SHADOWPASSWDS)
+				del_line_matching(argv[1], bb_path_shadow_file);
 		}
-#ifdef CONFIG_FEATURE_SHADOWPASSWDS
-		failure = del_line_matching(argv[1], bb_path_shadow_file);
-		if (failure) {
-			bb_error_msg_and_die(deluser_format, argv[1], bb_path_shadow_file);
-		}
-		failure = del_line_matching(argv[1], bb_path_gshadow_file);
-		if (failure) {
-			bb_error_msg_and_die(deluser_format, argv[1], bb_path_gshadow_file);
-		}
-#endif
-		failure = del_line_matching(argv[1], bb_path_group_file);
-		if (failure) {
-			bb_error_msg_and_die(deluser_format, argv[1], bb_path_group_file);
-		}
-
+		del_line_matching(argv[1], bb_path_group_file);
+		if (ENABLE_FEATURE_SHADOWPASSWDS)
+			del_line_matching(argv[1], bb_path_gshadow_file);
 	}
 	return (EXIT_SUCCESS);
 }
