From dda3f5aab91553690f6cede95e45327b4c03e0bb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 17 Jan 1998 23:05:49 +0000 Subject: Scott Burson's USER hack. svn path=/trunk/; revision=1583 --- fetchmail.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 7f78eae6..506c11e7 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -645,19 +645,13 @@ static int load_params(int argc, char **argv, int optind) exit(PS_SYNTAX); } - /* make sure delivery will default to a real local user */ + /* if `user' doesn't name a real local user, try to run as root */ if ((pw = getpwnam(user)) == (struct passwd *)NULL) - { - fprintf(stderr, - "fetchmail: can't set up default delivery to %s\n", user); - exit(PS_SYNTAX); /* has to be from bad rc file */ - } - else - { + ctl->uid = 0; + else ctl->uid = pw->pw_uid; /* for local delivery via MDA */ - if (!ctl->localnames) /* for local delivery via SMTP */ - save_str_pair(&ctl->localnames, user, NULL); - } + if (!ctl->localnames) /* for local delivery via SMTP */ + save_str_pair(&ctl->localnames, user, NULL); #if !defined(HAVE_GETHOSTBYNAME) || !defined(HAVE_RES_SEARCH) /* can't handle multidrop mailboxes unless we can do DNS lookups */ -- cgit v1.2.3