summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-10-18 18:35:56 -0500
committerTimothy Pearson <[email protected]>2014-10-18 18:35:56 -0500
commit891da4b83e901780ca4becb9b6f7c9cf0fb70ffd (patch)
treeb177b8ddddf3a0e73a86e482d88e0e188c601516 /tdm
parent0c11ace605ba33feb137eca638a39c27a71e1d8d (diff)
parentd7ccc16037550f5dc9ba2db00e47ea950c3732d2 (diff)
downloadtdebase-891da4b83e901780ca4becb9b6f7c9cf0fb70ffd.tar.gz
tdebase-891da4b83e901780ca4becb9b6f7c9cf0fb70ffd.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'tdm')
-rw-r--r--tdm/ConfigureChecks.cmake12
-rw-r--r--tdm/backend/auth.c23
-rw-r--r--tdm/backend/getfd.c4
-rw-r--r--tdm/kfrontend/kgapp.cpp4
-rw-r--r--tdm/kfrontend/kgapp.h4
-rw-r--r--tdm/kfrontend/kgreeter.cpp13
6 files changed, 44 insertions, 16 deletions
diff --git a/tdm/ConfigureChecks.cmake b/tdm/ConfigureChecks.cmake
index ae7ea8b6c..cb333aa61 100644
--- a/tdm/ConfigureChecks.cmake
+++ b/tdm/ConfigureChecks.cmake
@@ -27,16 +27,6 @@ check_function_exists( login_getclass HAVE_LOGIN_GETCLASS )
check_function_exists( auth_timeok HAVE_AUTH_TIMEOK )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
-check_function_exists( crypt LIBC_HAVE_CRYPT )
-if( LIBC_HAVE_CRYPT )
- set( HAVE_CRYPT 1 CACHE INTERNAL "" FORCE )
-else( )
- check_library_exists( crypt crypt "" HAVE_CRYPT )
- if( HAVE_CRYPT )
- set( CRYPT_LIBRARY crypt )
- endif( )
-endif( )
-
check_include_file( lastlog.h HAVE_LASTLOG_H )
check_include_file( termio.h HAVE_TERMIO_H )
@@ -95,7 +85,7 @@ unset( BSD_UTMP )
if( NOT HAVE_UTMPX )
check_function_exists( getutent have_getutent )
if( NOT have_getutent )
- set( BSD_UTMP 1 )
+ set( BSD_UTMP 1 CACHE INTERNAL "" FORCE )
endif( )
endif( )
diff --git a/tdm/backend/auth.c b/tdm/backend/auth.c
index bd183142c..b92881789 100644
--- a/tdm/backend/auth.c
+++ b/tdm/backend/auth.c
@@ -41,6 +41,9 @@ from the copyright holder.
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
+#ifdef __OpenBSD__
+#include <pwd.h>
+#endif
#include <sys/ioctl.h>
@@ -290,6 +293,26 @@ SaveServerAuthorizations( struct display *d, Xauth **auths, int count )
return FALSE;
}
}
+#ifdef __OpenBSD__
+ {
+ struct passwd *x11;
+ uid_t uid;
+ gid_t gid;
+ /* Give read capability to group _x11 */
+ x11 = getpwnam("_x11");
+ if (x11 == NULL) {
+ LogError("Can't find _x11 user\n");
+ uid = getuid();
+ gid = getgid();
+ } else {
+ uid = x11->pw_uid;
+ gid = x11->pw_gid;
+ }
+
+ fchown(fileno(auth_file), uid, gid);
+ }
+#endif
+
Debug( "file: %s auth: %p\n", d->authFile, auths );
for (i = 0; i < count; i++) {
/*
diff --git a/tdm/backend/getfd.c b/tdm/backend/getfd.c
index 6bf8c8783..307b2501c 100644
--- a/tdm/backend/getfd.c
+++ b/tdm/backend/getfd.c
@@ -22,8 +22,12 @@ is_a_console(int fd) {
char arg;
arg = 0;
+#ifdef __OpenBSD__
+ return arg;
+#else
return (ioctl(fd, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)));
+#endif
}
static int
diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp
index f172521bc..2d630485e 100644
--- a/tdm/kfrontend/kgapp.cpp
+++ b/tdm/kfrontend/kgapp.cpp
@@ -123,11 +123,14 @@ void GreeterApp::init()
startTimer( pingInterval * 60000 );
}
+#ifdef __TDE_HAVE_TDEHWLIB
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*)));
+#endif
}
void GreeterApp::deviceChanged(TDEGenericDevice* device) {
+#ifdef __TDE_HAVE_TDEHWLIB
#ifdef WITH_XRANDR
if (device->type() == TDEGenericDeviceType::Monitor) {
KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
@@ -135,6 +138,7 @@ void GreeterApp::deviceChanged(TDEGenericDevice* device) {
delete randrsimple;
}
#endif // WITH_XRANDR
+#endif // __TDE_HAVE_TDEHWLIB
}
void
diff --git a/tdm/kfrontend/kgapp.h b/tdm/kfrontend/kgapp.h
index 6150b4f5d..c9e2802c1 100644
--- a/tdm/kfrontend/kgapp.h
+++ b/tdm/kfrontend/kgapp.h
@@ -27,7 +27,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define KGAPP_H
#include <tdeapplication.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
+#else
+#define TDEGenericDevice void
+#endif
class GreeterApp : public TDEApplication {
Q_OBJECT
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index 5ff8d5516..e6073da50 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -71,7 +71,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <fcntl.h>
#include <sys/types.h>
#include <utmp.h>
+#ifdef HAVE_UTMPX
#include <utmpx.h>
+#endif
#include <stdio.h>
#include <string.h>
@@ -1294,13 +1296,14 @@ void ControlPipeHandlerObject::run(void) {
umask(0);
struct stat buffer;
int status;
- char *fifo_parent_dir = strdup(FIFO_DIR);
- dirname(fifo_parent_dir);
+ char *fifo_parent_dir;
+ char *fifo_dir = strdup(FIFO_DIR);
+ fifo_parent_dir = dirname(fifo_dir);
status = stat(fifo_parent_dir, &buffer);
if (status != 0) {
- mkdir(fifo_parent_dir, 0644);
+ mkdir(fifo_parent_dir, 0755);
}
- free(fifo_parent_dir);
+ free(fifo_dir);
status = stat(FIFO_DIR, &buffer);
if (status == 0) {
int file_mode = ((buffer.st_mode & S_IRWXU) >> 6) * 100;
@@ -1313,7 +1316,7 @@ void ControlPipeHandlerObject::run(void) {
return;
}
}
- mkdir(FIFO_DIR,0600);
+ mkdir(FIFO_DIR,0700);
mknod(mPipeFilename.ascii(), S_IFIFO|0600, 0);
chmod(mPipeFilename.ascii(), 0600);