Boost C++ Libraries: Ticket #7506: unique_path Fails on Windows for Temporary User Profiles https://svn.boost.org/trac10/ticket/7506 <p> boost::filesystem::unique_path is failing on Windows if the user has a temporary (read-only) profile (e.g. guest account). I have tracked the problem down to a failure in libs/filesystem/src/unique_path.cpp when it calls CryptAcquireContextW. </p> <p> CryptAcquireContextW is failing with the arguments used. It appears that this is by design, for read-only profiles. See <a class="ext-link" href="http://blogs.msdn.com/b/alejacma/archive/2007/10/23/rsacryptoserviceprovider-fails-when-used-with-mandatory-profiles.aspx"><span class="icon">​</span>http://blogs.msdn.com/b/alejacma/archive/2007/10/23/rsacryptoserviceprovider-fails-when-used-with-mandatory-profiles.aspx</a> for some background information. </p> <p> I have modified the dwFlags argument of both calls to CryptAcquireContextW, adding CRYPT_VERIFYCONTEXT | CRYPT_SILENT and it is now working for me. I'm no expert on the Win32 crypto API so I'm not sure if this is a valid solution in all contexts. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7506 Trac 1.4.3 anonymous Wed, 26 Jun 2013 09:43:31 GMT attachment set https://svn.boost.org/trac10/ticket/7506 https://svn.boost.org/trac10/ticket/7506 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">001-unique_path_windows.patch</span> </li> </ul> Ticket anonymous Wed, 26 Jun 2013 09:48:07 GMT <link>https://svn.boost.org/trac10/ticket/7506#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:1</guid> <description> <p> This issue also happens when running application in low integrity level: see msdn "Designing Applications to Run at a Low Integrity Level" </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 08 Jan 2014 10:48:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7506#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:2</guid> <description> <p> We have had a similar issue with our software on one user's machine. </p> <p> I tracked it down to CryptAcquireContextW failing with NTE_BAD_KEY_STATE (0x8009000B) - 'Key not valid for use in specified state'. </p> <p> I will test if the patch fixes their issue too. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 08 Jan 2014 16:39:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7506#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:3</guid> <description> <p> Regarding the NTE_BAD_KEY_STATE problem i mentioned above, this patch also resolves the issue. </p> <p> +1 for integrating the patch into boost. ;) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 06 Jun 2014 15:53:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7506#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:4</guid> <description> <p> The documentation for <a class="missing wiki">CryptAcquireContext</a> (which I apparently cannot link to without the post being considered spam) also says that CRYPT_VERIFYCONTEXT should be passed in the flags when doing any operation that doesn't require access to persisted private keys for performance reasons, which is the case here. </p> </description> <category>Ticket</category> </item> <item> <author>Aldo Longhi <aldo.longhi@…></author> <pubDate>Wed, 19 Nov 2014 18:26:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7506#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:5</guid> <description> <p> Is there anything preventing the integration of the provided patch to fix this bug? Is there any way to bump up its priority? Anything I can do to help? </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>kovarex@…</author> <pubDate>Sun, 11 Jan 2015 18:28:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7506#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:6</guid> <description> <p> I would also appreciate to merge the patch into the next boost version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Fri, 28 Aug 2015 14:08:54 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7506#comment:7 https://svn.boost.org/trac10/ticket/7506#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks to the submitter and all the commenters, and also Sebastian Redl for including this fix in his larger pull request <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/15" title="#15: Feature Requests: thread class needs join() with timeout (closed: None)">#15</a>. </p> <p> --Beman </p> Ticket bonnier.cedric@… Tue, 03 May 2016 11:00:22 GMT <link>https://svn.boost.org/trac10/ticket/7506#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7506#comment:8</guid> <description> <p> The pull request mentioned above is available <a class="ext-link" href="https://github.com/boostorg/filesystem/pull/15"><span class="icon">​</span>here</a> and was first included in Boost 1.60 </p> <p> Thanks for fixing that :) </p> <p> Cedric </p> </description> <category>Ticket</category> </item> </channel> </rss>