Recompiling pam_mkhomedir.so to create a different directory structure

Google_at_UserID.net
Date: 01/30/05


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



Relevant Pages

  • Re: Prevent log in as root
    ... Sounds like you want to implement something like Role Based Access Control (RBAC). ... A quick search on Freshmeat turned up this PAM module which may allow you to do the job... ... > to only log in as admin and su to root. ...
    (RedHat)
  • pam passlen
    ... Anyone know of a pam module that will enforce a specified minimum password ... length for root uid=0 users in a non-nameservice environment? ... For solaris ...
    (comp.unix.solaris)
  • [opensuse] Re: OpenSuse 10.2
    ... Last night I successfully installed OpenSuse 10.2. ... a root username and password unsuccessfully. ...
    (SuSE)
  • RE: unable to login as user
    ... unable to login as user ... Log in as root and look closely at the user account. ... the system just seems to hang and then go back to the username ...
    (RedHat)
  • Re: Samba share, authentication
    ... smbpasswd -a username ... (enter root password). ... My shares are just how I need them. ... local network file sharing". ...
    (alt.os.linux.suse)