Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-14 Thread Dan McGhee
On 10/13/2013 11:02 PM, Bruce Dubbs wrote:
 Drew Ames wrote:
 On 10/13/2013 06:48 PM, Dan McGhee wrote:
 I got to chroot and the copied su from shadow in Ch 5 didn't work. I
 can find no reason that it didn't. What I want to do now is compile it
 in chroot environment and install only it there. Just in case I missed
 some kind of linking. That seems unlikely, but ldd /tools/bin/su
 (on the copied version) provided:
 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
 as did ldd on my DESTDIR install, so it looks like everything is there.

   
did some snipping
 Dan, Bruce, and Ken,

 I've been following this thread with interest. I'm into my fourth LFS
 build, using LFS 7.4.

 For my previous three builds, I successfully use the package user hint
 without any problems. Now I'm facing the same issues as Dan.
 more snipping
 I tried building su from an old source at this link, starting at line 802:

 http://wiki.linuxfromscratch.org/hints/browser/trunk/PREVIOUS_FORMAT/more_control_and_pkg_man.txt?rev=904

 I built it with GCC at the end of chapter 5 (I typed 'gcc -o su su.c'),
 then copied it to /tools/bin.
 When I got to chapter 6, as the root user in the chroot environment,
 that copy of su would not switch users to the linux-libc-headers user I
 created for the first package. I got the error:

 bash: /tools/bin/su: No such file or directory

 I then copied su from the host system and got the same results.

 Dan, when you say that su didn't work for you. Did you get an error message?
 I don't know, but I wonder if the problem is the lack of passwd, group,
 shadow, etc files.  You need to track the source to find out.  Just add
 printf statements at strategic places.
Bruce, I think your on to something. Thank goodness for this list. Many 
times I can get into a thinking rut when I'm troubleshooting. Fresh 
minds really help.

I'm thinking that the previous version of su supplied with coreutils was 
a stand alone binary. The versions supplied now by shadow and 
util-linux depend on auxiliary stuff as you mentioned; i.e., we don't 
install su from util-linux because it depends on pam, which we don't 
use. Shadow, I think, integrally supplies the monitoring that pam does. 
When I examined shadow's configure --help this AM, I found this:

 --enable-shadowgrp enable shadow group support [default=yes]
 ...
 --enable-account-tools-setuid
 Install the user and group management tools setuid
 and authenticate the callers. This requires
 --with-pam.
Additionally, shadow tracks the number of logins, failed logins and all 
that other stuff. But I don't know how few of these additional files are 
needed to run it.

If someone were familiar with printf, Bruce, I think you're right. :) 
I've been trying to learn about it this morning and know that I can 
change decimal numbers to octal or hex or any combination of that. I 
found that I can make pretty tables and center text, but I could find no 
examples of how to use it in the way you described. What kind of 
strategic places were you thinking and in what context?

Until I understand more than what I do now about printf, I need to use 
brute force. :) My first thought is to try to use shadow's su from my 
DESTIR install without configuring shadow. If this works, I could then 
start removing stuff from DESTDIR/bin until su fails. Absent success 
there, I could do the same thing in chroot environment. I don't like to 
erase the slate but I could always nuke my build thus far, bring in 
my backed up /tools, and do the shadow stuff as lfs.

For the package users who are monitoring this thread, Rob Taylor 
installed and configured shadow at the beginng Ch. 6. He then overwrote 
it in its regular sequence. There were a few hiccups as he noted in 
his build notes, but package users know how to get past those. :) Here's 
a link to his notes:


https://www.javacrypt.com/lfs/my_lfs_7_4_notes.txt

I'm always interested in learning more about this stuff. I would 
appreciate it, Bruce, if you could share some of your ideas about the 
printf strategy, if you can spare the time.

