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
This commit is contained in:
mooredan@suncup.net 2010-11-24 02:44:15 +00:00
parent b7fc931962
commit ded2dd527d
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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",