From: Pierre Ossman Date: Thu, 15 Aug 2024 12:24:42 +0000 (+0200) Subject: Handle existing config directory in vncpasswd X-Git-Tag: v1.14.1~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4c573f89f2f57248455085ae976cab627b47e3c6;p=tigervnc.git Handle existing config directory in vncpasswd This fixes commit a79c33d. (cherry picked from commit 445e0230cf4e939dcc59caf5d5f001c2f7b04da6) --- diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx index 30091a3d..3587cd6a 100644 --- a/unix/vncpasswd/vncpasswd.cxx +++ b/unix/vncpasswd/vncpasswd.cxx @@ -163,8 +163,10 @@ int main(int argc, char** argv) exit(1); } if (os::mkdir_p(configDir, 0777) == -1) { - fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno)); - exit(1); + if (errno != EEXIST) { + fprintf(stderr, "Could not create VNC config directory: %s\n", strerror(errno)); + exit(1); + } } snprintf(fname, sizeof(fname), "%s/passwd", configDir); }