summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/cvs.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-07 23:30:31 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-07 23:30:31 +0000
commit87dd5abad3eefefc93c8f8c66158a072d735125e (patch)
tree644fad1348d5d216da275aae1fa715589b19c631 /usr.bin/cvs/cvs.c
parentc7f0016390151b0e6c26e445ec857ba21f0a5d42 (diff)
Do not fatal if getpwuid() fails, instead ignore user configuration files.
OK joris@
Diffstat (limited to 'usr.bin/cvs/cvs.c')
-rw-r--r--usr.bin/cvs/cvs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c
index 7e2a2923759..9d4c3270c00 100644
--- a/usr.bin/cvs/cvs.c
+++ b/usr.bin/cvs/cvs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.c,v 1.130 2007/09/02 12:13:00 tobias Exp $ */
+/* $OpenBSD: cvs.c,v 1.131 2007/09/07 23:30:30 tobias Exp $ */
/*
* Copyright (c) 2006, 2007 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -157,9 +157,9 @@ main(int argc, char **argv)
}
if ((cvs_homedir = getenv("HOME")) == NULL) {
- if ((pw = getpwuid(getuid())) == NULL)
- fatal("getpwuid failed");
- cvs_homedir = pw->pw_dir;
+ if ((pw = getpwuid(getuid())) != NULL)
+ cvs_homedir = pw->pw_dir;
+
}
if ((envstr = getenv("TMPDIR")) != NULL)
@@ -184,7 +184,7 @@ main(int argc, char **argv)
else if (!S_ISDIR(st.st_mode))
fatal("`%s' is not valid temporary directory", cvs_tmpdir);
- if (cvs_readrc == 1) {
+ if (cvs_readrc == 1 && cvs_homedir != NULL) {
cvs_read_rcfile();
if (cvs_defargs != NULL) {