From 887ecca62530595982764230f8d411e51ef7d31d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 18 Nov 2013 17:55:43 +0100 Subject: fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/security.c | 14 ++++++++------ src/security.h | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src') 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 #include #include +#include +#include +#include #ifndef TTY_PERM -- cgit v1.2.3-70-g09d2