Skip to contentSkip to conversation

/etc/passwd thoughts

DISCUSSION Warren Togami 5 participants 9 messages Jun 12, 2009 – Jun 18, 2009 8 messages not in the archive

lore
Share & tools
lore
#0 lore raw

[warren@newcaprica dracut]$ grep -r \/etc\/passwd * modules.d/95nfs/install:dracut_install /etc/netconfig /etc/passwd /etc/services modules.d/95nfs/install:#echo "rpc:x:32:32:Rpcbind:/var/lib/rpcbind:/bin/false" >> "$initdir/etc/passwd" modules.d/90mdraid/install:inst /etc/passwd

It seems that we want an /etc/passwd for certain things in the initrd image, but is it really necessary for it to copy whatever users are on the generating system into the image?

Could we do anything else?

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Warren Togami

[warren@newcaprica dracut]$ grep -r \/etc\/passwd * modules.d/95nfs/install:dracut_install /etc/netconfig /etc/passwd /etc/services
modules.d/95nfs/install:#echo "rpc:x:32:32:Rpcbind:/var/lib/rpcbind:/bin/false" >> "$initdir/etc/passwd"
modules.d/90mdraid/install:inst /etc/passwd

It seems that we want an /etc/passwd for certain things in the initrd image, but is it really necessary for it to copy whatever users are on the generating system into the image?

If daemons we want/need to start want to drop privleges... yes.

Bill
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20090612202045.GA30968-Zdt1ptygihhQcNjhGXsBABcY2uh10dtjAL8bYrjMMd8@public.gmane.org

#4 lore raw
Quoted 9 lines · Bill Nottingham
Quoted 8 lines · Warren Togami

[warren@newcaprica dracut]$ grep -r \/etc\/passwd * modules.d/95nfs/install:dracut_install /etc/netconfig /etc/passwd /etc/services
modules.d/95nfs/install:#echo "rpc:x:32:32:Rpcbind:/var/lib/rpcbind:/bin/false">> "$initdir/etc/passwd"
modules.d/90mdraid/install:inst /etc/passwd

Quoted 6 lines
Quoted 3 lines

It seems that we want an /etc/passwd for certain things in the initrd image, but is it really necessary for it to copy whatever users are on the generating system into the image?

If daemons we want/need to start want to drop privleges... yes.

But it is also pulling in user accounts.

It seems the above modules.d/95nfs/install creates its own /etc/passwd entry that it expects to be there. Why can't we do this for all cases where something in the initrd needs an /etc/passwd entry?

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 14 lines · Warren Togami
Quoted 13 lines · Bill Nottingham
Quoted 11 lines · Warren Togami

[warren@newcaprica dracut]$ grep -r \/etc\/passwd * modules.d/95nfs/install:dracut_install /etc/netconfig /etc/passwd /etc/services
modules.d/95nfs/install:#echo "rpc:x:32:32:Rpcbind:/var/lib/rpcbind:/bin/false">> "$initdir/etc/passwd"
modules.d/90mdraid/install:inst /etc/passwd

It seems that we want an /etc/passwd for certain things in the initrd image, but is it really necessary for it to copy whatever users are on the generating system into the image?

Quoted 6 lines
Quoted 2 lines

If daemons we want/need to start want to drop privleges... yes.

But it is also pulling in user accounts.

It seems the above modules.d/95nfs/install creates its own /etc/passwd entry that it expects to be there. Why can't we do this for all cases where something in the initrd needs an /etc/passwd entry?

Actually 95nfs doesn't create its own entry. The part is commented out. But I agree we should do something about the passwd case.

Question: Who really needs passwd entries?
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 1 line · Seewer Philippe

Actually 95nfs doesn't create its own entry. The part is commented out.

Right; I'm torn on this. We want to support both portmap and rpcbind, and at least rpcbind needs a user to run as -- it won't run without it. I don't know what portmap wants.

I have it copying the passwd file as that seemed to be the most distro-agnostic way I could do it.

I see a few options --
1) Copy /etc/passwd from the distro into the initrd; exposes user names, but passwords should be in /etc/shadow and hence not copied.
2) Make our own users for rpcbind (and portmap if different) and just use that. rpcbind gets killed before we transition to root, so the uid doesn't have to match up.
3) Remove the need for rpcbind/portmap. Get mount fixed so it doesn't try to look for rpc.statd for NFSv4; also figure out a way to keep the kernel from trying to talk to rpcbind/portmap when mounting an NFSv4 volume.
3b) don't support locks at all on NFS roots, NFSv4 or otherwise. I don't like this, it artificially restricts options.

Quoted 3 lines

But I agree we should do something about the passwd case.

Question: Who really needs passwd entries?

rpcbind, as above. I don't know about iSCSI, is there a user-space component that persists and wants to drop permissions?

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1244859170.18551.9.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org

#10 lore raw
Quoted 6 lines · David Dillow
Quoted 1 line · Seewer Philippe

Actually 95nfs doesn't create its own entry. The part is commented out.

Right; I'm torn on this. We want to support both portmap and rpcbind, and at least rpcbind needs a user to run as -- it won't run without it. I don't know what portmap wants.

Portmap doesn't want anything. In the past, I've even run it without an /etc at all. --
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to a message not in the archive
Quoted 10 lines · David Dillow
Quoted 1 line · Seewer Philippe

Actually 95nfs doesn't create its own entry. The part is commented out.

Right; I'm torn on this. We want to support both portmap and rpcbind, and at least rpcbind needs a user to run as -- it won't run without it. I don't know what portmap wants.

I have it copying the passwd file as that seemed to be the most distro-agnostic way I could do it.

Quoted 6 lines

I see a few options --
1) Copy /etc/passwd from the distro into the initrd; exposes user names, but passwords should be in /etc/shadow and hence not copied.
2) Make our own users for rpcbind (and portmap if different) and just use that. rpcbind gets killed before we transition to root, so the uid doesn't have to match up.

It seems the correct way would be:

If rpcbind, then write only the necessary user into the initrd's /etc/passwd. Do not copy the generating system's /etc/passwd.

Any objections?

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw
Quoted 10 lines · Harald Hoyer
Quoted 4 lines

If rpcbind, then write only the necessary user into the initrd's /etc/passwd. Do not copy the generating system's /etc/passwd.

Any objections?

s.th. like

grep $user /etc/passwd >> ${initdir}/etc/passwd

?

Yes, except does the rpcbind user need to run as any userid number in particular? rpcbind gets killed before switch_root right? We might be able to do this without grep scraping.

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 8 lines · Warren Togami
Quoted 7 lines · Harald Hoyer
Quoted 4 lines

If rpcbind, then write only the necessary user into the initrd's /etc/passwd. Do not copy the generating system's /etc/passwd.

Any objections?

s.th. like

Quoted 8 lines
Quoted 3 lines

grep $user /etc/passwd >> ${initdir}/etc/passwd

?

Yes, except does the rpcbind user need to run as any userid number in particular? rpcbind gets killed before switch_root right? We might be able to do this without grep scraping.

right, OKFORME :)
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html