* [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base
@ 2011-12-23 8:04 Dave Young
2011-12-25 11:49 ` Cong Wang
0 siblings, 1 reply; 5+ messages in thread
From: Dave Young @ 2011-12-23 8:04 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA, soltys-R61QfzASbfY
ssh module will need root user in /etc/passwd, so add root and nobody
to /etc/passwd in 99base instead of nfs module
---
modules.d/95nfs/module-setup.sh | 2 --
modules.d/99base/module-setup.sh | 4 ++++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index bb3b793..674a438 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -65,8 +65,6 @@ install() {
# Rather than copy the passwd file in, just set a user for rpcbind
# We'll save the state and restart the daemon from the root anyway
- egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd"
- egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
egrep '^nfsnobody:' /etc/passwd >> "$initdir/etc/passwd"
egrep '^rpc:' /etc/passwd >> "$initdir/etc/passwd"
egrep '^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 5297a9d..f6c1209 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -20,6 +20,10 @@ install() {
dracut_install bash
(ln -s bash "${initdir}/bin/sh" || :)
fi
+
+ #add common users in /etc/passwd, it will be used by nfs/ssh currently
+ egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd"
+ egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
# install our scripts and hooks
inst "$moddir/init" "/init"
inst "$moddir/initqueue" "/sbin/initqueue"
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base
2011-12-23 8:04 [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base Dave Young
@ 2011-12-25 11:49 ` Cong Wang
2011-12-26 1:57 ` Dave Young
0 siblings, 1 reply; 5+ messages in thread
From: Cong Wang @ 2011-12-25 11:49 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
On Fri, 23 Dec 2011 at 08:04 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> ssh module will need root user in /etc/passwd, so add root and nobody
> to /etc/passwd in 99base instead of nfs module
Huh? Even for who don't use either ssh module or nfs module??
I think you just need to copy these two lines into your ssh module...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base
2011-12-25 11:49 ` Cong Wang
@ 2011-12-26 1:57 ` Dave Young
[not found] ` <4EF7D46E.4000109-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Dave Young @ 2011-12-26 1:57 UTC (permalink / raw)
To: Cong Wang; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On 12/25/2011 07:49 PM, Cong Wang wrote:
> On Fri, 23 Dec 2011 at 08:04 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> ssh module will need root user in /etc/passwd, so add root and nobody
>> to /etc/passwd in 99base instead of nfs module
>
> Huh? Even for who don't use either ssh module or nfs module??
>
> I think you just need to copy these two lines into your ssh module...
Thanks for your review.
in 90mdraid module there's words in its comments about passwd, so there
might be more modules need passwd.
Dealing with same thing in multi module is not good, not only duplicate
code, but also they could cause conflict. Ie. nfs set root home dir to /
but we need /root, if nfs module added after ssh-client the home dir of
root will be /.
>
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base
[not found] ` <4EF7D46E.4000109-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2011-12-26 4:58 ` Cong Wang
[not found] ` <CAM_iQpW2FH_ob3u22nii3tAe-yUX-iPctDb2KEPwptrugdQbsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Cong Wang @ 2011-12-26 4:58 UTC (permalink / raw)
To: Dave Young; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Mon, Dec 26, 2011 at 9:57 AM, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On 12/25/2011 07:49 PM, Cong Wang wrote:
>
>> On Fri, 23 Dec 2011 at 08:04 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>> ssh module will need root user in /etc/passwd, so add root and nobody
>>> to /etc/passwd in 99base instead of nfs module
>>
>> Huh? Even for who don't use either ssh module or nfs module??
>>
>> I think you just need to copy these two lines into your ssh module...
>
>
> Thanks for your review.
>
> in 90mdraid module there's words in its comments about passwd, so there
> might be more modules need passwd.
But there are still more modules that don't need passwd, right?
>
> Dealing with same thing in multi module is not good, not only duplicate
> code, but also they could cause conflict. Ie. nfs set root home dir to /
> but we need /root, if nfs module added after ssh-client the home dir of
> root will be /.
If you don't want to duplicate the code, make it a function (maybe in
dracut-function?),
putting it in base module is confusing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base
[not found] ` <CAM_iQpW2FH_ob3u22nii3tAe-yUX-iPctDb2KEPwptrugdQbsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-12-26 5:42 ` Dave Young
0 siblings, 0 replies; 5+ messages in thread
From: Dave Young @ 2011-12-26 5:42 UTC (permalink / raw)
To: Cong Wang; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On 12/26/2011 12:58 PM, Cong Wang wrote:
> On Mon, Dec 26, 2011 at 9:57 AM, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> On 12/25/2011 07:49 PM, Cong Wang wrote:
>>
>>> On Fri, 23 Dec 2011 at 08:04 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>>> ssh module will need root user in /etc/passwd, so add root and nobody
>>>> to /etc/passwd in 99base instead of nfs module
>>>
>>> Huh? Even for who don't use either ssh module or nfs module??
>>>
>>> I think you just need to copy these two lines into your ssh module...
>>
>>
>> Thanks for your review.
>>
>> in 90mdraid module there's words in its comments about passwd, so there
>> might be more modules need passwd.
>
> But there are still more modules that don't need passwd, right?
>
>>
>> Dealing with same thing in multi module is not good, not only duplicate
>> code, but also they could cause conflict. Ie. nfs set root home dir to /
>> but we need /root, if nfs module added after ssh-client the home dir of
>> root will be /.
>
> If you don't want to duplicate the code, make it a function (maybe in
> dracut-function?),
> putting it in base module is confusing.
Scratching head.. I'm feeling bad to add same user multi-times, Yes not
all modules need passwd, but I still think it is a base thing.
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-26 5:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 8:04 [PATCH 1/4 branch usrmove] deal common part of etc passwd in 99base Dave Young
2011-12-25 11:49 ` Cong Wang
2011-12-26 1:57 ` Dave Young
[not found] ` <4EF7D46E.4000109-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-12-26 4:58 ` Cong Wang
[not found] ` <CAM_iQpW2FH_ob3u22nii3tAe-yUX-iPctDb2KEPwptrugdQbsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-26 5:42 ` Dave Young
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox