|
|
90e381 |
From 1d5cdf309387ff92988ab17d746f015d833a4b92 Mon Sep 17 00:00:00 2001
|
|
|
90e381 |
From: Martin Sehnoutka <msehnout@redhat.com>
|
|
|
90e381 |
Date: Thu, 17 Nov 2016 11:08:52 +0100
|
|
|
90e381 |
Subject: [PATCH 24/59] Introduce new return value 450:
|
|
|
90e381 |
|
|
|
90e381 |
*450 Requested file action not taken.
|
|
|
90e381 |
File unavailable (e.g., file busy).
|
|
|
90e381 |
---
|
|
|
90e381 |
ftpcodes.h | 1 +
|
|
|
90e381 |
postlogin.c | 9 ++++++++-
|
|
|
90e381 |
sysutil.c | 3 +++
|
|
|
90e381 |
sysutil.h | 3 ++-
|
|
|
90e381 |
4 files changed, 14 insertions(+), 2 deletions(-)
|
|
|
90e381 |
|
|
|
90e381 |
diff --git a/ftpcodes.h b/ftpcodes.h
|
|
|
90e381 |
index 93290c0..81e25c5 100644
|
|
|
90e381 |
--- a/ftpcodes.h
|
|
|
90e381 |
+++ b/ftpcodes.h
|
|
|
90e381 |
@@ -52,6 +52,7 @@
|
|
|
90e381 |
#define FTP_TLS_FAIL 421
|
|
|
90e381 |
#define FTP_BADSENDCONN 425
|
|
|
90e381 |
#define FTP_BADSENDNET 426
|
|
|
90e381 |
+#define FTP_FILETMPFAIL 450
|
|
|
90e381 |
#define FTP_BADSENDFILE 451
|
|
|
90e381 |
|
|
|
90e381 |
#define FTP_BADCMD 500
|
|
|
90e381 |
diff --git a/postlogin.c b/postlogin.c
|
|
|
90e381 |
index bf12970..29958c0 100644
|
|
|
90e381 |
--- a/postlogin.c
|
|
|
90e381 |
+++ b/postlogin.c
|
|
|
90e381 |
@@ -679,7 +679,14 @@ handle_retr(struct vsf_session* p_sess, int is_http)
|
|
|
90e381 |
opened_file = str_open(&p_sess->ftp_arg_str, kVSFSysStrOpenReadOnly);
|
|
|
90e381 |
if (vsf_sysutil_retval_is_error(opened_file))
|
|
|
90e381 |
{
|
|
|
90e381 |
- vsf_cmdio_write(p_sess, FTP_FILEFAIL, "Failed to open file.");
|
|
|
90e381 |
+ if (kVSFSysUtilErrAGAIN == vsf_sysutil_get_error())
|
|
|
90e381 |
+ {
|
|
|
90e381 |
+ vsf_cmdio_write(p_sess, FTP_FILETMPFAIL, "Temporarily failed to open file");
|
|
|
90e381 |
+ }
|
|
|
90e381 |
+ else
|
|
|
90e381 |
+ {
|
|
|
90e381 |
+ vsf_cmdio_write(p_sess, FTP_FILEFAIL, "Failed to open file.");
|
|
|
90e381 |
+ }
|
|
|
90e381 |
return;
|
|
|
90e381 |
}
|
|
|
90e381 |
/* Lock file if required */
|
|
|
90e381 |
diff --git a/sysutil.c b/sysutil.c
|
|
|
90e381 |
index 9881a66..6d7cb3f 100644
|
|
|
90e381 |
--- a/sysutil.c
|
|
|
90e381 |
+++ b/sysutil.c
|
|
|
90e381 |
@@ -1632,6 +1632,9 @@ vsf_sysutil_get_error(void)
|
|
|
90e381 |
case ENOENT:
|
|
|
90e381 |
retval = kVSFSysUtilErrNOENT;
|
|
|
90e381 |
break;
|
|
|
90e381 |
+ case EAGAIN:
|
|
|
90e381 |
+ retval = kVSFSysUtilErrAGAIN;
|
|
|
90e381 |
+ break;
|
|
|
90e381 |
default:
|
|
|
90e381 |
break;
|
|
|
90e381 |
}
|
|
|
90e381 |
diff --git a/sysutil.h b/sysutil.h
|
|
|
90e381 |
index 79b5514..c145bdf 100644
|
|
|
90e381 |
--- a/sysutil.h
|
|
|
90e381 |
+++ b/sysutil.h
|
|
|
90e381 |
@@ -18,7 +18,8 @@ enum EVSFSysUtilError
|
|
|
90e381 |
kVSFSysUtilErrINVAL,
|
|
|
90e381 |
kVSFSysUtilErrOPNOTSUPP,
|
|
|
90e381 |
kVSFSysUtilErrACCES,
|
|
|
90e381 |
- kVSFSysUtilErrNOENT
|
|
|
90e381 |
+ kVSFSysUtilErrNOENT,
|
|
|
90e381 |
+ kVSFSysUtilErrAGAIN
|
|
|
90e381 |
};
|
|
|
90e381 |
enum EVSFSysUtilError vsf_sysutil_get_error(void);
|
|
|
90e381 |
|
|
|
90e381 |
--
|
|
|
90e381 |
2.14.4
|
|
|
90e381 |
|