diff options
author | Daniel Mack <github@zonque.org> | 2015-10-06 14:59:24 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-10-06 14:59:24 +0200 |
commit | 13af9152bc3c018849e1834f5ff93f2a8ed03afb (patch) | |
tree | 628d9ae3d2e8542c44c00695fd3aea5f1028f04f /src | |
parent | 20d2f7851ac44bd6845d060a952461f5a10e9c87 (diff) | |
parent | d046fb936658e7239c8e2635ecb7fb32748ef535 (diff) |
Merge pull request #1469 from poettering/even-more-fixed
Even more fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/activate/activate.c | 5 | ||||
-rw-r--r-- | src/basic/strv.c | 2 | ||||
-rw-r--r-- | src/basic/util.c | 8 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c index 6a8432314e..4ece1367c1 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -361,6 +361,11 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_FDNAME: + if (!fdname_is_valid(optarg)) { + log_error("File descriptor name %s is not valid, refusing.", optarg); + return -EINVAL; + } + arg_fdname = optarg; break; diff --git a/src/basic/strv.c b/src/basic/strv.c index 90f0b8c741..d5169467da 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -784,5 +784,5 @@ rollback: free(nl[j]); nl[k] = NULL; - return NULL; + return -ENOMEM; } diff --git a/src/basic/util.c b/src/basic/util.c index 630c7ea9ff..2855993afe 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -6849,12 +6849,14 @@ int version(void) { bool fdname_is_valid(const char *s) { const char *p; - /* Validates a name for $LISTEN_NAMES. We basically allow + /* Validates a name for $LISTEN_FDNAMES. We basically allow * everything ASCII that's not a control character. Also, as * special exception the ":" character is not allowed, as we - * use that as field separator in $LISTEN_NAMES. + * use that as field separator in $LISTEN_FDNAMES. * - * Note that the empty string is explicitly allowed here.*/ + * Note that the empty string is explicitly allowed + * here. However, we limit the length of the names to 255 + * characters. */ if (!s) return false; |