diff options
author | Timothy Pearson <[email protected]> | 2014-10-18 18:35:56 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-10-18 18:35:56 -0500 |
commit | 891da4b83e901780ca4becb9b6f7c9cf0fb70ffd (patch) | |
tree | b177b8ddddf3a0e73a86e482d88e0e188c601516 /tdm/backend | |
parent | 0c11ace605ba33feb137eca638a39c27a71e1d8d (diff) | |
parent | d7ccc16037550f5dc9ba2db00e47ea950c3732d2 (diff) | |
download | tdebase-891da4b83e901780ca4becb9b6f7c9cf0fb70ffd.tar.gz tdebase-891da4b83e901780ca4becb9b6f7c9cf0fb70ffd.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'tdm/backend')
-rw-r--r-- | tdm/backend/auth.c | 23 | ||||
-rw-r--r-- | tdm/backend/getfd.c | 4 |
2 files changed, 27 insertions, 0 deletions
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 |