| Summary: | $MAIL contains extraneous slashes on Solaris, IRIX, others? | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Dan Astoorian <djast> |
| Component: | sshd | Assignee: | Kevin Steves <stevesk> |
| Status: | CLOSED WONTFIX | ||
| Severity: | minor | ||
| Priority: | P4 | ||
| Version: | -current | ||
| Hardware: | All | ||
| OS: | Solaris | ||
|
Description
Dan Astoorian
2001-12-11 09:40:21 AEDT
/var/mail//djast is a valid path which should resolve to /var/mail/djast on any Unix system. Isn't it RMAIL which is broken here? Yes, the bug is in RMAIL (and has likely been fixed in newer revisions of RMAIL), but a fix/workaround in sshd would still be nice, even if only for cosmetic reasons. what is the decision with this one? i don't think we should add code
that works around buggy apps that have been fixed. it never goes away.
but if we want to change it, i might do something like this:
Index: session.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/session.c,v
retrieving revision 1.117
diff -u -r1.117 session.c
--- session.c 28 Dec 2001 14:50:54 -0000 1.117
+++ session.c 6 Jan 2002 00:55:00 -0000
@@ -855,6 +855,7 @@
env[0] = NULL;
if (!options.use_login) {
+ char *delim;
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
@@ -866,8 +867,12 @@
child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
#endif
- snprintf(buf, sizeof buf, "%.200s/%.50s",
- _PATH_MAILDIR, pw->pw_name);
+ delim = "/";
+ if (sizeof(_PATH_MAILDIR) > 1 &&
+ _PATH_MAILDIR[sizeof(_PATH_MAILDIR)-2] == '/')
+ delim = "";
+ snprintf(buf, sizeof buf, "%.200s%s%.50s",
+ _PATH_MAILDIR, delim, pw->pw_name);
child_set_env(&env, &envsize, "MAIL", buf);
/* Normal systems set SHELL by default. */
Can't we fix it in configure by stripping terminating slashes? yes. however, i think this should probably be wontfix. I aggree with Kevin Steves this should probably be wontfix. However, here is a workaround for you. This should work for Solaris and any SVR4/SVR5. Copy /usr/linclude/maillock.h to your ssh build dir. Edit the #define MAILDIR line and remove the trailing / That should solve the problem with your broken apps. Another option that might work is to remove the #define HAVE_MAILLOCK_H 1 line from config.h before compiling. wontfix Mass change of RESOLVED bugs to CLOSED |