Opened 19 years ago

Closed 18 years ago

#1058 closed defect (wontfix)

changing user breaks when chrooted in script

Reported by: kevinlyles@… Owned by: alfs-log@…
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 kpfleming@…, 19 years ago

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.

comment:2 by kevinlyles@…, 19 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 kpfleming@…, 19 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 Mr.subhash@…, 18 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:5 by jamie@…, 18 years ago

Are you using numeric UID's?

comment:6 by kevinlyles@…, 18 years ago

Resolution: wontfix
Status: newclosed

(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.

Note: See TracTickets for help on using tickets.