Tiny Core Base > TCB Bugs

tce.install, tce-load, submitqc ...

(1/2) > >>

polikuo:
Yes, I'm bringing this topic up again.
I just go over the Core-scripts, grepping through all the files.
It turns out, the only script that would ever care about the permission of that directory, is you guess it tce-load.  :P
The directory is setup by /etc/init.d/tc-config

--- Code: ---chgrp staff "$TCEDIR" "$TCEOPT" "$TCEINSTALLED" "$TCLOOP"
chmod g+w "$TCEDIR" "$TCEOPT" "$TCEINSTALLED" "$TCLOOP"

--- End code ---

After that, nobody cares.
Every scripts which has that infamous directory in it only checks if a certain app has been loaded.
As for the only script who cares, tce-load can be easily patched by adding a simple "sudo".
Or if you really like the way it is, just add a few lines in tce-load to reset the "right permission".

--- Code: --- if [ -x "$TCEINSTALLED"/$2 ]; then
if [ "$BOOTING" ] ; then
echo "$TCEINSTALLED"/$2 >> /tmp/setup.lst
else
sudo "$TCEINSTALLED"/$2
fi
else
- touch "$TCEINSTALLED"/$2
+ sudo touch "$TCEINSTALLED"/$2
fi

--- End code ---
I'm not quite sure if everyone is OK with that, since old habit die hard.
What I'm suggesting, is to patch tce-load, then everybody can be happy.
A root:root tce.installed would be just fine, the startup scripts are run by super user anyway.
Maybe not now, but future release like TC14.1 or TC15.

I'm bringing all this up because I found a bug in submitqc.
It change the permission back and forth if run multiple times.
Spent a few minutes, found the cause, just legacy code that got left behind over the years.
I can patch it, of course, but I wanna have a definite final conclusion before I do the patching.

Do we keep this old habit for no apparent benefit ?
Or I should just fix the bug in submitqc instead of a one-liner hack to tce-load ?  :P

curaga:
I'm not sure I understand, what is the issue?

polikuo:
Simply put.

I'm packing extensions.

Got annoyed that submitqc kept reporting wrong permission with the startup script (tce.installed)

Check submitqc and found bugs, need careful examination.

Check Core-scripts and found the only script that cares is tce-load.

An easy fix to tce-load can be done without causing any trouble.

Propose to hack tce-load so we don't have to care about tce.installed permission anymore.

Not necessarily right now, perhaps for a future release.

Rich:
Hi polikuo

--- Quote from: polikuo on August 28, 2023, 11:29:40 AM --- ... The directory is setup by /etc/init.d/tc-config

--- Code: ---chgrp staff "$TCEDIR" "$TCEOPT" "$TCEINSTALLED" "$TCLOOP"
chmod g+w "$TCEDIR" "$TCEOPT" "$TCEINSTALLED" "$TCLOOP"
--- End code ---
...
--- End quote ---
I believe the reason for setting  group  to  staff  is because  user  can vary
from install to install based on preference, but all users should belong to
the  staff  group. Personally, I don't feel a user should need to invoke root
privileges if they wish to manually make changes to  $TCEDIR  for example.


--- Quote --- ... I'm bringing all this up because I found a bug in submitqc.
It change the permission back and forth if run multiple times. ...
--- End quote ---
That's not good.


--- Quote --- ... Spent a few minutes, found the cause, just legacy code that got left behind over the years. ...
--- End quote ---
Maybe post the offending section of code to get a few more eyes on it. If it
doesn't belong, then it can be removed.


--- Quote --- ... I can patch it, of course, but I wanna have a definite final conclusion before I do the patching. ...
--- End quote ---
If it's a bug in submitqc, then that's where it should probably be fixed.

patrikg:
Why setting up the rights after untar ??
Or do tar have some options to always extract the files with very specific rights.
That can overload the archive one.
What i can see, in gnu tar you can do something like this. But this is for making the tar.

--- Code: (bash) ---tar -c -f archive.tar --owner=0 --group=0 --no-same-owner --no-same-permissions .
--- End code ---
But i donĀ“t know if busybox tar support that.

Why not setting the correct rights in the tar archive.

And checking the correct rights in submitqc script.
Before you can submit the extension.

Navigation

[0] Message Index

[#] Next page

Go to full version