LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-12-2023, 11:59 PM   #1
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
a revdep script for Slackware


hi,

I came across a script that finds missing *.so files, essentially working as revdep on source distros like CRUX and Gentoo:

https://gist.github.com/emmett1/eb71...d34ae59ba1fa57

Author is Emmett1, IIRC he used CRUX for a long time, then started Venom Linux.

For those running -current, that would be quite useful.

Last edited by solarfields; 11-13-2023 at 12:09 AM.
 
Old 11-13-2023, 12:53 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,179

Rep: Reputation: 236Reputation: 236Reputation: 236
My guess is that many of us have invented similar wheels for use in house. The reason that few of these was released might be
  1. There could be too many false positives and false negatives, e.g., when a program should be started by a script that modifies LD_LIBRARY_PATH, and, a program loads a library programmatically through dlopen(3), or simply depends on another program's output data, e.g., tar will not be able to expand a compressed archive without appropriate decompression program installed.
  2. A package with broken dependency can still be useful, e.g., tar without lzip installed and KDE without NetworkManager (libnm.so).
 
Old 11-13-2023, 01:01 AM   #3
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Original Poster
Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Quote:
Originally Posted by guanx View Post
My guess is that many of us have invented similar wheels for use in house.
well, I did not invent one, and such a tool was something I really miss on Slackware
 
Old 11-13-2023, 01:06 AM   #4
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
The script writes to /tmp/list. Not a good idea if there are other users who can make a symbolic link /tmp/list.
 
Old 11-13-2023, 01:15 AM   #5
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Original Poster
Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Quote:
Originally Posted by Petri Kaukasoina View Post
The script writes to /tmp/list. Not a good idea if there are other users who can make a symbolic link /tmp/list.
should it have a more unique name?
 
Old 11-13-2023, 01:16 AM   #6
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
Another one: https://www.linuxquestions.org/quest...ml#post6403575
And still another: https://www.linuxquestions.org/quest...ml#post6446468
 
1 members found this post helpful.
Old 11-13-2023, 01:20 AM   #7
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
Quote:
Originally Posted by solarfields View Post
should it have a more unique name?
Yes. If another user makes a link

/tmp/list -> /var/spool/mail/victim

then the victim will lose their mail. Or, if the victim runs the script as root, nobody can log in after shadow has been written over:

/tmp/list -> /etc/shadow
 
1 members found this post helpful.
Old 11-13-2023, 02:34 AM   #8
jloco
Member
 
Registered: Apr 2016
Location: Detroit, MI
Distribution: Slackware
Posts: 180

Rep: Reputation: 148Reputation: 148
As I commented on Emmitt’s Reddit post, I rather like this script. Sure there’s many like it and some offer differing results, as with all of them, it’s up to the user to parse that info and find the data they need. As with all others, false-positives exist if you don’t have all the distro installed, or with things like Firefox, speech-dispatcher, etc.

As with any script though, you are free to change what it writes to suit your needs, I find it a odd complaint about what it writes… change it for you or use another option. Many exist.
 
3 members found this post helpful.
Old 11-13-2023, 03:41 AM   #9
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
Quote:
Originally Posted by jloco View Post
I find it a odd complaint about what it writes… change it for you or use another option.
I am sorry if my comment offended you. I did not try to run the script, and I don't know what it outputs. I just pointed out a security vulnerability in its usage of a temporary file.
 
1 members found this post helpful.
Old 11-13-2023, 06:07 AM   #10
emmett1
Member
 
Registered: Nov 2017
Location: Malaysia
Distribution: Venom Linux, LFS
Posts: 49

Rep: Reputation: Disabled
Hey yeah i saw that using '/tmp/<file>' become big issue. I'm aware of that, it just that file is used randomly when i'm writing that script. I see no problem because that script is for my own use, until yesterday i decide to share it for other users in case that script can be a good use. But i forgot to fix and polish before share it.

I hope if there is more issue, someone could point me so i can fix it and the script can be a good use to other users who wanna use it.

The script is fixed, replaced '/tmp/list' to '$(mktemp)'. I also added 'trap' to remove that temporary file if 'Ctrl + C' is invoked.

https://gist.github.com/emmett1/eb71...fa57/revisions
 
3 members found this post helpful.
Old 11-13-2023, 06:09 AM   #11
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Quote:
Originally Posted by Petri Kaukasoina View Post
The script writes to /tmp/list. Not a good idea if there are other users who can make a symbolic link /tmp/list.
Hmm - That concern has been addressed in a recent revision.

Edit - Apologies to all. emmett1 was quicker.

Last edited by allend; 11-13-2023 at 06:11 AM.
 
2 members found this post helpful.
Old 11-13-2023, 07:10 AM   #12
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Original Poster
Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Quote:
Originally Posted by emmett1 View Post
Hey yeah i saw that using '/tmp/<file>' become big issue. I'm aware of that, it just that file is used randomly when i'm writing that script. I see no problem because that script is for my own use, until yesterday i decide to share it for other users in case that script can be a good use. But i forgot to fix and polish before share it.

I hope if there is more issue, someone could point me so i can fix it and the script can be a good use to other users who wanna use it.

The script is fixed, replaced '/tmp/list' to '$(mktemp)'. I also added 'trap' to remove that temporary file if 'Ctrl + C' is invoked.

https://gist.github.com/emmett1/eb71...fa57/revisions
I really like your tool.

Any chance of making revdep also accept a single package as an input? So that it can also check only this one package, without going through all? Kinda like it works on CRUX.

How about packages installed in non-standard locations, e.g. /opt? Sure, on Slackware we do not have /etc/revdep.d/, but still...
 
Old 11-13-2023, 07:21 AM   #13
jloco
Member
 
Registered: Apr 2016
Location: Detroit, MI
Distribution: Slackware
Posts: 180

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by solarfields View Post
I really like your tool.
How about packages installed in non-standard locations, e.g. /opt? Sure, on Slackware we do not have /etc/revdep.d/, but still...
Just add your extra desired dirs in the "SEARCH_DIRS" array, could make it as recursive as you'd like (likely at the expense of time) to add many other one-off directories to search.
 
1 members found this post helpful.
Old 11-13-2023, 07:30 AM   #14
jloco
Member
 
Registered: Apr 2016
Location: Detroit, MI
Distribution: Slackware
Posts: 180

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by Petri Kaukasoina View Post
I am sorry if my comment offended you.
No offense taken, it just seemed trivial to change, and all the existing scripts that you linked write a file to /tmp as well, so it is a valid point. I always make sure the output of the others ends up in /root, as my /tmp is wiped on poweroff, but I'm sure that may be as unsafe a practice as well!
 
1 members found this post helpful.
Old 11-13-2023, 07:33 AM   #15
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
Quote:
Originally Posted by jloco View Post
all the existing scripts that you linked write a file to /tmp as well
They used mktemp.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script to trigger second script--second script gets arguments of first script keif Linux - General 10 08-12-2021 01:25 AM
Slackware Configuration Script - my first script moisespedro Slackware 14 01-27-2014 11:46 AM
revdep-rebuild always recompiles evolution-data-server crosstalk Gentoo 3 05-20-2011 07:52 AM
[SOLVED] Script to build always a current ISO image of Slackware (slackware-current) robertjinx Slackware 2 12-09-2010 02:00 AM
revdep-rebuild error in Gentoo vharishankar Linux - Distributions 2 06-10-2005 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration