Re: FW: postgresql-8.3.6-1PGDG : password

Started by suresh adapaover 16 years ago4 messagesbugs
Jump to latest
#1suresh adapa
suresha@collab.net

Hi,

I am basically testing few things as below for one off my Task
requirement.
Can you please check below Test Case 4,6 and 7 and comment.

Test Case 1)
createuser -P -S --createdb --no-createrole suresha
Suresh&12
createdb -E UTF8 -O suresha TEST

Test Case 2)
createuser -P -S --createdb --no-createrole adapa
@-&)(*^#!
createdb -E UTF8 -O adapa TEST2

Test Case 3)
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password
'&gopal'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
Welcome to psql 8.3.6, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

TEST3=> \q

Test Case 4)
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password
'$gopal'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
psql: FATAL: password authentication failed for user "gopal"

Test Case 5)
-bash-3.2$ pwd
/var/lib/pgsql
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password $PWD"
ERROR: syntax error at or near "/"
LINE 1: alter user gopal with password /var/lib/pgsql

Test Case 6)
-bash-3.2$ pwd
/var/lib/pgsql
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$PWD'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal: $PWD
psql: FATAL: password authentication failed for user "gopal"

Test Case 7)
-bash-3.2$ pwd
/var/lib/pgsql
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal: /var/lib/pgsql
Welcome to psql 8.3.6, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

TEST3=> \q

Thanks
SureshA

-----Original Message-----
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.com]
Sent: Wednesday, November 11, 2009 1:19 PM
To: suresh adapa
Subject: Re: FW: [BUGS] postgresql-8.3.6-1PGDG : password

suresh adapa wrote:

I have a quick question. Is there any limitation on the type of
characters I use for postgresql8.36-1PGDG database password?

Hmm, I don't think so. Better stick to ASCII-characters, though. During
the authentication phase, you haven't yet connected to any database, so
it's not clear which encoding is used for the password. If you only use
one encoding across the board, it should still work, but otherwise you
can end up confused.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: suresh adapa (#1)

suresh adapa wrote:

I am basically testing few things as below for one off my Task
requirement.
Can you please check below Test Case 4,6 and 7 and comment.

I don't understand what you were trying to do and if you think there's
something wrong there..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#3suresh adapa
suresha@collab.net
In reply to: Heikki Linnakangas (#2)

Hi,

I am trying to find out limitation on what symbols can be used in
password option.

Example below attempts fail.

Does not allow to alter password if it starts with '!'
-----------------------------------------------------
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '!123'"
-bash: !123: event not found

Allows us to alter password, but fails while authentication.
------------------------------------------------------------
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$123'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
psql: FATAL: password authentication failed for user "gopal"
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$abc'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
psql: FATAL: password authentication failed for user "gopal"

If we use/script tries to use environment variables like $PWD or $PATH.
It basically expands the ENV variable and its value is stored.
----------------------------------------------------------------------

-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$PWD'"

-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:$PWD
psql: FATAL: password authentication failed for user "gopal"

-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:/var/lib/pgsql
Welcome to psql 8.3.6, the PostgreSQL interactive terminal.

Thanks
SureshA

-----Original Message-----
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.com]
Sent: Wednesday, November 11, 2009 2:46 PM
To: suresh adapa
Cc: pgsql-bugs@postgresql.org
Subject: Re: FW: [BUGS] postgresql-8.3.6-1PGDG : password

suresh adapa wrote:

I am basically testing few things as below for one off my Task
requirement.
Can you please check below Test Case 4,6 and 7 and comment.

I don't understand what you were trying to do and if you think there's
something wrong there..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: suresh adapa (#3)

You seem to be confused by bash's parameter expansion. Better read the
bash manual or a tutorial on that. Or you could open a psql session and
type the commands on the psql prompt to avoid interaction with bash.

suresh adapa wrote:

Hi,

I am trying to find out limitation on what symbols can be used in
password option.

Example below attempts fail.

Does not allow to alter password if it starts with '!'
-----------------------------------------------------
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '!123'"
-bash: !123: event not found

Allows us to alter password, but fails while authentication.
------------------------------------------------------------
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$123'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
psql: FATAL: password authentication failed for user "gopal"
-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$abc'"
-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:
psql: FATAL: password authentication failed for user "gopal"

If we use/script tries to use environment variables like $PWD or $PATH.
It basically expands the ENV variable and its value is stored.
----------------------------------------------------------------------

-bash-3.2$ psql -Upostgres -q -c "alter user gopal with password '$PWD'"

-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:$PWD
psql: FATAL: password authentication failed for user "gopal"

-bash-3.2$ psql -h 127.0.0.1 -U gopal -d TEST3
Password for user gopal:/var/lib/pgsql
Welcome to psql 8.3.6, the PostgreSQL interactive terminal.

Thanks
SureshA

-----Original Message-----
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.com]
Sent: Wednesday, November 11, 2009 2:46 PM
To: suresh adapa
Cc: pgsql-bugs@postgresql.org
Subject: Re: FW: [BUGS] postgresql-8.3.6-1PGDG : password

suresh adapa wrote:

I am basically testing few things as below for one off my Task
requirement.
Can you please check below Test Case 4,6 and 7 and comment.

I don't understand what you were trying to do and if you think there's
something wrong there..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com