Refuse to overwrite an existing session socket
This commit is contained in:
parent
d2dac558e7
commit
14fb71b16c
|
@ -823,6 +823,9 @@ bool Server::rename_session(StringView name)
|
||||||
String new_socket_file = format("{}/kakoune/{}/{}", tmpdir(),
|
String new_socket_file = format("{}/kakoune/{}/{}", tmpdir(),
|
||||||
get_user_name(), name);
|
get_user_name(), name);
|
||||||
|
|
||||||
|
if (file_exists(new_socket_file))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (rename(old_socket_file.c_str(), new_socket_file.c_str()) != 0)
|
if (rename(old_socket_file.c_str(), new_socket_file.c_str()) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user