Bug- pinstall.sh runs in frugal but not full install [Fixed]

Please post any bugs you have found
Message
Author
User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#31 Post by perdido »

MochiMoppel wrote:
perdido wrote:The discussion has been about why can't rockedge and I get our pinstall.sh to run in a fully installed puppy when it runs and works in a frugal installed puppy?
Mystifies me also. I don't run any of the distros you mentioned and my environment is different, so I have no way to see the effect. Obviously installpkg.sh runs fine as it extracted the file to / and there is little in the way that could prevent it from executing the script. A short test on my system with a simulated full install showed no problems. My pinstall.sh worked fine.

If you like you can send me a PM. I'll try to walk you through the debugging process.
Thanks MochiMoppel. :)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#32 Post by MochiMoppel »

I don't expect pinstall scripts to work in full installs of any recent puppy (e.g. Dpup Stretch or UPup Bionic Beaver), all puppies that use an updated version of installpkg.sh.

In line 156 it now reads

Code: Select all

DIRECTSAVEPATH="/tmp/petget/directsavepath"
which IMO is wrong. For PUPMODE 2 I would expect DIRECTSAVEPATH to be empty.

And then only 6 lines later a strange if command

Code: Select all

if [ "$DIRECTSAVEPATH" ];then
 rm -rf $DIRECTSAVEPATH
 mkdir -p $DIRECTSAVEPATH
fi
Absolutely no reason here to check if DIRECTSAVEPATH contains a value. A few lines earlier the author assigned a value. But no harm is done either.
If indeed this is a typo and the author meant

Code: Select all

[ -d "$DIRECTSAVEPATH" ]
to check for the existence of this directory, then also the rest of the code needs fixing.

The real problem with pinstall.sh scripts is that they are now expected in /tmp/petget/directsavepath/ while in fact they sit in / and wait for execution. For the same reason the stuff in / doesn't get deleted. Explains why it can be clicked on. And since the change was made only for PUPMODE 2 it explains why pinstall.sh in frugal installs still works.

Maybe this all makes sense and I'm simply too stupid to understand it ...

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#33 Post by rockedge »

MochiMoppel that is an interesting find. what you say makes sense...time to look at the code closer.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#34 Post by perdido »

MochiMoppel wrote:I don't expect pinstall scripts to work in full installs of any recent puppy (e.g. Dpup Stretch or UPup Bionic Beaver), all puppies that use an updated version of installpkg.sh.

In line 156 it now reads

Code: Select all

DIRECTSAVEPATH="/tmp/petget/directsavepath"
which IMO is wrong. For PUPMODE 2 I would expect DIRECTSAVEPATH to be empty.

And then only 6 lines later a strange if command

Code: Select all

if [ "$DIRECTSAVEPATH" ];then
 rm -rf $DIRECTSAVEPATH
 mkdir -p $DIRECTSAVEPATH
fi
Absolutely no reason here to check if DIRECTSAVEPATH contains a value. A few lines earlier the author assigned a value. But no harm is done either.
If indeed this is a typo and the author meant

Code: Select all

[ -d "$DIRECTSAVEPATH" ]
to check for the existence of this directory, then also the rest of the code needs fixing.

The real problem with pinstall.sh scripts is that they are now expected in /tmp/petget/directsavepath/ while in fact they sit in / and wait for execution. For the same reason the stuff in / doesn't get deleted. Explains why it can be clicked on. And since the change was made only for PUPMODE 2 it explains why pinstall.sh in frugal installs still works.

Maybe this all makes sense and I'm simply too stupid to understand it ...
This is both a relief and quite distressing that someone has modified the script and left no notes in it or even tested it for functionality after
modifying it :shock:

Much appreciated MM, and everyone else that contributed to this discussion - hopefully someday it will be fixed back to how it once worked.

.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#35 Post by MochiMoppel »

perdido wrote:This is both a relief and quite distressing that someone has modified the script and left no notes in it or even tested it for functionality after
modifying it :shock: .
Test for functionality? Don't expect too much. Your first point is more bothering. Who did this and why?

Now look at the bright side: It's a bug, but it's a good bug. Prevents the automatic execution of pinstall scripts which IMO pose an unnecessary security risk. Fortunately you now can inspect the script and decide if you want to execute it or not. Sure you have to clean up, but that's a small price to pay for more security. This bug should become standard for frugal install, seriously :lol:

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#36 Post by rcrsn51 »

MochiMoppel wrote:Now look at the bright side: It's a bug, but it's a good bug. Prevents the automatic execution of pinstall scripts which IMO pose an unnecessary security risk.
I don't understand that. If you are willing to trust the contents of the PET, why would you not also trust its pinstall script?

Supposedly, the PET builder added the script because it is required to make the install work correctly.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#37 Post by perdido »

This is an update to this problem - from woofce
https://github.com/puppylinux-woof-CE/w ... ts/testing

mavrothal is on the ball.

I'm going to try and download the updated installpkg.sh and see how it does.
Attachments
2018-09-15_193053.jpg
(12.01 KiB) Downloaded 381 times

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#38 Post by perdido »

I have downloaded and tried both versions of the proposed new version of installpkg.sh from mavrothal in a full install Upup Bionic 18.05

It ran the pinstall.sh and puninstall.sh and did not leave relics in /

The "simpler fix" was submitted last so it is the latest version.

.
Last edited by perdido on Thu 20 Sep 2018, 22:53, edited 2 times in total.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#39 Post by perdido »

These are the two versions of the updated installpgk.sh script available from woofce / commits / testing
for anybody else that is interested.

The script belongs in /usr/local/petget/

Rename to installpkg.sh and make executable.
Attachments
installpkg.sh.02-simpler-fix.gz
MD5 acd8b88ca2e6d69c8f1d8ff4f79c4563
(37.23 KiB) Downloaded 253 times
installpkg.sh.01.gz
MD5 e7a2ddae7f9faff1c62f9a507abbeac4
(37.29 KiB) Downloaded 233 times

Post Reply