Reply
Thread Tools
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#361
Originally Posted by iDont View Post
root = sudo gainroot --use-su = su - (note the inclusion of the dash)
root = sudo gainroot --use-su = *sudo* su -

just doing "su -" won't work because su = busybox, and busybox (1.20.2power4) is not setuid.

Which leads me to the question (I know there's a newer version, I haven't installed it yet): has the question been settled, whether it's better to have a setuid /bin/busybox or two separate busybox'es (one setuid, the other not).

At least su and ping need that.
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
Posts: 43 | Thanked: 45 times | Joined on Jun 2010 @ Sweden
#362
Originally Posted by reinob View Post
Busybox's shell (ash) sources the script referenced by the ENV variable, if set.

So you could put your aliases under /root/.bashrc, and then edit /usr/sbin/gainroot and change this line:
Code:
HISTFILE=/root/.ash_history /bin/sh
to
Code:
HISTFILE=/root/.ash_history ENV=/root/.bashrc /bin/sh
and you're set.

For a login shell ("root" = "sudo gainroot --use-su" == "sudo su -") /root/.profile will be sourced, which in turn will source /root/.bashrc.
Thanks, works wonderfully with that small modification.

On the "man" issue, as mentioned it would be great to add essential parts of the man-db-n900 package so that man is fully functional but skipping most, if not all, of the actual manual pages (~15 MB). That way you could pick and choose the pages you want/need and place them in /opt/man.
 

The Following 3 Users Say Thank You to sowwhatyoureap For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#363
To complete the offtopic discussion about aliases:
I put a script into /etc/profiles.d/ and put there my aliases common for user and root. For aliases that should be different I put them into a
if [ `id -u` != 0 ]
then
alias iwpower='sudo iwconfig wlan0 txpower '
else
alias iwpower='iwconfig wlan0 txpower '
fi
section.
Not sure if this is unix conform, but it works. And I have all my aliases in one place.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#364
BTT
I just read the change log
1.21.0power2 * Apply BusyBox 1.21.0 hotfixes
* Divert busybox binary to /opt/busybox-power
Does that mean from this verion on the bb power binary is located on /opt ?
What if I run a shell from early bootstage, i.e. from multiboot/backupmenu. Will there be any bb available then?
I assume not as the link to bb power replaced original bb. This would be a no-go for me. I could live with stock bb available, but I guess that is not the case?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Posts: 268 | Thanked: 1,053 times | Joined on May 2010 @ The Netherlands
#365
Originally Posted by reinob View Post
root = sudo gainroot --use-su = *sudo* su -

just doing "su -" won't work because su = busybox, and busybox (1.20.2power4) is not setuid.

Which leads me to the question (I know there's a newer version, I haven't installed it yet): has the question been settled, whether it's better to have a setuid /bin/busybox or two separate busybox'es (one setuid, the other not).

At least su and ping need that.
No, the issue hasn't been settled. Setuid BusyBox will cause glibc to modify the environment of all invoked applets[1], including the shell (remember the issue with $TMPDIR not being set?). The separate busybox'es posed some issues with backupmenu IIRC, which incorrectly assumed that some tool was provided by /bin/busybox.

So at this moment, the situation wrt su and ping (bug #700) is not resolved. I'm willing to give the busybox split another shot if you like. I haven't actively pursuit this issue because, well, nobody brought it up again until you did (and it doesn't scratch my itch, to put it somewhat bluntly).

By the way, another option would be to compile su (~15KiB) and ping (~25KiB) as separate executables from BusyBox' source and include those in busybox-power's packaging. How do you feel about this option?

[1] http://www.win.tue.nl/~aeb/linux/hh/hh-8.html#ss8.10

Originally Posted by sowwhatyoureap View Post
Tried that and it apparently did make man locate the page, however running "man find" again I instead get
Code:
sh: gtbl: not found
sh: nroff: not found
suggesting that I'm missing commands gtbl and nroff. Googling, these appear to be associated with formatting and rendering the manual pages. Looking at the description for the man-db-n900 package it says it uses the groff suite to format and display man pages, so I guess I'm better off just installing that.
BusyBox doesn't have an implementation of those applications, so you'll always have to install groff-base. man-db-n900 also depends on it.

So to recap:

What you need to do to get BusyBox' man working:
1) export MANPATH
2) install groff-base
3) copy your man pages to $MANPATH

