Opened 20 years ago
Closed 19 years ago
#1058 closed defect (wontfix)
changing user breaks when chrooted in script
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | nALFS - Back End (XML Handlers) | Version: | 1.2.4 |
Severity: | normal | Keywords: | |
Cc: |
Description
I am attempting to modify the default ALFS profile so that I can automate my own package-handling system, using package users (as described in one of the hints on the LFS site). Anyway, it requires change to a user that only exists on my LFS partition (not on the parent system) while chrooted into the LFS partition.
This doesn't work; it gives the error "user not found". However, if I manually
chroot and then su to the user, everything works as expected. I'm not entirely clear on how exactly nALFS does all of the context switching, but this seems like a bug to me. I'd be happy to give any additional information necessary. Thanks!
Kevin
Change History (6)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
Ok...then is there any way to su and pass the input ahead of time or something?
I really don't want to do this all by hand...
Or, could I create temporary users on my host system (making sure the uids were the same) and then continue, removing them when I'm done?
Any help would be appreciated.
Kevin
comment:3 by , 20 years ago
Yes, you can create matching users on the host and inside $LFS, that will work fine. You can also use the 'user' elements to go to a numeric UID instead of a username, which will work in spite of the library not being able to see the usernames you have placed in /etc/passwd inside $LFS.
comment:4 by , 19 years ago
(In reply to comment #3)
Yes, you can create matching users on the host and inside $LFS, that will work fine.
I tried to make matching entries in /etc/passwd and /etc/groups on the host and still getting the user not found error.
sub#
comment:6 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
(In reply to comment #5)
Are you using numeric UID's?
No. I ended up just executing the command "su <username> -c '<command(s)>'", which ran the command inside a shell that recognized the users. I'd post an example of the code, but I don't have it any more (I eventually just decided to switch to Gentoo; they have support for preventing package collisions, which was the whole reason I wanted to be able to execute things as different users).
Marking WONTFIX because it's still unconfirmed.
I don't know if this will ever work in nALFS 1.x. The way it is implemented now, the only user/group list that the C library (in memory in the nALFS process) will ever see is the one on the host system, because every nALFS child process is forked, so the library never looks at the files in the LFS partition.