Solved

How does NetUserGetInfo() get it's info?

Posted on 2002-04-03
3
278 Views
Last Modified: 2013-12-03
Hi I'm having some problems here with user authentification. Our app uses NetUserGetInfo()to get the info about the current user (home dir, home path and of course user name). But I checked some documentation and couldn't find from what it builds up it's information (if it's even accessible to us) because it returns me a wrong path and I don't know where to change the info so it will get it correctly.

A solution I was proposed was that the conflict was with the /etc/passwd file from cygwin where the network paths are read. But the solution only worked randomly and now fails so obviously it's not the final solution.

So if anyone has any info on how NetUserGetInfo() gets it's info it'd be appreciated.

Rich.
0
Comment
Question by:mannycalaveras
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6915669
'NetUserGetInfo()' obtains the information from the SAM database, that is where NT/W2k stores it's account information (either locally or on a DC). The info it returns mainly is the one eneterd via the user manager.
0
 
LVL 1

Author Comment

by:mannycalaveras
ID: 6916094
Thanks a lot!

But would you happen to know how information are built into the database? My sys admin wrote part of the code that gets home dire for the user and it's also a nice coincidence that he also created the accounts on the current pc (with 2k) but he says he did not set the home directory himself. The info must come from somewhere else but where? It's not that important since at least we can go change it in the user accounts but I wonder if it's not going to be changed back in some way (*).

* It's because it was working earlier today and I saw that I left a trace in the code that looks for the user's home directory and removed it and recompiled and did not want to work after that.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6916107
Well, what exactly is the difference (and your environment)? HOMEPATH e.g. is an environment variable that can be changed, whereas 'NetUserGetInfo()' queries the data that is used to set up the users profile.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Installer 4 76
WPF issue with Trigger 2 115
Authentication of Web Services 3 89
Input parameteres to DragOver 2 20
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question