Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-19-2003, 03:59 AM   #1
LQ Newbie
Registered: Dec 2003
Posts: 2

Rep: Reputation: 0
finding user's home directory within a daemon

What is the way to get the user's home directory from within a daemon running on linux?
Old 12-19-2003, 04:22 AM   #2
LQ Newbie
Registered: Dec 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Here is one option I just found....

#include <pwd.h>
#include <stdio.h>
#include <sys/types.h>

struct passwd *getpwent(void);

struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */

Last edited by kurienmathew; 12-19-2003 at 04:29 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission problems when removing user's home directory. davethegenius Linux - Software 3 08-11-2005 05:01 PM
Not able to go to other user's home directory biswajit_dey Linux - Software 6 07-21-2005 09:14 AM
Reading other user's home directory with Samba zupidupi Linux - Networking 7 04-14-2005 02:53 AM
Changing user's home directory? HOW barton Debian 10 04-04-2005 03:27 AM
how to change a user's Home directory n1wil Linux - General 8 08-24-2002 04:22 PM

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration