aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-11-18 17:55:43 +0100
committerMattias Andrée <maandree@operamail.com>2013-11-18 17:55:43 +0100
commit887ecca62530595982764230f8d411e51ef7d31d (patch)
tree0382ee4d137998f69e5baca59d0009741719fa4a
parentm (diff)
downloadlibpassphrase-887ecca62530595982764230f8d411e51ef7d31d.tar.gz
libpassphrase-887ecca62530595982764230f8d411e51ef7d31d.tar.bz2
libpassphrase-887ecca62530595982764230f8d411e51ef7d31d.tar.xz
fix errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/security.c14
-rw-r--r--src/security.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/src/security.c b/src/security.c
index 33342fc..5620749 100644
--- a/src/security.c
+++ b/src/security.c
@@ -94,9 +94,11 @@ void chown_tty(uid_t owner, gid_t group, int with_fail)
if (ioctl(STDIN_FILENO, VT_GETSTATE, &vtstat) == 0)
{
int n = vtstat.v_active;
- char vcs[16];
- char vcsa[16];
+ char _vcs[16];
+ char _vcsa[16];
+ char* vcs = _vcs;
+ char* vcsa = _vcsa;
vcs += 16;
vcsa += 16;
@@ -114,10 +116,10 @@ void chown_tty(uid_t owner, gid_t group, int with_fail)
strcpy(vcs, "/dev/vcs");
strcpy(vcsa, "/dev/vcsa");
- if (fchown(vcs, owner, group) && with_fail) fail("chown");
- if (fchown(vcsa, owner, group) && with_fail) fail("chown");
- if (fchmod(vcs, TTY_PERM) && with_fail) fail("chmod");
- if (fchmod(vcsa, TTY_PERM) && with_fail) fail("chmod");
+ if (chown(vcs, owner, group) && with_fail) fail("chown");
+ if (chown(vcsa, owner, group) && with_fail) fail("chown");
+ if (chmod(vcs, TTY_PERM) && with_fail) fail("chmod");
+ if (chmod(vcsa, TTY_PERM) && with_fail) fail("chmod");
}
}
}
diff --git a/src/security.h b/src/security.h
index 464afbf..b16ef1b 100644
--- a/src/security.h
+++ b/src/security.h
@@ -22,6 +22,9 @@
#include <termios.h>
#include <fcntl.h>
#include <signal.h>
+#include <string.h>
+#include <stropts.h>
+#include <linux/vt.h>
#ifndef TTY_PERM