diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-08-11 22:19:03 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-08-11 22:19:03 +0000 |
commit | c50c4ec8343f16c6a8ff6b368bae481c38eee71e (patch) | |
tree | 34ac39668215a6343e1431401afa0b9652ccd2ed | |
parent | 9858071dd087b19da6f7674e99120e5f39b8702e (diff) | |
download | rtmux-c50c4ec8343f16c6a8ff6b368bae481c38eee71e.tar.gz rtmux-c50c4ec8343f16c6a8ff6b368bae481c38eee71e.tar.bz2 rtmux-c50c4ec8343f16c6a8ff6b368bae481c38eee71e.zip |
Sync OpenBSD patchset 749:
Do not allow duplicate session names to be created, reported by Dominik
Honnef, patch from Thomas Adam.
-rw-r--r-- | cmd-rename-session.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd-rename-session.c b/cmd-rename-session.c index 7e1b06c1..23fcd7f2 100644 --- a/cmd-rename-session.c +++ b/cmd-rename-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-rename-session.c,v 1.19 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-rename-session.c,v 1.20 2010-08-11 22:19:03 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,6 +45,11 @@ cmd_rename_session_exec(struct cmd *self, struct cmd_ctx *ctx) struct cmd_target_data *data = self->data; struct session *s; + if (data->arg != NULL && session_find(data->arg) != NULL) { + ctx->error(ctx, "duplicate session: %s", data->arg); + return (-1); + } + if ((s = cmd_find_session(ctx, data->target)) == NULL) return (-1); |