Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c65bcce5
Commit
c65bcce5
authored
Mar 02, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Map the Unix user id to a local user SID instead of the interactive SID.
parent
d523dee7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
15 deletions
+17
-15
security.c
dlls/advapi32/tests/security.c
+3
-9
environ.c
dlls/kernel32/tests/environ.c
+1
-2
registry.c
server/registry.c
+1
-1
security.h
server/security.h
+1
-1
token.c
server/token.c
+11
-2
No files found.
dlls/advapi32/tests/security.c
View file @
c65bcce5
...
@@ -1674,10 +1674,7 @@ static void test_LookupAccountSid(void)
...
@@ -1674,10 +1674,7 @@ static void test_LookupAccountSid(void)
user_sizeA
=
MAX_PATH
;
user_sizeA
=
MAX_PATH
;
ret
=
GetUserNameA
(
usernameA
,
&
user_sizeA
);
ret
=
GetUserNameA
(
usernameA
,
&
user_sizeA
);
ok
(
ret
,
"GetUserNameA() Expected TRUE, got FALSE
\n
"
);
ok
(
ret
,
"GetUserNameA() Expected TRUE, got FALSE
\n
"
);
todo_wine
ok
(
lstrcmpA
(
usernameA
,
accountA
)
==
0
,
"LookupAccountSidA() Expected account name: %s got: %s
\n
"
,
usernameA
,
accountA
);
{
ok
(
lstrcmpA
(
usernameA
,
accountA
)
==
0
,
"LookupAccountSidA() Expected account name: %s got: %s
\n
"
,
usernameA
,
accountA
);
}
}
}
HeapFree
(
GetProcessHeap
(),
0
,
ptiUser
);
HeapFree
(
GetProcessHeap
(),
0
,
ptiUser
);
...
@@ -1912,11 +1909,8 @@ static void test_LookupAccountName(void)
...
@@ -1912,11 +1909,8 @@ static void test_LookupAccountName(void)
get_sid_info
(
psid
,
&
account
,
&
sid_dom
);
get_sid_info
(
psid
,
&
account
,
&
sid_dom
);
ok
(
ret
,
"Failed to lookup account name
\n
"
);
ok
(
ret
,
"Failed to lookup account name
\n
"
);
ok
(
sid_size
==
GetLengthSid
(
psid
),
"Expected %d, got %d
\n
"
,
GetLengthSid
(
psid
),
sid_size
);
ok
(
sid_size
==
GetLengthSid
(
psid
),
"Expected %d, got %d
\n
"
,
GetLengthSid
(
psid
),
sid_size
);
todo_wine
ok
(
!
lstrcmp
(
account
,
user_name
),
"Expected %s, got %s
\n
"
,
user_name
,
account
);
{
ok
(
!
lstrcmp
(
domain
,
sid_dom
),
"Expected %s, got %s
\n
"
,
sid_dom
,
domain
);
ok
(
!
lstrcmp
(
account
,
user_name
),
"Expected %s, got %s
\n
"
,
user_name
,
account
);
ok
(
!
lstrcmp
(
domain
,
sid_dom
),
"Expected %s, got %s
\n
"
,
sid_dom
,
domain
);
}
ok
(
domain_size
==
domain_save
-
1
,
"Expected %d, got %d
\n
"
,
domain_save
-
1
,
domain_size
);
ok
(
domain_size
==
domain_save
-
1
,
"Expected %d, got %d
\n
"
,
domain_save
-
1
,
domain_size
);
ok
(
strlen
(
domain
)
==
domain_size
,
"Expected %d, got %d
\n
"
,
lstrlen
(
domain
),
domain_size
);
ok
(
strlen
(
domain
)
==
domain_size
,
"Expected %d, got %d
\n
"
,
lstrlen
(
domain
),
domain_size
);
ok
(
sid_use
==
SidTypeUser
,
"Expected SidTypeUser (%d), got %d
\n
"
,
SidTypeUser
,
sid_use
);
ok
(
sid_use
==
SidTypeUser
,
"Expected SidTypeUser (%d), got %d
\n
"
,
SidTypeUser
,
sid_use
);
...
...
dlls/kernel32/tests/environ.c
View file @
c65bcce5
...
@@ -72,8 +72,7 @@ static void test_Predefined(void)
...
@@ -72,8 +72,7 @@ static void test_Predefined(void)
ok
(
NoErr
,
"Failed to open token, error %u
\n
"
,
GetLastError
());
ok
(
NoErr
,
"Failed to open token, error %u
\n
"
,
GetLastError
());
DataSize
=
sizeof
(
Data
);
DataSize
=
sizeof
(
Data
);
NoErr
=
pGetUserProfileDirectoryA
(
Token
,
Data
,
&
DataSize
);
NoErr
=
pGetUserProfileDirectoryA
(
Token
,
Data
,
&
DataSize
);
todo_wine
ok
(
NoErr
,
"Failed to get user profile dir, error %u
\n
"
,
ok
(
NoErr
,
"Failed to get user profile dir, error %u
\n
"
,
GetLastError
());
GetLastError
());
if
(
NoErr
)
if
(
NoErr
)
{
{
EnvSize
=
GetEnvironmentVariableA
(
"USERPROFILE"
,
Env
,
sizeof
(
Env
));
EnvSize
=
GetEnvironmentVariableA
(
"USERPROFILE"
,
Env
,
sizeof
(
Env
));
...
...
server/registry.c
View file @
c65bcce5
...
@@ -1718,7 +1718,7 @@ void init_registry(void)
...
@@ -1718,7 +1718,7 @@ void init_registry(void)
/* load user.reg into HKEY_CURRENT_USER */
/* load user.reg into HKEY_CURRENT_USER */
/* FIXME: match default user in token.c. should get from process token instead */
/* FIXME: match default user in token.c. should get from process token instead */
current_user_path
=
format_user_registry_path
(
security_
interactive
_sid
,
&
current_user_str
);
current_user_path
=
format_user_registry_path
(
security_
local_user
_sid
,
&
current_user_str
);
if
(
!
current_user_path
||
if
(
!
current_user_path
||
!
(
hkcu
=
create_key_recursive
(
root_key
,
&
current_user_str
,
current_time
)))
!
(
hkcu
=
create_key_recursive
(
root_key
,
&
current_user_str
,
current_time
)))
fatal_error
(
"could not create HKEY_CURRENT_USER registry key
\n
"
);
fatal_error
(
"could not create HKEY_CURRENT_USER registry key
\n
"
);
...
...
server/security.h
View file @
c65bcce5
...
@@ -40,7 +40,7 @@ extern const LUID SeImpersonatePrivilege;
...
@@ -40,7 +40,7 @@ extern const LUID SeImpersonatePrivilege;
extern
const
LUID
SeCreateGlobalPrivilege
;
extern
const
LUID
SeCreateGlobalPrivilege
;
extern
const
PSID
security_world_sid
;
extern
const
PSID
security_world_sid
;
extern
const
PSID
security_
interactive
_sid
;
extern
const
PSID
security_
local_user
_sid
;
extern
const
PSID
security_local_system_sid
;
extern
const
PSID
security_local_system_sid
;
...
...
server/token.c
View file @
c65bcce5
...
@@ -70,11 +70,20 @@ static const SID interactive_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY },
...
@@ -70,11 +70,20 @@ static const SID interactive_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY },
static
const
SID
anonymous_logon_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_ANONYMOUS_LOGON_RID
}
};
static
const
SID
anonymous_logon_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_ANONYMOUS_LOGON_RID
}
};
static
const
SID
authenticated_user_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_AUTHENTICATED_USER_RID
}
};
static
const
SID
authenticated_user_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_AUTHENTICATED_USER_RID
}
};
static
const
SID
local_system_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_LOCAL_SYSTEM_RID
}
};
static
const
SID
local_system_sid
=
{
SID_REVISION
,
1
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_LOCAL_SYSTEM_RID
}
};
static
const
struct
/* same fields as struct SID */
{
BYTE
Revision
;
BYTE
SubAuthorityCount
;
SID_IDENTIFIER_AUTHORITY
IdentifierAuthority
;
DWORD
SubAuthority
[
5
];
}
local_user_sid
=
{
SID_REVISION
,
5
,
{
SECURITY_NT_AUTHORITY
},
{
SECURITY_NT_NON_UNIQUE
,
0
,
0
,
0
,
1000
}
};
const
PSID
security_world_sid
=
(
PSID
)
&
world_sid
;
const
PSID
security_world_sid
=
(
PSID
)
&
world_sid
;
static
const
PSID
security_local_sid
=
(
PSID
)
&
local_sid
;
static
const
PSID
security_local_sid
=
(
PSID
)
&
local_sid
;
const
PSID
security_interactive_sid
=
(
PSID
)
&
interactive_sid
;
static
const
PSID
security_interactive_sid
=
(
PSID
)
&
interactive_sid
;
static
const
PSID
security_authenticated_user_sid
=
(
PSID
)
&
authenticated_user_sid
;
static
const
PSID
security_authenticated_user_sid
=
(
PSID
)
&
authenticated_user_sid
;
const
PSID
security_local_system_sid
=
(
PSID
)
&
local_system_sid
;
const
PSID
security_local_system_sid
=
(
PSID
)
&
local_system_sid
;
const
PSID
security_local_user_sid
=
(
PSID
)
&
local_user_sid
;
static
luid_t
prev_luid_value
=
{
1000
,
0
};
static
luid_t
prev_luid_value
=
{
1000
,
0
};
...
@@ -194,7 +203,7 @@ const SID *security_unix_uid_to_sid( uid_t uid )
...
@@ -194,7 +203,7 @@ const SID *security_unix_uid_to_sid( uid_t uid )
{
{
/* very simple mapping: either the current user or not the current user */
/* very simple mapping: either the current user or not the current user */
if
(
uid
==
getuid
())
if
(
uid
==
getuid
())
return
&
interactive
_sid
;
return
(
const
SID
*
)
&
local_user
_sid
;
else
else
return
&
anonymous_logon_sid
;
return
&
anonymous_logon_sid
;
}
}
...
...
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