summaryrefslogtreecommitdiff
path: root/comsat
diff options
context:
space:
mode:
Diffstat (limited to 'comsat')
-rw-r--r--comsat/comsat.c19
-rw-r--r--comsat/tests/testsuite.at5
2 files changed, 10 insertions, 14 deletions
diff --git a/comsat/comsat.c b/comsat/comsat.c
index 9592e484c..e9a5a220c 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -578,6 +578,7 @@ main (int argc, char **argv)
if (test_mode)
{
+ struct passwd *pw;
char *user;
argc -= ind;
@@ -591,21 +592,13 @@ main (int argc, char **argv)
exit (EXIT_FAILURE);
}
- user = getenv ("LOGNAME");
- if (!user)
+ pw = getpwuid (getuid ());
+ if (!pw)
{
- user = getenv ("USER");
- if (!user)
- {
- struct passwd *pw = getpwuid (getuid ());
- if (!pw)
- {
- mu_error (_("cannot determine user name"));
- exit (EXIT_FAILURE);
- }
- user = pw->pw_name;
- }
+ mu_error (_("cannot determine user name"));
+ exit (EXIT_FAILURE);
}
+ user = pw->pw_name;
if (biffrc[0] == '.' && (biffrc[1] == '/' ||
(biffrc[1] == '.' && biffrc[2] == '/')))
diff --git a/comsat/tests/testsuite.at b/comsat/tests/testsuite.at
index c61308cff..4ccda9ab0 100644
--- a/comsat/tests/testsuite.at
+++ b/comsat/tests/testsuite.at
@@ -29,11 +29,14 @@ m4_pushdef([comsatcmd],[comsatd --no-site --no-user --file ./biff.rc dnl
dnl ------------------------------------------------------------
dnl BIFFTEST(DESCR, KW, DATA, CMDLINE, [STDOUT = `'], [STDERR = `'])
dnl
+dnl NOTE: The test is skipped if run as root, because .biffrc is
+dnl ignored for root (see open_rc() in action.c
+dnl
m4_pushdef([BIFFTEST],[
AT_SETUP([comsatd: $1])
AT_KEYWORDS([comsatd $2])
$3
-AT_CHECK([$4],[0],[$5],[$6])
+AT_CHECK([test -w / && AT_SKIP_TEST; $4],[0],[$5],[$6])
AT_CLEANUP])
AT_INIT

Return to:

Send suggestions and report system problems to the System administrator.