aboutsummaryrefslogtreecommitdiffstats
path: root/src/security.c
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 /src/security.c
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>
Diffstat (limited to 'src/security.c')
-rw-r--r--src/security.c14
1 files changed, 8 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");
}
}
}