The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PostgreSQL "ident sameuser" issue

Discussion in 'cPanel Developers' started by djbob2, Aug 4, 2008.

  1. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Hello all. I am having some trouble with PostgreSQL, and I was wondering if anybody could help. My progress can be seen in this topic. I decided to make a new thread as I was taking the discussion a little off-topic, especially with my newfound errors.

    First problem:
    The "ident sameuser" verification listed in pg_hba.conf is not working properly. Any user on my server can access any database, as if the configuration is set to "trust". Any suggestions, or should I send this matter over to cPanel support?

    /var/lib/pgsql/data/pg_hba.conf
    Code:
    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
    # "local" is for Unix domain socket connections only
    local   all         all                               ident sameuser
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          ident sameuser
    # IPv6 local connections:
    host    all         all         ::1/128               ident sameuser
    /home/djbob/public_html/pg_test.php (owned by user djbob, group djbob... suphp is in place so would not be working otherwise)
    PHP:
    <?php

    $conn 
    pg_pconnect("dbname=stevie_test"); // Database created by user "stevie"

    if (!$conn) {
      echo 
    "An error occured.\n";
    } else {
      echo 
    "success";
    }

    ?>
    Second problem:
    This problem seems like a design bug. Maybe I should submit it to the cPanel bug tracker? I will copy what I posted in the older thread.

    1) cPanel needs to be able to access PostgreSQL. The only way cPanel is able to authenticate is via the "ident sameuser" authentication method, or just using "trust" to allow anyone.
    2) PHPPgAdmin needs to be able to access PostgreSQL. The only way PHPpgAdmin is able to authenticate is via the "password" or "md5" authentication methods, or just using "trust" to allow anyone.
    3) "Trust" is not an OK configuration because it allows users to access other users' databases.
    4) PostgreSQL does not allow multiple authentication methods.

    I would appreciate assistance on either problem. Thanks everyone :)
     
    #1 djbob2, Aug 4, 2008
    Last edited: Aug 4, 2008

Share This Page