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