What busybox-power could do, respectively:
1) include an /etc/man.conf to make man automatically look for pages in /opt/man, just like man-db-n900
2) make our packaging suggest the package groff-base* and provide man-db-n900
3) include BusyBox' man page by default (installed to /opt/man)

What you will gain if busybox-power would do the above:
You won't need to install man-db-n900 as BusyBox provides man .

* I think it's best to suggest the package instead of depending on it as not everyone installs busybox-power for man.

Originally Posted by peterleinchen View Post
To complete the offtopic discussion about aliases:
I put a script into /etc/profiles.d/ and put there my aliases common for user and root. For aliases that should be different I put them into a
section.
Not sure if this is unix conform, but it works. And I have all my aliases in one place.
Nice hack . I hadn't thought about using and centralizing aliases in such a way.

Originally Posted by peterleinchen View Post
BTT
I just read the change log
Does that mean from this verion on the bb power binary is located on /opt ?
What if I run a shell from early bootstage, i.e. from multiboot/backupmenu. Will there be any bb available then?
I assume not as the link to bb power replaced original bb. This would be a no-go for me. I could live with stock bb available, but I guess that is not the case?
Don't worry, we're talking about the location to which the original binary is diverted when installing busybox-power. Busybox-power's binary will always install to /bin/busybox, otherwise it wouldn't be available during early boot as you correctly noted (and thus break quite a lot of use cases).

Last edited by iDont; 2013-03-21 at 21:48. Reason: formatting
 

The Following 7 Users Say Thank You to iDont For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#366
Originally Posted by iDont View Post
So at this moment, the situation wrt su and ping (bug #700) is not resolved. I'm willing to give the busybox split another shot if you like. I haven't actively pursuit this issue because, well, nobody brought it up again until you did (and it doesn't scratch my itch, to put it somewhat bluntly).

By the way, another option would be to compile su (~15KiB) and ping (~25KiB) as separate executables from BusyBox' source and include those in busybox-power's packaging. How do you feel about this option?
Perhaps the best would be to keep busybox as-is but, to avoid any confusion, without including *any* applets which require being setuid. Then the user will be free to install su and/or ping.

For ping we already have a package (ping and iputils-ping, I think) -- I just installed "ping" which installs /usr/bin/ping. Busybox's /bin/ping still there. Just need to chmod +s and it works fine).

For su we are missing a package (or I can't find it). Since most people probably don't need su (I don't *need* it, I just *want* it I guess you don't have to include it in busybox-power. But it would be nice if you could compile and package it and put it in extras-devel (otherwise I'll add it to my to-do list so that when I retire in about 30 years I will do it myself .

Let me know what you think. And thanks a lot for your support!
 

The Following 4 Users Say Thank You to reinob For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#367
Well, does it hurt to have ping and su the way it is not, used only from root privilleges?

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#368
Originally Posted by iDont View Post
What you need to do to get BusyBox' man working:
1) export MANPATH
2) install groff-base
3) copy your man pages to $MANPATH
4) export PAGER=less

You can put that in /etc/profile (or put a script on /etc/profile.d, etc.)
Otherwise man will use more. Basically man does:

zcat page.gz | gtbl | nroff -Tlatin1 -mandoc 2>&1 | $PAGER

where PAGER is "more" if undefined. However busybox's "more" behaves weird (or perhaps it's libvte's fault, I use the one from CSSU). less works much better, and is more comfortable to use.
 

The Following 5 Users Say Thank You to reinob For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#369
Originally Posted by Estel View Post
Well, does it hurt to have ping and su the way it is not, used only from root privilleges?

/Estel
Well, for ping I could accept having to be root. But the most common use of su is for *getting root*

Yeah, one could do alias su="sudo /bin/su", but it's not really the same. What if I have two users (e.g. "user" and "luser") and I want to switch from one to the other? su is just for that. sudo is only for getting root.
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#370
Originally Posted by reinob View Post
Well, for ping I could accept having to be root. But the most common use of su is for *getting root*

Yeah, one could do alias su="sudo /bin/su", but it's not really the same. What if I have two users (e.g. "user" and "luser") and I want to switch from one to the other? su is just for that. sudo is only for getting root.
While N900 is a strict single-user system (but who knows, maybe some use cases imply multi-user?), it may be not a problem... Still, maybe a compromise of keeping ping where it is, and su as additional package?

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 06:09.