<div dir="ltr">Talked about it with rnk some, I think maybe we can just delete the entire windows implementation of this function and have it return false.  These directories on Windows are going to be ACLed to the teeth and we won't be able to read or even traverse an arbitrary user's home directory anyway, so there's kind of no point in doing this.  So, proposal: Unix implementation remains the same, Windows implementation is one line that returns false.<div>
<br></div><div>Thoughts?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 10:39 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The problem is that it requires TOKEN_IMPERSONATE, which will require you to provide login credentials.</div>
<div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 10:33 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Thu, Jul 31, 2014 at 8:42 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>


> Hi rnk,<br>
><br>
> llvm::sys::path already provides a function home_directory() which returns the current user's home directory.<br>
><br>
> This patch extends this by implementing a function which returns the home directory of an arbitrary user.  This satisfies a use case in LLDB where we need to resolve paths of the form ~username/path, and since it is similar in nature to the existing home_directory() function, seems generally useful for llvm<br>


><br>
> <a href="http://reviews.llvm.org/D4749" target="_blank">http://reviews.llvm.org/D4749</a><br>
><br>
> Files:<br>
>   include/llvm/Support/Path.h<br>
>   lib/Support/Unix/Path.inc<br>
>   lib/Support/Windows/Path.inc<br>
<br>
</div></div>Instead of trawling the registry (which is fragile and subject to<br>
change), I would feel *way* more comfortable using the designated API<br>
for this sort of thing (SHGetKnownFolderPath). It accepts a token<br>
which you can use to impersonate a particular user.<br>
<br>
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx</a><br>
<span><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>