[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Porteus 5.0's USM replacement] getmod: A simple wrapper for slapt-get to build Porteus modules

Post#121 by Ed_P » 09 Oct 2022, 07:17

Rava wrote:
09 Oct 2022, 07:04
Fixed that for you.
No, I actually had only 2. The 3rd clever suggestion is from you. Unfortunately I'm not sure it works.

Code: Select all

guest@porteus:~$ /usr/sbin/getmod

   getmod [-c] [-u] [-d|-m|-n PACKAGE_NAME] [-s PATTERN]

Options:
  -c: Purge cached packages
  -d: Download only
  -m: Download and build module
  -n: Download and build module without dependencies
  -s: Search package
  -u: Update database
  -h: This usage

guest@porteus:~$ /usr/sbin/getmod -s solitaire
/usr/sbin/getmod: line 74: slapt-get: command not found
guest@porteus:~$ 
It seems slapt-get requires root mode also.

Added in 5 minutes 38 seconds:
Rava wrote:
09 Oct 2022, 07:04

Code: Select all

guest@porteus:~$ /usr/sbin/getmod 
bash: /usr/sbin/getmod: Permission denied
Unfortunately I'm not sure a new linux user would understand that it needs to be run as root.
Ed

User avatar
babam
Warlord
Warlord
Posts: 528
Joined: 16 Nov 2016, 10:30
Distribution: Porteus 5.0rc3 Xfce K6.1.1
Location: Rainy city

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#122 by babam » 09 Oct 2022, 08:41

Update 2022.10.09:
getmod ---> Improvements.

Download:
https://drive.google.com/uc?export=down ... 3Fre4lXFyK

MD5SUM:
125be332c762bfe584ed25d203df5d4d
Last edited by babam on 09 Oct 2022, 17:37, edited 1 time in total.
Sorry, my English is bad.

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#123 by francois » 09 Oct 2022, 13:31

Has anyone tried depmod with with all the additional mirrors to salix that came with USM:
alien, ponce, slackonly, slackware, slacky?
Prendre son temps, profiter de celui qui passe.

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#124 by Rava » 09 Oct 2022, 18:33

Ed_P wrote:
09 Oct 2022, 07:23
No, I actually had only 2. The 3rd clever suggestion is from you.
Seems you do not understand friendly banter and forum humor. Okay, I remember that from now on and think of you as a person who lacks any sense of humour.

Code: Select all

 Unfortunately I'm not sure it works. 
Yes, it does, but only when the correct access rights are applied to it, that can only be done as root.
Ed_P wrote:
09 Oct 2022, 07:23
It seems slapt-get requires root mode also.
And slapt-get is a binary, so your editing script tricks would not work on it:

Code: Select all

root@porteus:~# file /usr/sbin/slapt-get
/usr/sbin/slapt-get: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
It seemingly works as guest:

Code: Select all

guest@porteus:~$ /usr/sbin/slapt-get
slapt-get - Jason Woodward <woodwardj at jaos dot org>
An implementation of the Debian APT system to Slackware
Usage:
slapt-get [option(s)] [target]

Targets:
  -u, --update   retrieve pkg data from MIRROR
  --upgrade      upgrade installed pkgs
  --dist-upgrade upgrade to newer release
  -i, --install  [pkg name(s)] - install specified pkg(s)
  --install-set  [disk set(s)] - install specified disk set(s)
  --remove       [pkg name(s)] - remove specified pkg(s)
  --show         [pkg name(s)] - show pkg(s) description
  --filelist     [pkg name(s)] - show pkg(s) installed files
  --search       [expression] - search available pkgs
  --list         list pkgs
  --available    list available pkgs
  --installed    list installed pkgs
  --clean        purge cached pkgs
  --autoclean    only purge cache of older, unreacheable pkgs
  --add-keys     retrieve GPG keys for sources
  -h, --help     display this help and exit
  --version      print version and license info

Options:
  -d, --download-only     only download pkg on install/upgrade
  -s, --simulate          show pkgs to be installed/upgraded
  -y, --no-prompt         do not prompt during install/upgrade
  -p, --prompt            always prompt during install/upgrade
  --reinstall             reinstall the pkg
  --ignore-excludes       install/upgrade excludes
  --no-md5                do not perform md5 check sum
  --no-dep                skip dependency check
  --ignore-dep            ignore dependency failures
  --print-uris            print URIs only, do not download
  -S, --show-stats        show download statistics
  -c, --config []         specify alternate slapt-getrc location
  --remove-obsolete       remove obsolete packages
  --retry []              specify number of download retry attempts
  --no-upgrade            install package, do not attempt to upgrade
  --allow-unauthenticated allow unauthenticated packages
but is unable to do anything of value:

Code: Select all

guest@porteus:~$ /usr/sbin/slapt-get -u
Failed to mkdir /var/slapt-get: Permission denied
So, in my book /usr/sbin/slapt-get should also have its access rights changed to only be executable as root.

Unless… you learned C / C++ overnight and are able to hack the Code of slapt-get so that Porteus gets its very own version of that binary?

What? No? You did not learn C / C++ overnight. What a bummer, seems my access rights restrictions is the only valid thing to to with the binary, then.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#125 by Ed_P » 09 Oct 2022, 20:46

Rava wrote:
09 Oct 2022, 18:33
Seems you do not understand friendly banter and forum humor. Okay, I remember that from now on
Make sure you take Prevagen to help you. ;)
Rava wrote:
09 Oct 2022, 18:33
And slapt-get is a binary, so your editing script tricks would not work on it
I agree. :happy62:
Rava wrote:
09 Oct 2022, 18:33
It seemingly works as guest:
Indeed it does. :o

Code: Select all

guest@porteus:~$ /usr/sbin/slapt-get
slapt-get - Jason Woodward <woodwardj at jaos dot org>
An implementation of the Debian APT system to Slackware
Usage:
slapt-get [option(s)] [target]
 :
 :
Rava wrote:
09 Oct 2022, 18:33
but is unable to do anything of value:
Well that explains the getmod error I got then. :)
Rava wrote:
09 Oct 2022, 18:33
So, in my book /usr/sbin/slapt-get should also has its access rights changed to only be executable as root.
An interesting option. :happy62:
Rava wrote:
09 Oct 2022, 18:33
seems my access rights restrictions is the only valid thing to to with the binary, then.
Would having the folder it's in only being accessible by root work also? A disadvantage to changing slapt-get would be upgrading it and having the person/people around to remember that change to apply it to the update. And as we've seen with USM, and Porteus, the people who create ideas don't always stay around to support them. :(
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#126 by Rava » 09 Oct 2022, 22:26

Ed_P wrote:
09 Oct 2022, 20:46
Would having the folder it's in only being accessible by root work also?
It sure would.

To be honest, I thought /sbin and /usr/sbin were meant to be only accessible for root.

001-core.xzm says otherwise:

Code: Select all

root@porteus:/mnt/live/memory/images/001-core.xzm# ls -od sbin/ usr/sbin/
drwxr-xr-x 2 root 4575 2022-07-23 11:21 sbin/
drwxr-xr-x 2 root 4773 2022-07-23 11:21 usr/sbin/
I think, when we want to change that, all modules would have to respect the different permissions. And since most packages would have /sbin or /usr/sbin with the same permissions as 001-core.xzm has, that approach would fail since the last activated module would overwrite the permissions of first activated modules…

But there would me not that much difference of a guest user in trying to run programs he should not run. Especially if he not knows of the reasons why.

Cave! I renamed my newest local 011-slapt-get modules to keep track of the version numbers.
What 011-slapt-get-0.11.6-x86_64-2gv_2020.10.07.xzm and 011-slapt-get-0.11.6-x86_64-2gv_2020.10.09.xzm are about should be obvious.

babam changed not only getmod itself but also its location:

Code: Select all

root@porteus:/Porteus_modules# lsxzm 011-slapt-get-0.11.6-x86_64-2gv_2020.10.07.xzm |grep getmod
/usr/sbin/getmod
root@porteus:/Porteus_modules# lsxzm 011-slapt-get-0.11.6-x86_64-2gv_2020.10.09.xzm |grep getmod
/usr/bin/getmod
from V2020.10.07 in /usr/sbin/getmod to /usr/bin/getmod in V2020.10.09

We know that slapt-get would not really work when executed by a non-root user. At the moment you could make yourself a module containing slapt-get - but me thinks most users would prefer downloading babam's 011-slapt-get-* module since getmod is a very good script wrapper, very useful for Porteus users.

babam changed getmod in asking for the root password when started by a non-root user since V2020.10.09 :

Code: Select all

# Switch to root:
  if [ `whoami` != "root" ]; then
     sudo -E -p "Enter root's password: " "$0" "$@"
     exit
  fi
So, we should think if what would be the best approach for now:
My humble suggestions:

keep getmod in /usr/sbin/ since it is a system related script. Keep it with the ability to ask for the root password when its not started as user root.
Change slapt-get's permission inside all upcoming 011-slapt-get-* modules prior the module creation like this
Let us presume the working directory that contains all files for the module creation is /tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10 when the current date is 2020.10.10 (YYYY.MM.DD):

Code: Select all

root@porteus:/Porteus_modules# mkdir /tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10
root@porteus:/Porteus_modules# xzm2dir 011-slapt-get-0.11.6-x86_64-2gv_2020.10.09.xzm /tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/
Parallel unsquashfs: Using 8 processors
13 inodes (14 blocks) to write

[=================================================================|] 14/14 100%

created 9 files
created 23 directories
created 4 symlinks
created 0 devices
created 0 fifos
created 0 sockets
root@porteus:/Porteus_modules# cd /tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/usr/sbin/
root@porteus:/tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/usr/sbin# chmod og-x slapt-get 
root@porteus:/tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/usr/sbin# ls -o slapt-get 
-rwxr--r-- 1 root 32760 2022-07-11 10:41 slapt-get
root@porteus:/tmp/011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/usr/sbin# cd /tmp/
root@porteus:/tmp# dir2xzm 011-slapt-get-0.11.6-x86_64-2gv_2020.10.10/ 011-slapt-get-0.11.6-x86_64-2gv_2020.10.10_rava.xzm
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on 011-slapt-get-0.11.6-x86_64-2gv_2020.10.10_rava.xzm, block size 262144.
[=================================================================-] 15/15 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	duplicates are removed
Filesystem size 633.09 Kbytes (0.62 Mbytes)
	33.18% of uncompressed filesystem size (1907.94 Kbytes)
Inode table size 494 bytes (0.48 Kbytes)
	39.97% of uncompressed inode table size (1236 bytes)
Directory table size 454 bytes (0.44 Kbytes)
	56.82% of uncompressed directory table size (799 bytes)
Number of duplicate files found 0
Number of inodes 36
Number of files 9
Number of fragments 1
Number of symbolic links 4
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 23
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)
Now test that module, shall we. My only changes from V2020.10.09 to my theoretical V2020.10.10 are the permissions of /usr/sbin/slapt-get into "root.root -rwxr--r--"

First deactivate your 011-slapt-get-* module if you have one activated in your system and activate the new test module. Recall that I renamed all newer versions according to their version.

Code: Select all

root@porteus:/tmp# deactivate 011-slapt-get-0.11.6-x86_64-2gv_2020.10.09.xzm
Updating shared library links:  /sbin/ldconfig
root@porteus:/tmp# slapt-get
-su: slapt-get: command not found
root@porteus:/tmp# activate 011-slapt-get-0.11.6-x86_64-2gv_2020.10.10_rava.xzm 
Updating shared library links:  /sbin/ldconfig
Now let's test it for user guest

Code: Select all

guest@porteus:~$ getmod

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Enter root's password: 
sudo: a password is required
I pressed Ctrl+C at the password prompt…

Now the test as guest for slapt-get:

Code: Select all

guest@porteus:~$ slapt-get
bash: slapt-get: command not found
guest@porteus:~$ /usr/sbin/slapt-get
bash: /usr/sbin/slapt-get: Permission denied
guest@porteus:~$ ls -o /usr/sbin/slapt-get
-rwxr--r-- 1 root 32760 2022-07-11 10:41 /usr/sbin/slapt-get
In my book that's the best solution for now.

getmod itself asks for root password since babam coded it like this since V2010-10-09
slapt-get itself is no longer executable for non-root users when changes applied as shown above.

Of course slapt-get still works for root, or for getmod, since now getmod runs under user root or not at all since V2010-10-09

Examples:

