different semantics; ensure that this never happens when building pathnames
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 8.40
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.29
SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.37
-static char sccsid[] = "@(#)envelope.c 8.28 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 8.29 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
** Process passwd file entry.
*/
** Process passwd file entry.
*/
/* extract home directory */
/* extract home directory */
- e->e_from.q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ e->e_from.q_home = newstr("");
+ else
+ e->e_from.q_home = newstr(pw->pw_dir);
define('z', e->e_from.q_home, e);
/* extract user and group id */
define('z', e->e_from.q_home, e);
/* extract user and group id */
else if (!internal && OpMode != MD_DAEMON)
{
if (e->e_from.q_home == NULL)
else if (!internal && OpMode != MD_DAEMON)
{
if (e->e_from.q_home == NULL)
e->e_from.q_home = getenv("HOME");
e->e_from.q_home = getenv("HOME");
+ if (strcmp(e->e_from.q_home, "/") == 0)
+ e->e_from.q_home++;
+ }
e->e_from.q_uid = RealUid;
e->e_from.q_gid = RealGid;
e->e_from.q_flags |= QGOODUID;
e->e_from.q_uid = RealUid;
e->e_from.q_gid = RealGid;
e->e_from.q_flags |= QGOODUID;
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.36 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.37 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 8.36 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.37 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
*p++ = '\0';
if (*user != '\0' && (pw = getpwnam(user)) != NULL)
{
*p++ = '\0';
if (*user != '\0' && (pw = getpwnam(user)) != NULL)
{
- a->q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ a->q_home = "";
+ else
+ a->q_home = newstr(pw->pw_dir);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_user = newstr(user);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_user = newstr(user);
-static char sccsid[] = "@(#)recipient.c 8.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 8.40 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
(void) strcpy(buf, pw->pw_name);
goto trylocaluser;
}
(void) strcpy(buf, pw->pw_name);
goto trylocaluser;
}
- a->q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ a->q_home = "";
+ else
+ a->q_home = newstr(pw->pw_dir);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_ruser = newstr(pw->pw_name);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_ruser = newstr(pw->pw_name);