Skip to content

Commit

Permalink
Restore deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Mar 26, 2024
1 parent ed56b3e commit e25e4e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions java/com/tigervnc/vncviewer/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static String getVncDir(String xdgEnv, String xdgDefault) {
return newDir.getPath();
} else {
if (legacyDir.exists()) {
vlog.info("WARNING: ~/.vnc is deprecated, see https://github.com/TigerVNC/tigervnc/pull/1737");
return legacyDir.getPath();
}
String xdgBaseDir = System.getenv(xdgEnv);
Expand Down
4 changes: 3 additions & 1 deletion unix/vncserver/vncserver.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

# Start with legacy ~/.vnc user dir
$vncUserDir = "$ENV{HOME}/.vnc";
if (!stat($vncUserDir)) {
if (stat($vncUserDir)) {
warn "~/.vnc is deprecated, see https://github.com/TigerVNC/tigervnc/pull/1737";
} else {
# Legacy path doesn't exist, start using new XDG-alike path
$vncUserDir = rindex("$ENV{XDG_CONFIG_HOME}", "/", 0) == 0
? "$ENV{XDG_CONFIG_HOME}/tigervnc"
Expand Down
4 changes: 3 additions & 1 deletion unix/vncserver/vncsession.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ redir_stdio(const char *homedir, const char *display)
close(fd);

snprintf(logfile, sizeof(logfile), "%s/.vnc", homedir);
if (stat(logfile, &st) != 0) {
if (stat(logfile, &st) == 0)
syslog(LOG_WARNING, "~/.vnc is deprecated, see https://github.com/TigerVNC/tigervnc/pull/1737");
else {
xdgstate = getenv("XDG_STATE_HOME");
if (xdgstate != NULL && xdgstate[0] == '/')
snprintf(logfile, sizeof(logfile), "%s/tigervnc", xdgstate);
Expand Down
7 changes: 7 additions & 0 deletions vncviewer/vncviewer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,14 @@ int main(int argc, char** argv)

migrateDeprecatedOptions();

#ifndef WIN32
char *confdir = strdup(os::getvncconfigdir());
char *dotdir = strrchr(confdir, '.');
if (dotdir != NULL && strcmp(dotdir, ".vnc") == 0)
vlog.info(_("~/.vnc is deprecated, see https://github.com/TigerVNC/tigervnc/pull/1737"));
#endif
mkdirrecursive(os::getvncconfigdir());
mkdirrecursive(os::getvncdatadir());
mkdirrecursive(os::getvncstatedir());

CSecurity::upg = &dlg;
Expand Down

0 comments on commit e25e4e3

Please sign in to comment.