SliTaz SliTaz Forum

You are not logged in.

#1 2012-12-19 11:12:27

tkoun
Member
Registered: 2012-12-04
Posts: 21

tazbox su problems

I had some problems with commands launched via tazbox su in Slitaz cooking.

I had to modify the tazbox script as follows

change this line

export SU_CMD="$2 $3 $4 $5"

into

export SU_CMD="${@:2}"

otherwise long commands i.e. with many options won't pass

regards

Offline

#2 2012-12-19 14:29:07

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: tazbox su problems

Pushed: http://hg.slitaz.org/slitaz-tools/rev/277277e6fb08

Thanks.

Offline

#3 2012-12-19 16:23:21

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: tazbox su problems

Why not just use $@ ?

Offline

#4 2012-12-19 16:34:15

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: tazbox su problems

${@:2} => $2 $3 ...

$@ => $1 $2 ...

Offline

#5 2012-12-19 16:37:15

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: tazbox su problems

Ah, so it starts the variable list one place later. Good trick to know.

Offline

#6 2012-12-25 21:10:31

tkoun
Member
Registered: 2012-12-04
Posts: 21

Re: tazbox su problems

Actually I think that the correction also needs to be also applied in line

test $(id -u) = 0 && exec $2 $3 $4 $5

which should become

test $(id -u) = 0 && exec ${@:2}

tkoun

ps: updating the comment just before would complete the correction.

Offline

#7 2013-01-02 19:55:19

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

i'm in rolling trying to install some spacefm plugins.

spacefm asks for a su frontend to complete the operation.

spacefm receipts has the configure otion [c]--with-preferable-sudo="/usr/bin/subox"[/c] but subox is not present anymore.

slitaz-tools-boxes installs a /usr/bin/gksu which is a broken link to /usr/bin/subox .

how do i resolve this trouble?

i tried to make /usr/bin/gksu a script to run [c]tazbox su[/c] but with no luck.

in the end i built ktsuss with this receipt

[c]# SliTaz package receipt.

PACKED_SIZE="36.0K"
UNPACKED_SIZE="68.0K"
PACKAGE="ktsuss"
VERSION="2"
CATEGORY="utilities"
SHORT_DESC="su graphical frontend"
MAINTAINER=""
WEB_SITE="http://code.google.com/p/ktsuss/"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="http://ktsuss.googlecode.com/files/$TARBALL"

DEPENDS=""
BUILD_DEPENDS="gtk+-dev"

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    ./configure --prefix=/usr \
        --sbindir=/usr/sbin \
        --sysconfdir=/etc \
        --mandir=/usr/share/man \
        --infodir=/usr/share/info \
        $CONFIGURE_ARGS &&
    make && make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    cp -a $install/* $fs
}[/c]
Is there any better solution?

thanks

Offline

#8 2013-01-03 04:03:21

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: tazbox su problems

subox exists only in stable, not cooking, check it

See the difference in GPartEd start (line with 'Exec=') both in stable and cooking:

Exec=subox gparted

Exec=tazbox su "gparted"

Offline

#9 2013-01-03 04:27:28

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: tazbox su problems

Actually, tazbox su is the proper way to do it - even in stable since subox loops back to it

Offline

#10 2013-01-03 05:34:28

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

the problem seems to be that spacefm has some predefined su frontend hardcoded from which you can select and it changes the command to send accordingly:

[c]sudo
-c /bin/sh /usr/bin/spacefm-auth root /tmp/spacefm.tmp/46bfeae8-tmp.sh 3d0319e8d63e1bbc8e754afc38361153165a8c640b80417f8cfaffbe0d3bc10c

gksu
-g -D SpaceFM Command /bin/sh /usr/bin/spacefm-auth root /tmp/spacefm.tmp/4c3548eb-tmp.sh dd1fcf473cad1aea09059a754d40e493ae88c07117f06d8eeca524d5b4c7c34b

ktsuss
/bin/sh /usr/bin/spacefm-auth root /tmp/spacefm.tmp/19fb2a4d-tmp.sh 4719becaadb5c0bd0684cd1704753e0292985450046846ad14f34a89b6de8903[/c]

Offline

#11 2013-01-03 05:42:53

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: tazbox su problems

Thanx for explaination.

Seems like we need to patch SpaceFM sources to work with 'tazbox su'. Here is native SliTaz box with icon designed specially for SliTaz.

Offline

#12 2013-01-03 05:50:15

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

i started to look at it, but real life calls me in the morning.

maybe it would be better use tazbox and give su argument in vfs-file-task.c ?

i will not mind if you do the job for me ;-)

Offline

#13 2013-01-03 06:51:25

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: tazbox su problems

Ernia, ok, if you think this job is your, I not touch it wink

By the way, am at work now, on short coffee break. Working till 15:30...

Offline

#14 2013-01-03 13:27:58

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

i'm on holiday, i just put the jackhammer down, so i got two hour of bonus, i'm afraid it's not enough, maybe two weeks would be enough :-)

Offline

#15 2013-01-03 15:04:11

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

I must go out so i have no time to work on patching Spacefm, if i ever would be able to do it.

would not it be simpler to build spacefm with [c]--with-preferable-sudo="/usr/bin/gksu"[/c] and make /usr/bin/gksu a wrapper for tazbox su?

this seems to work:

[c]#!/bin/sh
COMMAND="${@}";

#catch spacefm gksu call
if echo "$COMMAND" | grep spacefm-auth ; then
    SPACEFM_COMMAND="$(echo $COMMAND | sed 's/^.*\/usr\/bin\/spacefm-auth/\/usr\/bin\/spacefm-auth/')";
    exec /usr/bin/tazbox su "$SPACEFM_COMMAND";
else
#no catch
    exec /usr/bin/tazbox su "$COMMAND";
fi[/c]
and could be updated to fit other programs

Offline

#16 2013-01-04 21:29:45

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

i patched spacefm and changed receipt to make spacefm to use tazbox out of the box, i enclose file with receipt and stuff dir

Offline

#17 2013-01-04 21:33:02

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

http://www.filedropper.com/spacefmtazboxtar

as i'm here this is the tazpkg

http://www.filedropper.com/spacefm-084

Offline

#18 2013-01-18 09:52:05

tkoun
Member
Registered: 2012-12-04
Posts: 21

Re: tazbox su problems

I think that the choice of sed-ing out bash from spacefm before building the package has a disadvantage that needs to be considered.

A lot of spacefm plugins (eg. find plugin) need bash in order to properly run once installed (with sh they break).

So I advise against removing the bash dependency from spacefm unless unless this plugin issue is solved. A spacefm-plugin package where bash dependecies have been cleaned can be an alternative approach.

Offline

#19 2013-01-18 11:25:27

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: tazbox su problems

i agree

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 1.57 MiB (Peak: 1.77 MiB) ]