Description of problem: If trying to place home directories outside /home if the parent directory does not exist the create will fail. Version-Release number of selected component (if applicable): anaconda-11.1.2.209-1 How reproducible: Steps to Reproduce: 1. have kickstart file with user --name=test --uid=10034 --homedir=/apps/home/test Actual results: python traceback as /apps/home does not exist. Expected results: /apps/home is created Additional info: This was seen in a deployment where /apps is a file system mount created earlier in the install.
What's the traceback?
I believe libuser handles all the directory creation in rhel5.
Ordinarily, UNIX tools do not automatically create a whole directory structure when given a path ("mkdir" vs. "mkdir -p"); specifying such a path is quite likely to be a typo. In a post-installation environment, luseradd/libuser should thus not create the parent directories automatically, in my opinion. (FWIW, useradd(8) does not create the parent directories either.) This suggests anaconda should create the parent directories.
(In reply to comment #4) > Ordinarily, UNIX tools do not automatically create a whole directory structure > when given a path ("mkdir" vs. "mkdir -p"); specifying such a path is quite > likely to be a typo. > > In a post-installation environment, luseradd/libuser should thus not create the > parent directories automatically, in my opinion. (FWIW, useradd(8) does not > create the parent directories either.) > > This suggests anaconda should create the parent directories. Of course, this means that every single tool using libuser is going to have to check and perform these actions, which seems contrary to the entire point of using a library to me.
(In reply to comment #5) > Of course, this means that every single tool using libuser is going to have to > check and perform these actions, which seems contrary to the entire point of > using a library to me. No - in particular luseradd uses libuser and should not perform this action IMO.
> > Of course, this means that every single tool using libuser is going to have to > > check and perform these actions, which seems contrary to the entire point of > > using a library to me. > > No - in particular luseradd uses libuser and should not perform this action > IMO. Just saying "no" doesn't make it so. The fact is, every program that uses libuser is going to have to take the given home directory, chop off the username part, see if the directory exists, create it if not, and then call into libuser to have it create just the username part. That's just what is going to happen. That duplicates this code and it duplicates error handling.
(In reply to comment #7) > > > Of course, this means that every single tool using libuser is going to have to > > > check and perform these actions, which seems contrary to the entire point of > > > using a library to me. > > > > No - in particular luseradd uses libuser and should not perform this action > > IMO. > > Just saying "no" doesn't make it so. In this case it probably does, because I'm the maintainer of that program :) The reasoning is in comment 4. I might be persuaded to change my opinion, but the claim that creating parent directories automatically is expected of UNIX utilities, and in particular that every user of libuser needs to do it, is just not true I'm afraid.