Skip to content

Commit

Permalink
security: remove debug for arguments and database url
Browse files Browse the repository at this point in the history
  • Loading branch information
junkert committed Mar 29, 2023
1 parent 2331c16 commit b00d9b2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
8 changes: 0 additions & 8 deletions db_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func CreateDatabase(conf PGConfig) error {
err := ExecPostgresCmd(cmd, args...)
if err != nil {
log.Error(err)
log.Debug("dburl: ", dburl)
return err
}
return nil
Expand Down Expand Up @@ -117,7 +116,6 @@ func SQLCommandFile(conf PGConfig, filepath string, ignoreErrors bool) error {
err := ExecPostgresCmd(cmd, args...)
if err != nil {
log.Error(err)
log.Debug("dburl: ", dburl)
return err
}
return nil
Expand All @@ -134,7 +132,6 @@ func ExecPostgresCmd(name string, args ...string) error {
log.Error(err)
log.Debug("outputFile: ", outLog)
log.Debug("name: ", name)
log.Debug("args: ", args)
return err
}
defer outputFile.Close()
Expand All @@ -145,7 +142,6 @@ func ExecPostgresCmd(name string, args ...string) error {
log.Error(err)
log.Debug("errorFile: ", errLog)
log.Debug("name: ", name)
log.Debug("args: ", args)
return err
}
defer errorFile.Close()
Expand All @@ -171,8 +167,6 @@ func ExecPostgresCommandOutErr(stdOut, stdErr io.Writer, name string, arg ...str
cmd.Stdout = &outBuffer
cmd.Stderr = &errBuffer

log.Debugf("Running command: %s %s", name, strings.Join(arg, " "))

err = cmd.Run()
outBytes := outBuffer.Bytes()
errBytes := errBuffer.Bytes()
Expand All @@ -182,8 +176,6 @@ func ExecPostgresCommandOutErr(stdOut, stdErr io.Writer, name string, arg ...str

if err != nil {
log.Error(err)
log.Debug("name: ", name)
log.Debug("arg: ", arg)
if len(errBytes) > 0 {
log.Debugf("errBytes: \n=====================\n%s\n=====================\n", string(errBytes))
log.Debugf("errBytes: \n=====================\n%s\n=====================\n", string(errBytes))
Expand Down
1 change: 0 additions & 1 deletion db_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func OpenDB(conf PGConfig) (*sql.DB, error) {
db, err := sql.Open("postgres", dburl)
if err != nil {
log.Error(err)
log.Debug("dburl: ", dburl)
return nil, err
}
return db, nil
Expand Down

0 comments on commit b00d9b2

Please sign in to comment.