aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-17 19:03:25 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commit803a6ae087331d2701daf608128c2e5ff1d596a7 (patch)
treedaef93a2dbcc2ca847521cb9947ce34d17285995 /common
parent334398153b605ebeadbff46cc63ac0c0d30748da (diff)
downloadtigervnc-803a6ae087331d2701daf608128c2e5ff1d596a7.tar.gz
tigervnc-803a6ae087331d2701daf608128c2e5ff1d596a7.zip
Namespace directory functions
All library functions should be in a proper namespace.
Diffstat (limited to 'common')
-rw-r--r--common/os/os.cxx4
-rw-r--r--common/os/os.h36
-rw-r--r--common/rfb/CSecurityTLS.cxx4
3 files changed, 24 insertions, 20 deletions
diff --git a/common/os/os.cxx b/common/os/os.cxx
index 1e00b92f..5492c55e 100644
--- a/common/os/os.cxx
+++ b/common/os/os.cxx
@@ -90,12 +90,12 @@ static const char* gethomedir(bool userDir)
#endif
}
-const char* getvnchomedir()
+const char* os::getvnchomedir()
{
return gethomedir(false);
}
-const char* getuserhomedir()
+const char* os::getuserhomedir()
{
return gethomedir(true);
}
diff --git a/common/os/os.h b/common/os/os.h
index ff6dcd01..5f927fef 100644
--- a/common/os/os.h
+++ b/common/os/os.h
@@ -20,22 +20,26 @@
#ifndef OS_OS_H
#define OS_OS_H
-/*
- * Get VNC home directory ($HOME/.vnc or %APPDATA%/vnc/).
- * If HOME environment variable is set then it is used.
- * Otherwise home directory is obtained via getpwuid function.
- *
- * Returns NULL on failure.
- */
-const char* getvnchomedir();
+namespace os {
-/*
- * Get user home directory.
- * If HOME environment variable is set then it is used.
- * Otherwise home directory is obtained via getpwuid function.
- *
- * Returns NULL on failure.
- */
-const char* getuserhomedir();
+ /*
+ * Get VNC home directory ($HOME/.vnc or %APPDATA%/vnc/).
+ * If HOME environment variable is set then it is used.
+ * Otherwise home directory is obtained via getpwuid function.
+ *
+ * Returns NULL on failure.
+ */
+ const char* getvnchomedir();
+
+ /*
+ * Get user home directory.
+ * If HOME environment variable is set then it is used.
+ * Otherwise home directory is obtained via getpwuid function.
+ *
+ * Returns NULL on failure.
+ */
+ const char* getuserhomedir();
+
+}
#endif /* OS_OS_H */
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx
index dd4a5282..a8ef779d 100644
--- a/common/rfb/CSecurityTLS.cxx
+++ b/common/rfb/CSecurityTLS.cxx
@@ -78,7 +78,7 @@ static const char* homedirfn(const char* fn)
static char full_path[PATH_MAX];
const char* homedir;
- homedir = getvnchomedir();
+ homedir = os::getvnchomedir();
if (homedir == NULL)
return "";
@@ -389,7 +389,7 @@ void CSecurityTLS::checkSession()
/* Certificate is fine, except we don't know the issuer, so TOFU time */
- homeDir = getvnchomedir();
+ homeDir = os::getvnchomedir();
if (homeDir == NULL) {
throw AuthFailureException("Could not obtain VNC home directory "
"path for known hosts storage");