diff --git a/vfs/mcserv.c b/vfs/mcserv.c
index 3f38ac4..8aa836c 100644
a
|
b
|
|
56 | 56 | #include <sys/types.h> |
57 | 57 | #include <sys/stat.h> |
58 | 58 | #include <sys/wait.h> |
| 59 | #include <error.h> |
59 | 60 | #include <errno.h> |
60 | 61 | #include <signal.h> |
61 | 62 | #ifdef HAVE_GETOPT_H |
… |
… |
do_auth (const char *username, const char *password) |
1015 | 1016 | if (getuid () != this->pw_uid) |
1016 | 1017 | return 0; |
1017 | 1018 | |
1018 | | if (strcmp (username, "ftp") == 0) |
1019 | | chroot (this->pw_dir); |
1020 | | |
| 1019 | if (strncmp(username, "ftp", 3) == 0) { |
| 1020 | errno = 0; |
| 1021 | if (chroot(this->pw_dir) != 0 || errno != 0) { |
| 1022 | auth = errno; |
| 1023 | error(0, errno, strerror(errno)); |
| 1024 | return (-auth); |
| 1025 | } |
| 1026 | } |
1021 | 1027 | endpwent (); |
1022 | 1028 | return auth; |
1023 | 1029 | } |