[PATCH] Support: Provide a function to get the home directory of an arbitrary user

Zachary Turner zturner at google.com
Fri Aug 1 10:39:44 PDT 2014


The problem is that it requires TOKEN_IMPERSONATE, which will require you
to provide login credentials.


On Fri, Aug 1, 2014 at 10:33 AM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Thu, Jul 31, 2014 at 8:42 PM, Zachary Turner <zturner at google.com>
> wrote:
> > Hi rnk,
> >
> > llvm::sys::path already provides a function home_directory() which
> returns the current user's home directory.
> >
> > 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
> >
> > http://reviews.llvm.org/D4749
> >
> > Files:
> >   include/llvm/Support/Path.h
> >   lib/Support/Unix/Path.inc
> >   lib/Support/Windows/Path.inc
>
> Instead of trawling the registry (which is fragile and subject to
> change), I would feel *way* more comfortable using the designated API
> for this sort of thing (SHGetKnownFolderPath). It accepts a token
> which you can use to impersonate a particular user.
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140801/794d5366/attachment.html>


More information about the llvm-commits mailing list