aboutsummaryrefslogtreecommitdiffstats
path: root/src/security.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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");
}
}
}