Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
10aabbf9
Commit
10aabbf9
authored
Jun 14, 2007
by
Juanma Barranquero
Browse files
(init_user_info): Fix weird formatting not following GNU coding guidelines.
parent
94d9d20c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
src/w32.c
src/w32.c
+12
-16
No files found.
src/w32.c
View file @
10aabbf9
...
...
@@ -486,20 +486,16 @@ init_user_info ()
the user-sid as the user id value (same for group id using the
primary group sid from the process token). */
char
user_sid
[
256
],
name
[
256
],
domain
[
256
];
DWORD
length
=
sizeof
(
name
),
dlength
=
sizeof
(
domain
),
trash
;
HANDLE
token
=
NULL
;
SID_NAME_USE
user_type
;
if
(
open_process_token
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
)
&&
get_token_information
(
token
,
TokenUser
,
(
PVOID
)
user_sid
,
sizeof
(
user_sid
),
&
trash
)
&&
lookup_account_sid
(
NULL
,
*
((
PSID
*
)
user_sid
),
name
,
&
length
,
domain
,
&
dlength
,
&
user_type
)
)
char
user_sid
[
256
],
name
[
256
],
domain
[
256
];
DWORD
length
=
sizeof
(
name
),
dlength
=
sizeof
(
domain
),
trash
;
HANDLE
token
=
NULL
;
SID_NAME_USE
user_type
;
if
(
open_process_token
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
)
&&
get_token_information
(
token
,
TokenUser
,
(
PVOID
)
user_sid
,
sizeof
(
user_sid
),
&
trash
)
&&
lookup_account_sid
(
NULL
,
*
((
PSID
*
)
user_sid
),
name
,
&
length
,
domain
,
&
dlength
,
&
user_type
))
{
strcpy
(
the_passwd
.
pw_name
,
name
);
/* Determine a reasonable uid value. */
...
...
@@ -524,7 +520,7 @@ init_user_info ()
/* Get group id */
if
(
get_token_information
(
token
,
TokenPrimaryGroup
,
(
PVOID
)
user_sid
,
sizeof
(
user_sid
),
&
trash
))
(
PVOID
)
user_sid
,
sizeof
(
user_sid
),
&
trash
))
{
SID_IDENTIFIER_AUTHORITY
*
pSIA
;
...
...
@@ -541,7 +537,7 @@ init_user_info ()
}
}
/* If security calls are not supported (presumably because we
are running under Windows 95), fallback to this. */
are running under Windows 95), fallback to this. */
else
if
(
GetUserName
(
name
,
&
length
))
{
strcpy
(
the_passwd
.
pw_name
,
name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment