The Open Source Swiss Army Knife

/code/c/unix_c/
/code/c/unix_c/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /code   /c   /unix_c 
Permalink: seteuid.c
Title: seteuid
article options : please login   |  raw source view  

             /*
                 * Also make sure that real and effective uids are the same.
                 * Executing Postgres as a setuid program from a root shell is a
                 * security hole, since on many platforms a nefarious subroutine
                 * could setuid back to root if real uid is root.  (Since nobody
                 * actually uses Postgres as a setuid program, trying to actively
                 * fix this situation seems more trouble than it's worth; we'll
                 * just expend the effort to check for it.)
                 */
                if (getuid() != geteuid())
                {
                        fprintf(stderr, gettext("%s: real and effective user ids must match\n"),
                                        argv[0]);
                        exit(1);
                }
        }

// source:  postgresql-7.3.1/src/backend/main/main.c
// their security check

Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top