-/* $OpenBSD: ftpd.c,v 1.32 1997/01/23 06:49:11 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.33 1997/03/25 22:47:10 millert Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
cwd(path)
char *path;
{
+ FILE *message;
if (chdir(path) < 0)
perror_reply(550, path);
- else
+ else {
+ if ((message = fopen(_PATH_CWDMESG, "r")) != NULL) {
+ char *cp, line[LINE_MAX];
+
+ while (fgets(line, sizeof(line), message) != NULL) {
+ if ((cp = strchr(line, '\n')) != NULL)
+ *cp = '\0';
+ lreply(250, "%s", line);
+ }
+ (void) fflush(stdout);
+ (void) fclose(message);
+ }
ack("CWD");
+ }
}
void
-/* $OpenBSD: pathnames.h,v 1.2 1996/07/28 22:42:46 downsj Exp $ */
+/* $OpenBSD: pathnames.h,v 1.3 1997/03/25 22:47:08 millert Exp $ */
/* $NetBSD: pathnames.h,v 1.5 1995/04/11 02:44:59 cgd Exp $ */
/*
#define _PATH_FTPWELCOME "/etc/ftpwelcome"
#define _PATH_FTPLOGINMESG "/etc/motd"
#define _PATH_FTPDSTATFILE "/var/log/ftpd"
+#define _PATH_CWDMESG ".message"