LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-19-2003, 03:59 AM   #1
kurienmathew
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
kurienmathew
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.
 
  


Reply


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 03:04 AM.

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