Thanks,
Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-14 Thread Bruce Dubbs
Dan McGhee wrote:
 On 10/13/2013 11:02 PM, Bruce Dubbs wrote:
 Drew Ames wrote:
 On 10/13/2013 06:48 PM, Dan McGhee wrote:
 I got to chroot and the copied su from shadow in Ch 5 didn't work. I
 can find no reason that it didn't. What I want to do now is compile it
 in chroot environment and install only it there. Just in case I missed
 some kind of linking. That seems unlikely, but ldd /tools/bin/su
 (on the copied version) provided:
 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
 as did ldd on my DESTDIR install, so it looks like everything is there.


 did some snipping
 Dan, Bruce, and Ken,

 I've been following this thread with interest. I'm into my fourth LFS
 build, using LFS 7.4.

 For my previous three builds, I successfully use the package user hint
 without any problems. Now I'm facing the same issues as Dan.
 more snipping
 I tried building su from an old source at this link, starting at line 802:

 http://wiki.linuxfromscratch.org/hints/browser/trunk/PREVIOUS_FORMAT/more_control_and_pkg_man.txt?rev=904

 I built it with GCC at the end of chapter 5 (I typed 'gcc -o su su.c'),
 then copied it to /tools/bin.
 When I got to chapter 6, as the root user in the chroot environment,
 that copy of su would not switch users to the linux-libc-headers user I
 created for the first package. I got the error:

 bash: /tools/bin/su: No such file or directory

 I then copied su from the host system and got the same results.

 Dan, when you say that su didn't work for you. Did you get an error message?
 I don't know, but I wonder if the problem is the lack of passwd, group,
 shadow, etc files.  You need to track the source to find out.  Just add
 printf statements at strategic places.
 Bruce, I think your on to something. Thank goodness for this list. Many
 times I can get into a thinking rut when I'm troubleshooting. Fresh
 minds really help.

 I'm thinking that the previous version of su supplied with coreutils was
 a stand alone binary. The versions supplied now by shadow and
 util-linux depend on auxiliary stuff as you mentioned; i.e., we don't
 install su from util-linux because it depends on pam, which we don't
 use. Shadow, I think, integrally supplies the monitoring that pam does.
 When I examined shadow's configure --help this AM, I found this:

 --enable-shadowgrp enable shadow group support [default=yes]
 ...
 --enable-account-tools-setuid
 Install the user and group management tools setuid
 and authenticate the callers. This requires
 --with-pam.
 Additionally, shadow tracks the number of logins, failed logins and all
 that other stuff. But I don't know how few of these additional files are
 needed to run it.

 If someone were familiar with printf, Bruce, I think you're right. :)
 I've been trying to learn about it this morning and know that I can
 change decimal numbers to octal or hex or any combination of that. I
 found that I can make pretty tables and center text, but I could find no
 examples of how to use it in the way you described. What kind of
 strategic places were you thinking and in what context?

In the source, add something like:

printf( After executing foo\n );

at places and recompile.  Then test and see if you get that output.  If 
not then back up.  Sometimes I just use printf( \n );, , , 
etc in the code.  Note that the same thing can be done easier in gdb 
using stepping and preakpoints, but that's a bit difficult in this 
environment.

If you are not familiar with C and have trouble understanding the code, 
this may not be the method that works for you.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-14 Thread Dan McGhee
On 10/14/2013 10:18 AM, Bruce Dubbs wrote:
 Dan McGhee wrote:
 On 10/13/2013 11:02 PM, Bruce Dubbs wrote:
 Drew Ames wrote:
 On 10/13/2013 06:48 PM, Dan McGhee wrote:
 I got to chroot and the copied su from shadow in Ch 5 didn't work. I
 can find no reason that it didn't. What I want to do now is compile it
 in chroot environment and install only it there. Just in case I missed
 some kind of linking. That seems unlikely, but ldd /tools/bin/su
 (on the copied version) provided:
 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
 as did ldd on my DESTDIR install, so it looks like everything is there.


 did some snipping
 Dan, Bruce, and Ken,

 I've been following this thread with interest. I'm into my fourth LFS
 build, using LFS 7.4.

 For my previous three builds, I successfully use the package user hint
 without any problems. Now I'm facing the same issues as Dan.
 more snipping
 I tried building su from an old source at this link, starting at line 802:

 http://wiki.linuxfromscratch.org/hints/browser/trunk/PREVIOUS_FORMAT/more_control_and_pkg_man.txt?rev=904

 I built it with GCC at the end of chapter 5 (I typed 'gcc -o su su.c'),
 then copied it to /tools/bin.
 When I got to chapter 6, as the root user in the chroot environment,
 that copy of su would not switch users to the linux-libc-headers user I
 created for the first package. I got the error:

 bash: /tools/bin/su: No such file or directory

 I then copied su from the host system and got the same results.

 Dan, when you say that su didn't work for you. Did you get an error 
 message?
 I don't know, but I wonder if the problem is the lack of passwd, group,
 shadow, etc files.  You need to track the source to find out.  Just add
 printf statements at strategic places.
 Bruce, I think your on to something. Thank goodness for this list. Many
 times I can get into a thinking rut when I'm troubleshooting. Fresh
 minds really help.

 I'm thinking that the previous version of su supplied with coreutils was
 a stand alone binary. The versions supplied now by shadow and
 util-linux depend on auxiliary stuff as you mentioned; i.e., we don't
 install su from util-linux because it depends on pam, which we don't
 use. Shadow, I think, integrally supplies the monitoring that pam does.
 When I examined shadow's configure --help this AM, I found this:

 --enable-shadowgrp enable shadow group support [default=yes]
 ...
 --enable-account-tools-setuid
 Install the user and group management tools setuid
 and authenticate the callers. This requires
 --with-pam.
 Additionally, shadow tracks the number of logins, failed logins and all
 that other stuff. But I don't know how few of these additional files are
 needed to run it.

 If someone were familiar with printf, Bruce, I think you're right. :)
 I've been trying to learn about it this morning and know that I can
 change decimal numbers to octal or hex or any combination of that. I
 found that I can make pretty tables and center text, but I could find no
 examples of how to use it in the way you described. What kind of
 strategic places were you thinking and in what context?
 In the source, add something like:

 printf( After executing foo\n );

 at places and recompile.  Then test and see if you get that output.  If
 not then back up.  Sometimes I just use printf( \n );, , ,
 etc in the code.  Note that the same thing can be done easier in gdb
 using stepping and preakpoints, but that's a bit difficult in this
 environment.

 If you are not familiar with C and have trouble understanding the code,
 this may not be the method that works for you.

 -- Bruce
Therin lies the rub, Bruce. For many things in LFS, I know enough to ask 
semi-relevant questions, but the only thing I know about C is that it 
exists. Sounds like a project for one of those long, midwest winter 
nights when the north wind is howling at about 25 knots during a 
blizzard, and I have my hands wrapped around a piping mug of tea with 
honey and lemon.

But for the topic at hand. I couldn't get su to work from a DESTDIR 
install even after I configured it in the DESTDIR--in chroot 
environment. Look like a regular install of shadow is in order. For 
purposes of the hint, assuming success with this step, I'll use the 
nuke the build option and see if I can get shadow to work at the end 
of Ch. 5. Depending on which one succeeds, I will recommend updating the 
hint accordingly.

Thanks for the help.

Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][UNRESURRECTED]

2013-10-14 Thread Dan McGhee
On 10/14/2013 10:40 AM, Dan McGhee wrote:
 But for the topic at hand. I couldn't get su to work from a DESTDIR 
 install even after I configured it in the DESTDIR--in chroot 
 environment. Look like a regular install of shadow is in order. For 
 purposes of the hint, assuming success with this step, I'll use the 
 nuke the build option and see if I can get shadow to work at the end 
 of Ch. 5. Depending on which one succeeds, I will recommend updating 
 the hint accordingly. Thanks for the help. Dan 
I've tested four different ways to provide su before starting to build 
the linux headers in Ch. 6.

1. compile shadow and cp su to /tools/bin in Ch. 5
2. install shadow at the end of Ch. 5 as lfs and not root.
3. compile shadow as root in the chroot environment and copy su to 
/tools/bin
4. install shadow as root before building the headers in Ch. 6

The only one that worked for me is the last one. The only thing I didn't 
do was configure shadow after installation, and su still worked. I'll 
configure it when shadow is installed in the course of going through Ch. 
6. So, I think this process needs to be added to the hint.

One of the reasons I like Package Users is that it's really easy to 
completely remove the files installed by a package. Installing shadow as 
root this way eliminates that and I don't know that shadow will over 
write it's files when installing as a package user when originally it 
was installed as root. That's something I'll be watching for as I make 
my way through.

This might be the time to mention a trick I learned with find. Using 
-newer and ! -newer in a find command can bracket those files 
installed by one package. You can create a time window that's only two 
minutes wide. I haven't tested the seconds.

Thanks to all who responded in this thread.

Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-13 Thread Dan McGhee
On 10/08/2013 11:14 AM, Dan McGhee wrote:
 On 10/07/2013 08:33 PM, Bruce Dubbs wrote:
 Ken Moffat wrote:
 On Mon, Oct 07, 2013 at 11:59:00PM +0100, Ken Moffat wrote:
 The usual way to look at what gets installed is to run 'make
 DESTDIR=/path/to/somewhere install [ optional args ]' - once you get
 into DESTDIR installs for looking at what is installed you will find
 some packages use other variables (often INSTALLROOT or something
 like that) - if shadow is such a package,then running *as a user*
 will fail.  So try it as a user, to a directory which that user can
 write to.

 OK, so you can't try a DESTDIR install as a normal user because you
 are root and 'su' doesn't exist.  Build outside the new system as
 user lfs and do a DESTDIR, e.g. to /home/lfs/somewhere or
 /tmp/somewhere.  The same for su from old coreutils (my notes show
 that I had to build all of coreutils to get su linked - there might
 be a shorter series of commands - but NOT which old version of
 coreutils last contained 'su'.
 If the only thing needed is su, then I'd build shadow with:

 ./configure  make  cp src/su /tools/bin

 It doesn't need to be suid since it's run by root.

  -- Bruce

 SNIP
 I have su now in the tool chain. I won't need it until I get to CH. 6,
 but with my OCD kicking in I wanted to build it just after coreutils in
 CH. 5. I suppose it doesn't really make any difference, but...
 snip
I got to chroot and the copied su from shadow in Ch 5 didn't work. I can 
find no reason that it didn't. What I want to do now is compile it in 
chroot environment and install only it there. Just in case I missed some 
kind of linking. That seems unlikely, but

ldd /tools/bin/su (on the copied version) provided:

 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
as did ldd on my DESTDIR install, so it looks like everything is there.

The two lines from the install log that I need are

libtool: install: /usr/bin/install -c su /home/dan/LFS-7.4/shadow/bin/su

and

chmod -f 4755 /home/dan/LFS-7.4/shadow/bin/su;

So after I compile I need either

make install -c -m 0755 src/su /tools/bin

or

install -c -m 0755 src/su /tools/bin

Which of the two commands will give me the necessary linking I need? 
Does it make a difference? Is the sytax correct. I apologize for being 
such a make and install dummy. It's just one of those things that I 
haven't gotten. BTW, I neither need nor want mode 4755 for the chroot 
environment.

Thanks,
Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-13 Thread Drew Ames
On 10/13/2013 06:48 PM, Dan McGhee wrote:
 I got to chroot and the copied su from shadow in Ch 5 didn't work. I 
 can find no reason that it didn't. What I want to do now is compile it 
 in chroot environment and install only it there. Just in case I missed 
 some kind of linking. That seems unlikely, but ldd /tools/bin/su 
 (on the copied version) provided:
 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
 as did ldd on my DESTDIR install, so it looks like everything is there.

 The two lines from the install log that I need are

 libtool: install: /usr/bin/install -c su /home/dan/LFS-7.4/shadow/bin/su

 and

 chmod -f 4755 /home/dan/LFS-7.4/shadow/bin/su;

 So after I compile I need either

 make install -c -m 0755 src/su /tools/bin

 or

 install -c -m 0755 src/su /tools/bin

 Which of the two commands will give me the necessary linking I need?
 Does it make a difference? Is the sytax correct. I apologize for being
 such a make and install dummy. It's just one of those things that I
 haven't gotten. BTW, I neither need nor want mode 4755 for the chroot
 environment.

 Thanks,
 Dan

Dan, Bruce, and Ken,

I've been following this thread with interest. I'm into my fourth LFS 
build, using LFS 7.4.

For my previous three builds, I successfully use the package user hint 
without any problems. Now I'm facing the same issues as Dan.

I tried building su from an old source at this link, starting at line 802:

http://wiki.linuxfromscratch.org/hints/browser/trunk/PREVIOUS_FORMAT/more_control_and_pkg_man.txt?rev=904

I built it with GCC at the end of chapter 5 (I typed 'gcc -o su su.c'), 
then copied it to /tools/bin.

When I got to chapter 6, as the root user in the chroot environment, 
that copy of su would not switch users to the linux-libc-headers user I 
created for the first package. I got the error:

bash: /tools/bin/su: No such file or directory

I then copied su from the host system and got the same results.

Dan, when you say that su didn't work for you. Did you get an error message?

Thanks,
-Drew
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-13 Thread Dan McGhee
On 10/13/2013 08:56 PM, Drew Ames wrote:
 The two lines from the install log that I need are

 libtool: install: /usr/bin/install -c su /home/dan/LFS-7.4/shadow/bin/su

 and

 chmod -f 4755 /home/dan/LFS-7.4/shadow/bin/su;

 So after I compile I need either

 make install -c -m 0755 src/su /tools/bin

 or

 install -c -m 0755 src/su /tools/bin

 Which of the two commands will give me the necessary linking I need?
 Does it make a difference? Is the sytax correct. I apologize for being
 such a make and install dummy. It's just one of those things that I
 haven't gotten. BTW, I neither need nor want mode 4755 for the chroot
 environment.


 When I got to chapter 6, as the root user in the chroot environment,
 that copy of su would not switch users to the linux-libc-headers user I
 created for the first package. I got the error:

 bash: /tools/bin/su: No such file or directory

 I then copied su from the host system and got the same results.

 Dan, when you say that su didn't work for you. Did you get an error message?
Drew, good to see you're still around. It has been a long time.

I got no error or anything when I tried. Since I posted, I configured 
and compiled shadow using the book
instructions for its installation in Ch. 6, removed the su I had copied 
earlier, then ran

install -c -o 0755 src/su /tools/bin

I got the same results--nothing. I was still root after I ran su 
linux-headers

I'm stumped. I don't know where to look to troubleshoot. Rob Taylor just 
installed shadow before the linux headers and su worked. He reinstalled 
shadow in the normal course of things. This causes a few hiccups during 
Ch. 6--largely with install directories. I found an su file that is 
installed to /etc/pam.d, but since Ch 6 configures shadow not to depend 
on pam--because it's not installed--I doubt that would have any affect 
on the situation.

Before I give up and install the entire shadow pacakge, I'm probably 
going to do a DESTDIR install somewhere in /mnt/lfs and try coping the 
binary to /tools/bin. We'll see what happens.

Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED][RESURRECTED]

2013-10-13 Thread Bruce Dubbs
Drew Ames wrote:
 On 10/13/2013 06:48 PM, Dan McGhee wrote:
 I got to chroot and the copied su from shadow in Ch 5 didn't work. I
 can find no reason that it didn't. What I want to do now is compile it
 in chroot environment and install only it there. Just in case I missed
 some kind of linking. That seems unlikely, but ldd /tools/bin/su
 (on the copied version) provided:
 linux-vdso.so.1 (0x79b38000)
 libcrypt.so.1 = /tools/lib/libcrypt.so.1 (0x7f20fb668000)
 libc.so.6 = /tools/lib/libc.so.6 (0x7f20fb2b8000)
 /tools/lib64/ld-linux-x86-64.so.2 (0x7f20fb8a)
 as did ldd on my DESTDIR install, so it looks like everything is there.

 The two lines from the install log that I need are

 libtool: install: /usr/bin/install -c su /home/dan/LFS-7.4/shadow/bin/su

 and

 chmod -f 4755 /home/dan/LFS-7.4/shadow/bin/su;

 So after I compile I need either

 make install -c -m 0755 src/su /tools/bin

 or

 install -c -m 0755 src/su /tools/bin

 Which of the two commands will give me the necessary linking I need?
 Does it make a difference? Is the sytax correct. I apologize for being
 such a make and install dummy. It's just one of those things that I
 haven't gotten. BTW, I neither need nor want mode 4755 for the chroot
 environment.

 Thanks,
 Dan

 Dan, Bruce, and Ken,

 I've been following this thread with interest. I'm into my fourth LFS
 build, using LFS 7.4.

 For my previous three builds, I successfully use the package user hint
 without any problems. Now I'm facing the same issues as Dan.

 I tried building su from an old source at this link, starting at line 802:

 http://wiki.linuxfromscratch.org/hints/browser/trunk/PREVIOUS_FORMAT/more_control_and_pkg_man.txt?rev=904

 I built it with GCC at the end of chapter 5 (I typed 'gcc -o su su.c'),
 then copied it to /tools/bin.

 When I got to chapter 6, as the root user in the chroot environment,
 that copy of su would not switch users to the linux-libc-headers user I
 created for the first package. I got the error:

 bash: /tools/bin/su: No such file or directory

 I then copied su from the host system and got the same results.

 Dan, when you say that su didn't work for you. Did you get an error message?

I don't know, but I wonder if the problem is the lack of passwd, group, 
shadow, etc files.  You need to track the source to find out.  Just add 
printf statements at strategic places.

   -- Bruce



-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED]

2013-10-08 Thread Dan McGhee
On 10/07/2013 08:33 PM, Bruce Dubbs wrote:
 Ken Moffat wrote:
 On Mon, Oct 07, 2013 at 11:59:00PM +0100, Ken Moffat wrote:
The usual way to look at what gets installed is to run 'make
 DESTDIR=/path/to/somewhere install [ optional args ]' - once you get
 into DESTDIR installs for looking at what is installed you will find
 some packages use other variables (often INSTALLROOT or something
 like that) - if shadow is such a package,then running *as a user*
 will fail.  So try it as a user, to a directory which that user can
 write to.

OK, so you can't try a DESTDIR install as a normal user because you
 are root and 'su' doesn't exist.  Build outside the new system as
 user lfs and do a DESTDIR, e.g. to /home/lfs/somewhere or
 /tmp/somewhere.  The same for su from old coreutils (my notes show
 that I had to build all of coreutils to get su linked - there might
 be a shorter series of commands - but NOT which old version of
 coreutils last contained 'su'.
 If the only thing needed is su, then I'd build shadow with:

 ./configure  make  cp src/su /tools/bin

 It doesn't need to be suid since it's run by root.

 -- Bruce

Thanks to you both. Ken, I had forgotten about DESTDIR and was able to 
refresh my memory.

I have su now in the tool chain. I won't need it until I get to CH. 6, 
but with my OCD kicking in I wanted to build it just after coreutils in 
CH. 5. I suppose it doesn't really make any difference, but...

Bruce, I've forgotten the ins and outs of login vs. nonlogin shells, 
but in the package user system su is used to go from 'root' to 'pkgusr.' 
Of course, then, it's run by root, but I have also used it to go from 
'pkgusr' to 'root' so I don't have to keep logging in. The test for this 
build will occur when I get to Ch. 6.

Thanks again to you both.

Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED]

2013-10-08 Thread Bruce Dubbs
Dan McGhee wrote:
 On 10/07/2013 08:33 PM, Bruce Dubbs wrote:
 Ken Moffat wrote:
 On Mon, Oct 07, 2013 at 11:59:00PM +0100, Ken Moffat wrote:
 The usual way to look at what gets installed is to run 'make
 DESTDIR=/path/to/somewhere install [ optional args ]' - once you get
 into DESTDIR installs for looking at what is installed you will find
 some packages use other variables (often INSTALLROOT or something
 like that) - if shadow is such a package,then running *as a user*
 will fail.  So try it as a user, to a directory which that user can
 write to.

 OK, so you can't try a DESTDIR install as a normal user because you
 are root and 'su' doesn't exist.  Build outside the new system as
 user lfs and do a DESTDIR, e.g. to /home/lfs/somewhere or
 /tmp/somewhere.  The same for su from old coreutils (my notes show
 that I had to build all of coreutils to get su linked - there might
 be a shorter series of commands - but NOT which old version of
 coreutils last contained 'su'.
 If the only thing needed is su, then I'd build shadow with:

 ./configure  make  cp src/su /tools/bin

 It doesn't need to be suid since it's run by root.


 Thanks to you both. Ken, I had forgotten about DESTDIR and was able to
 refresh my memory.

 I have su now in the tool chain. I won't need it until I get to CH. 6,
 but with my OCD kicking in I wanted to build it just after coreutils in
 CH. 5. I suppose it doesn't really make any difference, but...

 Bruce, I've forgotten the ins and outs of login vs. nonlogin shells,
 but in the package user system su is used to go from 'root' to 'pkgusr.'
 Of course, then, it's run by root, but I have also used it to go from
 'pkgusr' to 'root' so I don't have to keep logging in. The test for this
 build will occur when I get to Ch. 6.

I don't use the pkgusr technique.  I just use jhalfs.  That said,  I 
think I'd install sudo from blfs just before chapter 6 for doing what 
you want.  The syntax is easier and it can be set to not request a 
password.  To use it, you would need to wait until after section 6.6.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Getting su in Chapter 5 [SOLVED]

2013-10-08 Thread Dan McGhee
On 10/08/2013 11:33 AM, Bruce Dubbs wrote:
 I don't use the pkgusr technique. I just use jhalfs. That said, I 
 think I'd install sudo from blfs just before chapter 6 for doing what 
 you want. The syntax is easier and it can be set to not request a 
 password. To use it, you would need to wait until after section 6.6. 
 -- Bruce 
Thanks, Bruce. It's been three years since I've done any of this, and 
the whole thing involves a lot of memory refreshment. In fact, in the 
last build I did, coreutils supplied su. So

As far as using 'root' in pgkusers, there are two things:

1. ldcong
2. the commands in Ch. 6 that must be run as root.

This all goes away after the shadow install and currently package user's 
scripts have one that works around needing to be root to use ldconfig. 
I've not tried it yet.

AND, I never considered sudo until Ken mentioned it earlier.

It's going to be a day or two until I get to CH. 6, but I'll see what 
the easiest approach will be. This AM, I used the copying method you 
suggested, but su needed a password and crypt killed the process. 
Probably because I'm still using the host system. Maybe things will be 
different after CHROOT. We'll see.

Thanks again.

Dan

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page