Recompiling pam_mkhomedir.so to create a different directory structure
Google_at_UserID.net
Date: 01/30/05
- Next message: ronwer: "Re: First time user of Red Hat - some simple questions"
- Previous message: mi-andrea: "installazione fedora core 2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jan 2005 09:40:29 -0800
I'm modifying the pam_mkhomedir.so pam module to have it create a
directory hierarchy as opposed to just one directory. I need it to
split up the username into several parts as follows:
Username=AABBCC
Home dir=/export/home/AA/AABB/AABBCC
Already created=/export/home
pam_mkhomedir.so needs to create:
/export/home/AA (root owned, 770)
/export/home/AABB (root owned, 770)
/export/home/AABBCC (user owned, 775)
I've modified the module such that it does what I want it to (does the
above) but I'm cheating with system() calls. I'd like to know if
someone knows how to get around using the system() calls. My problem
is that when I use C calls such as mkdir(dir,perms) that it creates the
directory as the user. I noticed that system() calls are run by root.
I'm currently creating the first two dirs with system() calls which are
created and owned by root and the last with mkdir() owned by the user.
I'd like to accomplish this without using system() at all.
Ideas? anyone?
Thanks,
Michael Thompson
Wayne State University
- Next message: ronwer: "Re: First time user of Red Hat - some simple questions"
- Previous message: mi-andrea: "installazione fedora core 2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|