netutils/ftpc: ftpc_getfile: Fixed permission check and resume offset.
This commit is contained in:
parent
7fdd751b7a
commit
5b1a4a3832
@ -255,6 +255,8 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
offset = 0;
|
||||||
|
|
||||||
/* Get information about the local file */
|
/* Get information about the local file */
|
||||||
|
|
||||||
ret = stat(abslpath, &statbuf);
|
ret = stat(abslpath, &statbuf);
|
||||||
@ -267,7 +269,6 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
|
|||||||
nwarn("WARNING: '%s' is a directory\n", abslpath);
|
nwarn("WARNING: '%s' is a directory\n", abslpath);
|
||||||
goto errout_with_abspath;
|
goto errout_with_abspath;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Is it write-able? */
|
/* Is it write-able? */
|
||||||
|
|
||||||
@ -279,17 +280,14 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Are we resuming the transfers? Is so then the starting offset is the
|
/* Are we resuming the transfers? Is so then the starting offset is
|
||||||
* size of the existing, partial file.
|
* the size of the existing, partial file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (how == FTPC_GET_RESUME)
|
if (how == FTPC_GET_RESUME)
|
||||||
{
|
{
|
||||||
offset = statbuf.st_size;
|
offset = statbuf.st_size;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
offset = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup to receive the file */
|
/* Setup to receive the file */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user