Dumb question

Поиск
Список
Период
Сортировка
От Dario Fumagalli
Тема Dumb question
Дата
Msg-id 199804241126.NAA08924@mail.art-media.it
обсуждение исходный текст
Список pgsql-interfaces
Hello everyone,

I'm back with new issues (!)

The following connection, made via WEB using a PHP3 script is successful
and does connect me with my server:

$connection = pg_connect("user=postgres password=xxxxxx dbname=giovine
host=www.bw4.com port=5432");

The remaining part of the program also performs very well, with no
glitches.


Now, I open my faithful telnet window and perform the following (after
logging in as user postgres):

$ psql -u giovine
Username: postgres
Password: (I type 'yyyyyy')

Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: giovine

giovine=>  select * from codifa where descriz like 'ASPRO%';

   codi|descriz                     |tipo|forn|sc_ri|sud_mer|
prez|scad_mm|scad
_aa|ct|tab_stu|single_ssn|sostanza|p_cip
|iva|fu|filler|tab_scad|ssn|tick|frig
|gt_gtv|minischede|dpr_stup|sottogrup_stup|nascita_mm|nascita_aa|progression
e|di
stribuzione|refi|caus_cong|minsan_32|mercato_parallelo|ass_inde|minsan_10|an
tibi
otici_m|cod_cont|note_ssn|data_ven_gg|data_ven_mm|data_ven_aa|atc
|doping|cla
sse_doping|nuovo_gm|
ean_8_13|data_val_gg|data_val_mm|data_val_aa|cod_int_di
tta|inventario|prezzo_um|aggancio_conf|data_ics_gg|data_ics_mm|data_ics_aa|d
ata_
fcs_gg|data_fcs_mm|data_fcs_aa|um|div_int_ditta|cambio_conc_ssn|cambio_sigla
_ssn
|decod_prezzo|cod_nomenclatore|aggancio_galen_fn|note_ssn_prec|filler2|prezz
o_ol
d|minsan_10_old|iva_old|ult_agg_gg|ult_agg_mm|ult_agg_aa|tipo_agg
-------+----------------------------+----+----+-----+-------+------+-------+
----
---+--+-------+----------+--------+--------+---+--+------+--------+---+----+
----
+------+----------+--------+--------------+----------+----------+-----------
-+--
-----------+----+---------+---------+-----------------+--------+---------+--
----
-------+--------+--------+-----------+-----------+-----------+-------+------
+---
----------+--------+-------------+-----------+-----------+-----------+------
----
---+----------+---------+-------------+-----------+-----------+-----------+-
----
------+-----------+-----------+--+-------------+---------------+------------
----
+------------+----------------+-----------------+-------------+-------+-----
----
-+-------------+-------+----------+----------+----------+--------
0521831|ASPRO 500*12CPR EFFERV.500MG|   0|0108|S    |U      |006400|
|
   |D |       |          |  005000|********| 10|  |      |F       |  3|
|
|  1815|          |        |              |        09|        84|A
 |
           |    |         |019M58   |                 |        |001363112|
       |      02|        |           |           |           |N02BA01|
|
          |        |             |         15|         12|         97|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
006200
 |    001363112|     04|        12|        12|        97|A
0521823|ASPRO 500*16 CPS 500 MG     |   0|0108|S    |U      |004300|
12|
 93|D |       |          |  005000| 30/1983| 10|  |      |Z       |  3|
|
|  0312|          |        |              |        06|        89|A
 |
           |    |E        |019M77   |                 |        |001363175|
       |      05|        |           |           |           |N02BA01|
|
          |        |             |         01|         11|         90|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
 |    001363175|     04|         2|        11|        95|1
0521807|ASPRO 500*20 CPR 500 MG     |   0|0108|S    |U      |005600|
|
   |D |       |          |  005000|********| 10|  |      |Z       |  3|
|
|  1815|          |        |              |        09|        84|A
 |
           |    |         |019M42   |                 |        |001363074|
       |      02|        |           |           |           |N02BA01|
|
          |        |             |         15|         12|         97|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
005400
 |    001363074|     04|        12|        12|        97|A
0521906|ASPRO C 500*12 CPR EFFERV.  |   0|0108|S    |U      |007100|
|
   |D |       |          |  507100|********| 10|  |      |F       |  3|
|
|  0312|          |        |              |        11|        90|A
 |
           |    |         |019M7M   |                 |        |001363187|
       |      02|        |           |           |           |N02BA01|
|
          |        |             |         15|         12|         97|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
006900
 |    001363187|     04|        12|        12|        97|A
0521922|ASPRO C 500*20 CPR EFFERV.  |   0|0108|S    |U      |007100|
05|
 94|D |       |          |  507100| 29/1990| 10|  |      |F       |  3|
|
|  0312|          |        |              |        11|        90|A
 |
           |    |E        |019M7Z   |                 |*       |001363199|
       |      02|        |**         |**         |**         |N02BA01|
|
          |        |             |         01|         01|
92|0000000000
000|          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
 |    001363199|     04|        25|         7|        97|A
0522136|ASPRO C 500*OS 10 BUST.     |   2|0108|S    |U      |006400|
|
   |D |       |          |  507100|********| 10|  |      |F       |  3|
|
|  0312|          |        |              |        09|        81|A
 |
           |    |         |019M6D   |                 |        |001363148|
       |      03|        |           |           |           |N02BA01|
|
          |        |             |         15|         12|         97|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
006200
 |    001363148|     04|        12|        12|        97|A
0521757|ASPRO*50 CPR 0,32 G         |   0|0108|S    |U      |007400|
12|
 97|D |       |          |  005000|********| 10|  |      |Z       |  3|
|
|  1815|          |        |              |        12|        80|A
 |
           |    |E        |019M37   |                 |        |001363047|
       |      02|        |           |           |           |N02BA01|
|
          |        |             |         01|         01|         97|
   |          |         |             |           |           |           |
      |           |           |  |             |               |
|            |                |                 |             |       |
007000
 |    001363047|     04|        23|        12|        97|A
(7 rows)

giovine=>

As you can see, the query works well...

BUT... there is a but...

The password I used to log into the database are not the real password.
So anyone can login and / or perform queries on my database using any bogus
password!

Maybe I have pg_hba.conf  porked?

I have the following relevant config:

# By default, allow anything over UNIX domain sockets and localhost.

local        all                                         trust
host         all         195.103.82.0  255.255.255.0     trust

I think I should put some password or crypt word instead of trust.

Since I'm not expert on pg_hba.conf, I would be happy if one of you big
gurus could hint me with a _real_ example (no man page "redirection",
please) of what I could put in my configuration. N.B. I need IP sockets for
my Java apps.

I would like to restrict access even on local host, so any one of my users
must know the user-name and password to connect, even in telnet.


P.S. My setup is Debian Linux 1.3.1 (Kernel 2.0.30) with PostgreSQL 6.3.1

Thanks in advance,

Dario Fumagalli
email dfumagalli@art-media.it

В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Machiel"
Дата:
Сообщение: unsubscribe
Следующее
От: Patrice Hédé
Дата:
Сообщение: Re: ODBC Doc