6
6
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
7
7
*
8
8
* IDENTIFICATION
9
- * $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.5 2004/10/12 21:54:39 petere Exp $
9
+ * $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.6 2004/11/09 13:01:25 petere Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -36,7 +36,7 @@ pgwin32_is_admin(void)
36
36
37
37
if (!OpenProcessToken (GetCurrentProcess (), TOKEN_READ , & AccessToken ))
38
38
{
39
- write_stderr ("could not open process token: %d\n" ,
39
+ write_stderr ("could not open process token: error code %d\n" ,
40
40
(int ) GetLastError ());
41
41
exit (1 );
42
42
}
@@ -49,7 +49,7 @@ pgwin32_is_admin(void)
49
49
50
50
if (GetLastError () != ERROR_INSUFFICIENT_BUFFER )
51
51
{
52
- write_stderr ("could not get token information: %d\n" ,
52
+ write_stderr ("could not get token information: error code %d\n" ,
53
53
(int ) GetLastError ());
54
54
exit (1 );
55
55
}
@@ -66,7 +66,7 @@ pgwin32_is_admin(void)
66
66
if (!GetTokenInformation (AccessToken , TokenGroups , InfoBuffer ,
67
67
InfoBufferSize , & InfoBufferSize ))
68
68
{
69
- write_stderr ("could not get token information: %d\n" ,
69
+ write_stderr ("could not get token information: error code %d\n" ,
70
70
(int ) GetLastError ());
71
71
exit (1 );
72
72
}
@@ -77,7 +77,7 @@ pgwin32_is_admin(void)
77
77
SECURITY_BUILTIN_DOMAIN_RID , DOMAIN_ALIAS_RID_ADMINS , 0 , 0 , 0 , 0 , 0 ,
78
78
0 , & AdministratorsSid ))
79
79
{
80
- write_stderr ("could not get SID for Administrators group: %d\n" ,
80
+ write_stderr ("could not get SID for Administrators group: error code %d\n" ,
81
81
(int ) GetLastError ());
82
82
exit (1 );
83
83
}
@@ -86,7 +86,7 @@ pgwin32_is_admin(void)
86
86
SECURITY_BUILTIN_DOMAIN_RID , DOMAIN_ALIAS_RID_POWER_USERS , 0 , 0 , 0 , 0 , 0 ,
87
87
0 , & PowerUsersSid ))
88
88
{
89
- write_stderr ("could not get SID for PowerUsers group: %d\n" ,
89
+ write_stderr ("could not get SID for PowerUsers group: error code %d\n" ,
90
90
(int ) GetLastError ());
91
91
exit (1 );
92
92
}
@@ -146,15 +146,15 @@ pgwin32_is_service(void)
146
146
147
147
if (!OpenProcessToken (GetCurrentProcess (), TOKEN_READ , & AccessToken ))
148
148
{
149
- fprintf (stderr , "could not open process token: %d\n" ,
149
+ fprintf (stderr , "could not open process token: error code %d\n" ,
150
150
(int ) GetLastError ());
151
151
return -1 ;
152
152
}
153
153
154
154
/* First check for local system */
155
155
if (!GetTokenInformation (AccessToken , TokenUser , InfoBuffer , 1024 , & InfoBufferSize ))
156
156
{
157
- fprintf (stderr , "could not get token information: %d\n" ,
157
+ fprintf (stderr , "could not get token information: error code %d\n" ,
158
158
(int ) GetLastError ());
159
159
return -1 ;
160
160
}
@@ -181,7 +181,7 @@ pgwin32_is_service(void)
181
181
/* Now check for group SID */
182
182
if (!GetTokenInformation (AccessToken , TokenGroups , InfoBuffer , 1024 , & InfoBufferSize ))
183
183
{
184
- fprintf (stderr , "could not get token information: %d\n" ,
184
+ fprintf (stderr , "could not get token information: error code %d\n" ,
185
185
(int ) GetLastError ());
186
186
return -1 ;
187
187
}
0 commit comments