From f4afe8b0b1fb6eda4684e68071d9c751b5642f38 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 27 Oct 1996 04:23:23 +0000 Subject: Fix core dump bug in default-user logic. svn path=/trunk/; revision=397 --- driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 15d2da9a..32f8c6fc 100644 --- a/driver.c +++ b/driver.c @@ -546,20 +546,20 @@ struct query *ctl; /* query control record */ find_server_names(tohdr, ctl, &xmit_names); find_server_names(cchdr, ctl, &xmit_names); find_server_names(bcchdr, ctl, &xmit_names); - - /* if nothing supplied localnames, default appropriately */ - if (!xmit_names) - save_uid(&xmit_names, -1, dfltuser); } else /* it's a single-drop box, use first localname */ #endif /* HAVE_GETHOSTBYNAME */ { if (ctl->localnames) save_uid(&xmit_names, -1, ctl->localnames->id); - else - save_uid(&xmit_names, -1, dfltuser); } + /* if nothing supplied localnames, default appropriately */ + if (getuid() == 0) + save_uid(&xmit_names, -1, ctl->remotename); + else + save_uid(&xmit_names, -1, user); + /* time to address the message */ if (ctl->mda[0]) /* we have a declared MDA */ { -- cgit v1.2.3