Refuse to push a non-regular file server

If SCRCPY_SERVER_PATH points to a directory, then a directory will be
pushed to /data/local/tmp/scrcpy-server.jar.

When executing it, app_process will just abort and leave the directory
on the device, causing scrcpy to always fail.

To avoid the problem, check that the server is a regular file before
pushing it.

Closes #956 <https://github.com/Genymobile/scrcpy/issues/956>
This commit is contained in:
Romain Vimont
2019-12-05 21:07:11 +01:00
parent 3259c60b22
commit 64bcac9157
3 changed files with 24 additions and 1 deletions

View File

@@ -85,4 +85,8 @@ process_check_success(process_t proc, const char *name);
char *
get_executable_path(void);
// returns true if the file exists and is not a directory
bool
is_regular_file(const char *path);
#endif