summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2014-01-22 14:00:09 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2014-01-22 14:00:09 +0000
commit67dba4aa0297de97a87c6c57f9001fd41683c6f6 (patch)
tree52a614bbb74722f02ed90334891f8ff53a9bd151 /usr.bin/tmux
parent080b0b839561300e190afa4f5042d3fd844e4309 (diff)
Do not permit periods in session names (colons are already banned). From
J Raynor.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/session.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index 6cf124b3ed4..ec8996ecf91 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.41 2013/10/10 12:26:36 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.42 2014/01/22 14:00:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -175,11 +175,11 @@ session_destroy(struct session *s)
RB_INSERT(sessions, &dead_sessions, s);
}
-/* Check a session name is valid: not empty and no colons. */
+/* Check a session name is valid: not empty and no colons or periods. */
int
session_check_name(const char *name)
{
- return (*name != '\0' && strchr(name, ':') == NULL);
+ return (*name != '\0' && name[strcspn(name, ":.")] == '\0');
}
/* Update session active time. */