aboutsummaryrefslogtreecommitdiffstats
path: root/src/security.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-11-18 19:39:48 +0100
committerMattias Andrée <maandree@operamail.com>2013-11-18 19:39:48 +0100
commit9fab3e050f7b4e1816a966e7ce74fce74b991709 (patch)
treea79ac5242fffe3330df0ce8846bfe6cddff878b3 /src/security.c
parentsome login actions (diff)
downloadlibpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.gz
libpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.bz2
libpassphrase-9fab3e050f7b4e1816a966e7ce74fce74b991709.tar.xz
more flexible
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/security.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/security.c b/src/security.c
index 1e1dd9e..a273cf0 100644
--- a/src/security.c
+++ b/src/security.c
@@ -99,13 +99,13 @@ 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[VCS_VCSA_LEN];
+ char _vcsa[VCS_VCSA_LEN];
char* vcs = _vcs;
char* vcsa = _vcsa;
- vcs += 16;
- vcsa += 16;
+ vcs += VCS_VCSA_LEN;
+ vcsa += VCS_VCSA_LEN;
if (n)
{
@@ -116,18 +116,18 @@ void chown_tty(uid_t owner, gid_t group, int with_fail)
n /= 10;
}
- vcs -= 8;
- vcsa -= 9;
- strcpy(vcs, "/dev/vcs");
- strcpy(vcsa, "/dev/vcsa");
+ vcs -= VCS_LEN;
+ vcsa -= VCSA_LEN;
+ strcpy(vcs, VCS);
+ strcpy(vcsa, VCSA);
#ifdef OWN_VCS
- if (chown(vcs, owner, group) && with_fail) fail("chown");
- if (chmod(vcs, TTY_PERM) && with_fail) fail("chmod");
+ if (chown(vcs, owner, group) && with_fail) fail("chown");
+ if (chmod(vcs, TTY_PERM) && with_fail) fail("chmod");
#endif
#ifdef OWN_VCSA
if (chown(vcsa, owner, group) && with_fail) fail("chown");
- if (chmod(vcsa, TTY_PERM) && with_fail) fail("chmod");
+ if (chmod(vcsa, TTY_PERM) && with_fail) fail("chmod");
#endif
}
}