diff options
author | thakis <thakis@chromium.org> | 2015-02-05 19:42:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-06 03:44:25 +0000 |
commit | c0107ee59bdb5b6337f7bbdb4e8210c0bfeb547b (patch) | |
tree | 60e81dabaf818666ecb5940227b6b184e827b0ab /remoting | |
parent | 8a0f4e28e2030d0a6ad09b68311efc428cc48ce6 (diff) | |
download | chromium_src-c0107ee59bdb5b6337f7bbdb4e8210c0bfeb547b.zip chromium_src-c0107ee59bdb5b6337f7bbdb4e8210c0bfeb547b.tar.gz chromium_src-c0107ee59bdb5b6337f7bbdb4e8210c0bfeb547b.tar.bz2 |
Revert "Enable positional parameters for base::vsnprintf and base::vswprintf on Windows."
This reverts r127788. Positional parameters aren't part of the C standard
(they are part of POSIX though), we don't really use them in the codebase,
and they don't work in chrome/android with libc++. Rather
than have a test for them, make them also not work on Windows (like they
originally didn't) -- we shouldn't use positional printf parameters anyways.
Change the 5 uses to not use positional parameters.
BUG=118064,117028,427718
Review URL: https://codereview.chromium.org/902643002
Cr-Commit-Position: refs/heads/master@{#314963}
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/ipc_util_win.cc | 6 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host.cc | 6 | ||||
-rw-r--r-- | remoting/host/win/unprivileged_process_delegate.cc | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/remoting/host/ipc_util_win.cc b/remoting/host/ipc_util_win.cc index dbc5c54..22ac15a 100644 --- a/remoting/host/ipc_util_win.cc +++ b/remoting/host/ipc_util_win.cc @@ -39,8 +39,10 @@ bool CreateConnectedIpcChannel( // between CreateNamedPipe() and CreateFile() calls before it will be passed // to the network process. It gives full access to the account that // the calling code is running under and denies access by anyone else. - std::string security_descriptor = base::StringPrintf( - "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::WideToUTF8(user_sid).c_str()); + std::string user_sid_utf8 = base::WideToUTF8(user_sid); + std::string security_descriptor = + base::StringPrintf("O:%sG:%sD:(A;;GA;;;%s)", user_sid_utf8.c_str(), + user_sid_utf8.c_str(), user_sid_utf8.c_str()); // Generate a unique name for the channel. std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID(); diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index e3480b1..7472c24 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc @@ -584,8 +584,10 @@ void Me2MeNativeMessagingHost::EnsureElevatedHostCreated() { // Create a security descriptor that gives full access to the caller and // denies access by anyone else. - std::string security_descriptor = base::StringPrintf( - "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::UTF16ToASCII(user_sid).c_str()); + std::string user_sid_ascii = base::UTF16ToASCII(user_sid); + std::string security_descriptor = + base::StringPrintf("O:%sG:%sD:(A;;GA;;;%s)", user_sid_ascii.c_str(), + user_sid_ascii.c_str(), user_sid_ascii.c_str()); ScopedSd sd = ConvertSddlToSd(security_descriptor); if (!sd) { diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc index b7997912..0537218 100644 --- a/remoting/host/win/unprivileged_process_delegate.cc +++ b/remoting/host/win/unprivileged_process_delegate.cc @@ -58,7 +58,7 @@ const char kLowIntegrityMandatoryLabel[] = "S:(ML;CIOI;NW;;;LW)"; // containers and objects inherit ACE giving SYSTEM and the logon SID full // access to them as well. const char kWindowStationSdFormat[] = "O:SYG:SYD:(A;CIOIIO;GA;;;SY)" - "(A;CIOIIO;GA;;;%1$s)(A;NP;0xf037f;;;SY)(A;NP;0xf037f;;;%1$s)"; + "(A;CIOIIO;GA;;;%s)(A;NP;0xf037f;;;SY)(A;NP;0xf037f;;;%s)"; // Security descriptor of the worker process. It gives access SYSTEM full access // to the process. It gives READ_CONTROL, SYNCHRONIZE, PROCESS_QUERY_INFORMATION @@ -123,7 +123,8 @@ bool CreateWindowStationAndDesktop(ScopedSid logon_sid, std::string desktop_sddl = base::StringPrintf(kDesktopSdFormat, logon_sid_string.c_str()); std::string window_station_sddl = - base::StringPrintf(kWindowStationSdFormat, logon_sid_string.c_str()); + base::StringPrintf(kWindowStationSdFormat, logon_sid_string.c_str(), + logon_sid_string.c_str()); // The worker runs at low integrity level. Make sure it will be able to attach // to the window station and desktop. |