Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
data_exporter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IA2
data_exporter
Commits
6391ff2f
Commit
6391ff2f
authored
11 years ago
by
Marco De Marco
Browse files
Options
Downloads
Patches
Plain Diff
Empty schema table user password check added
parent
62270bca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/DataExporter.cpp
+36
-2
36 additions, 2 deletions
src/DataExporter.cpp
src/DataExporter.h
+5
-5
5 additions, 5 deletions
src/DataExporter.h
with
41 additions
and
7 deletions
src/DataExporter.cpp
+
36
−
2
View file @
6391ff2f
...
...
@@ -610,7 +610,7 @@ void DataExporter::importExportedTables(std::vector<std::string>& exportedTables
{
std
::
size_t
found
;
if
((
found
=
exportedTables
.
at
(
i
).
find
(
'
'
))
==
std
::
string
::
npos
)
if
((
found
=
exportedTables
.
at
(
i
).
find
(
'
,
'
))
==
std
::
string
::
npos
)
{
std
::
stringstream
errorStream
;
errorStream
<<
"ExportedTables property has invalid key at "
...
...
@@ -619,8 +619,25 @@ void DataExporter::importExportedTables(std::vector<std::string>& exportedTables
}
std
::
string
schema
=
exportedTables
.
at
(
i
).
substr
(
0
,
found
);
if
(
schema
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"ExportedTables property has empty schema at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
std
::
string
table
=
exportedTables
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
if
(
table
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"ExportedTables property has empty table at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
INFO_STREAM
<<
"DataExporter::importExportedTables() schema "
<<
schema
<<
" table "
<<
table
<<
endl
;
...
...
@@ -641,7 +658,7 @@ void DataExporter::importAuthorisedUsers(std::vector<std::string>& authorisedUse
{
std
::
size_t
found
;
if
((
found
=
authorisedUsers
.
at
(
i
).
find
(
'
'
))
==
std
::
string
::
npos
)
if
((
found
=
authorisedUsers
.
at
(
i
).
find
(
'
,
'
))
==
std
::
string
::
npos
)
{
std
::
stringstream
errorStream
;
errorStream
<<
"AuthorisedUsers property has invalid key at "
...
...
@@ -650,8 +667,25 @@ void DataExporter::importAuthorisedUsers(std::vector<std::string>& authorisedUse
}
std
::
string
user
=
authorisedUsers
.
at
(
i
).
substr
(
0
,
found
);
if
(
user
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"AuthorisedUsers property has empty user at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
std
::
string
password
=
authorisedUsers
.
at
(
i
).
substr
(
found
+
1
,
std
::
string
::
npos
);
if
(
password
.
empty
())
{
std
::
stringstream
errorStream
;
errorStream
<<
"AuthorisedUsers property has empty password at "
<<
i
<<
" position"
<<
std
::
endl
;
throw
std
::
invalid_argument
(
errorStream
.
str
());
}
#ifdef VERBOSE_DEBUG
INFO_STREAM
<<
"DataExporter::importAuthorisedUsers() user "
<<
user
<<
" password "
<<
password
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/DataExporter.h
+
5
−
5
View file @
6391ff2f
...
...
@@ -79,11 +79,11 @@ class DataExporter : public TANGO_BASE_CLASS
//Max number of worker thread allowed
static
const
unsigned
int
MAX_WORKER_NUMBER
=
100
;
//Max number of database connection allowed
static
const
unsigned
int
MAX_DB_CONNECTION_NUMBER
=
100
;
//Max database port number allowed value
static
const
unsigned
int
MAX_DB_PORT
=
65535
;
//
//Max number of database connection allowed
//
static const unsigned int MAX_DB_CONNECTION_NUMBER = 100;
//
//
//Max database port number allowed value
//
static const unsigned int MAX_DB_PORT = 65535;
/*----- PROTECTED REGION END -----*/
// DataExporter::Data Members
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment