summaryrefslogtreecommitdiffstats
path: root/login-utils/vipw.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:35 +0100
committerKarel Zak2006-12-07 00:25:35 +0100
commit2b6fc908bc368b540845a313c3b8a867c5ad9a42 (patch)
tree6fad48a239bc90515a5dc4084d6e3c3ee1f41e29 /login-utils/vipw.c
parentImported from util-linux-2.7.1 tarball. (diff)
downloadkernel-qcow2-util-linux-2b6fc908bc368b540845a313c3b8a867c5ad9a42.tar.gz
kernel-qcow2-util-linux-2b6fc908bc368b540845a313c3b8a867c5ad9a42.tar.xz
kernel-qcow2-util-linux-2b6fc908bc368b540845a313c3b8a867c5ad9a42.zip
Imported from util-linux-2.8 tarball.
Diffstat (limited to 'login-utils/vipw.c')
-rw-r--r--login-utils/vipw.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index 6eff4f3b3..a5763b105 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -39,17 +39,6 @@
* Martin Schulze's patches adapted to Util-Linux by Nicolai Langfeldt.
*/
-#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1987 Regents of the University of California.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-/*static char sccsid[] = "from: @(#)vipw.c 5.16 (Berkeley) 3/3/91";*/
-static char rcsid[] = "$Id: vipw.c,v 1.6 1997/07/06 00:12:23 aebr Exp $";
-#endif /* not lint */
-
static char version_string[] = "vipw 1.4";
#include <sys/types.h>
@@ -167,8 +156,10 @@ pw_lock()
if (ret == -1) {
if (errno == EEXIST)
(void)fprintf(stderr,
- "%s: the %s file is busy\n", progname,
- program == VIPW ? "password" : "group" );
+ "%s: the %s file is busy (%s present)\n",
+ progname,
+ program == VIPW ? "password" : "group",
+ tmp_file);
else
(void)fprintf(stderr, "%s: can't link %s: %s\n", progname,
tmp_file, strerror(errno));
@@ -213,7 +204,12 @@ pw_edit(notsetuid)
else
p = editor;
- if (!(pid = vfork())) {
+ pid = fork();
+ if (pid < 0) {
+ (void)fprintf(stderr, "%s: Cannot fork\n", progname);
+ exit(1);
+ }
+ if (!pid) {
if (notsetuid) {
(void)setgid(getgid());
(void)setuid(getuid());