slapt-get as root

Code: Select all

root@porteus:~# file /usr/sbin/slapt-get 
/usr/sbin/slapt-get: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
root@porteus:~# ls -o /usr/sbin/slapt-get 
-rwxr--r-- 1 root 32760 2022-07-11 10:41 /usr/sbin/slapt-get
root@porteus:~# slapt-get -u
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/]...  0Done
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/]...  Done
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...Done
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/]...  Done
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/15.0/]...Done
Retrieving patch list [http://slackware.uk/salix/x86_64/15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/15.0/]...Done
Retrieving checksum signature [http://slackware.uk/salix/x86_64/15.0/]...Done
Verifying checksum signature [http://slackware.uk/salix/x86_64/15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/15.0/]...Done
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Retrieving patch list [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Retrieving checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]... Done
Verifying checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Reading Package Lists...Done
root@porteus:~# 
getmod as root

Code: Select all

root@porteus:~# getmod 

   getmod: A simple wrapper for slapt-get to build Porteus module.

   getmod [-c] [-u] [-d|-m|-n PACKAGE_NAME] [-s PATTERN]

Options:
  -c: Purge cached packages
  -d: Download only
  -m: Download and build module
  -n: Download and build module without dependencies
  -s: Search package
  -u: Update database
  -h: This usage

   To change the temporary directory (default is /tmp), pass the TMP variable.
   # TMP=/path/to/directory getmod -m packagename

   Temporary directory is for storing downloaded packages, installing and converting to modules.

root@porteus:~# getmod -u
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/15.0/]...Cached
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Reading Package Lists...Done
getmod as guest:

Code: Select all

guest@porteus:~$ getmod -u

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Enter root's password: 
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/]...Cached
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/slackware-15.0/extra/]...Done
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/15.0/]...Cached
Reading Package Lists...Done
Retrieving package data [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Retrieving patch list [http://slackware.uk/salix/x86_64/extra-15.0/]...Done
Retrieving checksum list [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Retrieving checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Verifying checksum signature [http://slackware.uk/salix/x86_64/extra-15.0/]...No key for verification
Retrieving ChangeLog.txt [http://slackware.uk/salix/x86_64/extra-15.0/]...Cached
Reading Package Lists...Done
Of course, since getmod would ask for the root password every time, it would make more sense to create a root terminal or a new tab in your terminal emulator and change that one tab into a root terminal by

Code: Select all

guest@porteus:~$ su -
Password: 
root@porteus:~# 
and then use that one terminal / that one root tab of your terminal emulator for all your getmod's needs… without needing the root password again, since you now have a permanent root terminal - until you choose to close it.
su - is the shorthand for su -l or su --login as you can see via su --help:

Code: Select all

guest@porteus:~$ su --help|grep "login shell"
  -, -l, --login                make the shell a login shell
guest@porteus:~$ 
All the above are my ideas and suggestions. Feel free to disagree, or to agree on them.
Last edited by Rava on 09 Oct 2022, 22:37, edited 1 time in total.
Reason: added su --help|grep "login shell"
Cheers!
Yours Rava

User avatar
babam
Warlord
Warlord
Posts: 528
Joined: 16 Nov 2016, 10:30
Distribution: Porteus 5.0rc3 Xfce K6.1.1
Location: Rainy city

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#127 by babam » 09 Oct 2022, 23:21

Rava wrote:
09 Oct 2022, 22:26
Of course, since getmod would ask for the root password every time, it would make more sense to create a root terminal or a new tab in your terminal emulator and change that one tab into a root terminal by
Try doing this:

Code: Select all

$ getmod ; getmod ; getmod
3 times asking for a password?
Sorry, my English is bad.

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#128 by Ed_P » 10 Oct 2022, 03:52

Rava wrote:
09 Oct 2022, 22:26
Feel free to disagree, or to agree on them.
I disagree. What babam has done is fine (even without a title on the getmod terminal window).
babam wrote:
09 Oct 2022, 23:21
Try doing this:

Code: Select all

$ getmod ; getmod ; getmod
3 times asking for a password?
:buhehe: :lol:
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#129 by Rava » 10 Oct 2022, 05:59

babam wrote:
09 Oct 2022, 23:21
Try doing this:

Code: Select all

$ getmod ; getmod ; getmod
3 times asking for a password?
No, in this case it would not.

But please try this:

Code: Select all

$ # open a new guest tab in your terminal emulator
$ getmod ; getmod ; getmod
You get 3 times getmod with only once being asked for the password.
Close the tab, open a new guest one to simulate time passing, user moving on with other tasks and then wanting getmod again. Now we get this:

Code: Select all

guest@porteus:~$ getmod 
Enter root's password: 
So yes, the user will be asked repeatedly about the root password as I just showed you.

Added in 56 seconds:
@Ed_P
Please also try the above to see who is the one :buhehe: now.
Cheers!
Yours Rava

rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#130 by rych » 10 Oct 2022, 08:40

babam wrote:
09 Oct 2022, 08:41
Update 2022.10.09:
getmod ---> Improvements.
still works, thank you

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#131 by Ed_P » 10 Oct 2022, 13:54

Rava wrote:
10 Oct 2022, 06:00
So yes, the user will be asked repeatedly about the root password as I just showed you.
No, the user will only be asked if she exits root mode and returns which is exactly how the system is designed to work. Think of it like refilling your coffee cup each time it's empty. :happy62:
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#132 by Rava » 10 Oct 2022, 14:50

Ed_P wrote:
10 Oct 2022, 13:54
the user will only be asked if she exits root mode and returns which is exactly how the system is designed to work.
Sure the system is designed to work that way.

Therefore I suggested to open a root terminal and keep it open for system maintenance tasks. You only need to give the root password once.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#133 by Ed_P » 10 Oct 2022, 19:30

Rava wrote:
10 Oct 2022, 14:50
I suggested to open a root terminal and keep it open for system maintenance tasks. You only need to give the root password once.
Yes but when I am done with the task/tasks I planned on doing I close the root terminal. And later, unexpectedly, I will encounter something that needs to be tweaked or added to support something new and reopen the root terminal window. I think most users do that. :happy62:

Another option is to boot Porteus as root, which I think is what you do. :punk:
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#134 by Rava » 10 Oct 2022, 19:38

I keep a root terminal open all the time, and I am fine with not being "most users"

On the other hand, I use a script that alters my root password into a quite strong password, and one script that resets it to "toor". Both can only accessed as user root.

Code: Select all

guest@porteus:/usr/local/bin$ ls -o mypasswd*
-rwx------ 1 root 2226 2008-01-06 13:13 mypasswd
-rwx------ 1 root 2233 2008-12-05 14:46 mypasswd-reset
guest@porteus:/usr/local/bin$ file mypasswd
mypasswd: regular file, no read permission
guest@porteus:/usr/local/bin$ ./mypasswd
bash: ./mypasswd: Permission denied
guest@porteus:/usr/local/bin$ cat mypasswd
cat: mypasswd: Permission denied
Both use echo '****' | chpasswd -e hack.
The reset the root password back to "toor" is simply this:

Code: Select all

echo 'root:$1$.IT1qTLM$JDoCmG38TZEQcR3Ds8zAJ0' | chpasswd -e 
I set the permissions so that only root can execute or read the files, even when none of the passwords are cleartext.
I consider both mypasswd* scripts relevant to system security, therefore they are treated a bit special.
Cheers!
Yours Rava

rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

Post#135 by rych » 11 Oct 2022, 08:01

rych wrote:
10 Oct 2022, 08:40
babam wrote: ↑
09 Oct 2022, 09:41
Update 2022.10.09:
getmod ---> Improvements.

still works, thank you
babam, Actually, it doesn't:

Code: Select all

root@porteus:~# getmod -s nemo
mnemonic-0.15-x86_64-1salix15.0  (reference implementation of BIP-0039)
nemo-5.2.3-x86_64-1_csb  (File Manager)
root@porteus:~# getmod -m nemo
sudo: unknown user mkdir
sudo: error initializing audit plugin sudoers_audit
/usr/bin/getmod: line 139: /tmp/GETMOD/nemo/slapt-getrc: No such file or directory
Failed to open /tmp/GETMOD/nemo/slapt-getrc
/tmp/GETMOD/nemo/slapt-getrc: No such file or directory
-- rolled back to the old getmod which worked

Post Reply