Menu

Support for hostname in queries

Help
2004-03-18
2004-03-22
  • Jacob DeGlopper

    Jacob DeGlopper - 2004-03-18

    I would find it useful to be able to include the source hostname as part of the mysql queries.

    This would be useful in an environment where a number of hosts are authenticating against one central database, where users may or may not have accounts on a given host, but where they should have the same information across all hosts.

     
    • Mike Noordermeer

      Isn't it just possible to change the queries in the configfiles? Or are these also shared?

       
      • Ben Goodwin

        Ben Goodwin - 2004-03-18

        Right.  Unless you _need_ to have the same config on every machine, your /etc/libnss-mysql.cfg could contain a MySQL query along the lines of:

        getpwnam    SELECT username,'x',uid,gid,gecos,homedir,shell FROM users WHERE username='%s' AND hostname='insert-your-hostname-here' LIMIT 1

        You'd need to modify all your queries similarly.

         
    • Jacob DeGlopper

      Jacob DeGlopper - 2004-03-22

      Excuse me while I beat myself for that one. :)  Even if I wanted to autogenerate the configs, it's easy enough to include a static hostname in there.

       

Log in to post a comment.