~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/port/exec.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *
10
10
 *
11
11
 * IDENTIFICATION
12
 
 *        $PostgreSQL: pgsql/src/port/exec.c,v 1.62 2009/01/01 17:24:04 momjian Exp $
 
12
 *        $PostgreSQL: pgsql/src/port/exec.c,v 1.63 2009/06/11 14:49:15 momjian Exp $
13
13
 *
14
14
 *-------------------------------------------------------------------------
15
15
 */
56
56
static char *pipe_read_line(char *cmd, char *line, int maxsize);
57
57
 
58
58
#ifdef WIN32
59
 
static BOOL GetUserSid(PSID * ppSidUser, HANDLE hToken);
 
59
static BOOL GetUserSid(PSID *ppSidUser, HANDLE hToken);
60
60
#endif
61
61
 
62
62
/*
736
736
        }
737
737
 
738
738
        /* Get the ACL info */
739
 
        if (!GetAclInformation(ptdd->DefaultDacl, (LPVOID) & asi,
 
739
        if (!GetAclInformation(ptdd->DefaultDacl, (LPVOID) &asi,
740
740
                                                   (DWORD) sizeof(ACL_SIZE_INFORMATION),
741
741
                                                   AclSizeInformation))
742
742
        {
752
752
        }
753
753
 
754
754
        /* Figure out the size of the new ACL */
755
 
        dwNewAclSize = asi.AclBytesInUse + sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(psidUser) - sizeof(DWORD);
 
755
        dwNewAclSize = asi.AclBytesInUse + sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(psidUser) -sizeof(DWORD);
756
756
 
757
757
        /* Allocate the ACL buffer & initialize it */
758
758
        pacl = (PACL) LocalAlloc(LPTR, dwNewAclSize);
771
771
        /* Loop through the existing ACEs, and build the new ACL */
772
772
        for (i = 0; i < (int) asi.AceCount; i++)
773
773
        {
774
 
                if (!GetAce(ptdd->DefaultDacl, i, (LPVOID *) & pace))
 
774
                if (!GetAce(ptdd->DefaultDacl, i, (LPVOID *) &pace))
775
775
                {
776
776
                        log_error("could not get ACE: %lu", GetLastError());
777
777
                        goto cleanup;
794
794
        /* Set the new DACL in the token */
795
795
        tddNew.DefaultDacl = pacl;
796
796
 
797
 
        if (!SetTokenInformation(hToken, tic, (LPVOID) & tddNew, dwNewAclSize))
 
797
        if (!SetTokenInformation(hToken, tic, (LPVOID) &tddNew, dwNewAclSize))
798
798
        {
799
799
                log_error("could not set token information: %lu", GetLastError());
800
800
                goto cleanup;
824
824
 * Get the SID for the current user
825
825
 */
826
826
static BOOL
827
 
GetUserSid(PSID * ppSidUser, HANDLE hToken)
 
827
GetUserSid(PSID *ppSidUser, HANDLE hToken)
828
828
{
829
829
        DWORD           dwLength;
830
830
        PTOKEN_USER pTokenUser = NULL;