From ded2dd527d3db99280dc1beabb0e469d4840c949 Mon Sep 17 00:00:00 2001 From: "mooredan@suncup.net" Date: Wed, 24 Nov 2010 02:44:15 +0000 Subject: [PATCH] Added check for left square bracket character at the beginning of the line in the password file. Resolves issue #126 git-svn-id: http://s3fs.googlecode.com/svn/trunk@263 df820570-a93a-0410-bd06-b72b767a4274 --- configure.ac | 2 +- src/s3fs.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 12d1611..f407185 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(s3fs, 1.16) +AC_INIT(s3fs, 1.17) AC_CANONICAL_SYSTEM diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 8d4fd3e..d8dda1b 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -1890,6 +1890,13 @@ static void read_passwd_file (void) { exit(1); } + first_pos = line.find_first_of("["); + if (first_pos != string::npos && first_pos == 0) { + printf ("%s: invalid line in passwd file, found a bracket \"[\" character\n", + program_name.c_str()); + exit(1); + } + first_pos = line.find_first_of(":"); if (first_pos == string::npos) { printf ("%s: invalid line in passwd file, no \":\" separator found\n",