LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-21-2024, 12:23 AM   #16
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492

Quote:
Originally Posted by Petri Kaukasoina View Post
No, it's not a bug but a feature. Try to execute command 'login' as root from a terminal window.

Code:
$ su -     
Password: 
# login
<bash gets killed>
I just tried it from a root XTerm opened with su, which is my usual way of getting to root.
Code:
 
# login
bigboy login: hazel
Password: 
Linux 5.15.145.
hazel@bigboy.localdomain:~
Seems to work. Slackware-15, util-linux-2.37.4, bash 5.1.4.
 
Old 05-21-2024, 12:37 AM   #17
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,012

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Quote:
Originally Posted by backtrack5R1 View Post
The need to create the .asc files of the packages is to customize the distro, each package would have its signature and later an iso image would be created with all the packages.
It is fully possible to add custom packages to a customized .iso without any corresponding .asc files. The installation scripts calls installpkg in the initrd of the .iso and installpkg does not verify packages from any .asc files.

However, if your intention is to clone your own distro starting off with Slackware and share that distro with others it might be a good idea to have .asc files for every shipped package and to share your own public gpg key.

regards Henrik

Last edited by henca; 05-21-2024 at 12:40 AM.
 
Old 05-21-2024, 01:35 AM   #18
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,930

Rep: Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565
Quote:
Originally Posted by hazel View Post
I just tried it from a root XTerm opened with su, which is my usual way of getting to root.
Code:
 
# login
bigboy login: hazel
Password: 
Linux 5.15.145.
hazel@bigboy.localdomain:~
Seems to work. Slackware-15, util-linux-2.37.4, bash 5.1.4.
You bash is little older than Slackware-15. Current-before-15.0 upgraded to bash-5.1.008 May 5 2021 and the 15.0 was released Feb 2 2022 with bash-5.1.016. It shouldn't matter, but you may have other older packages.

I wonder if your /bin/login is really from util-linux and not from shadow.

This is in 15.0:
Code:
$ grep bin/login$ /var/adm/packages/*
/var/adm/packages/util-linux-2.37.4-x86_64-3_slack15.0:bin/login
$ ls -l /bin/login
-rwxr-xr-x 1 root root 44144 2024-03-28 21:01 /bin/login
Current:
Code:
$ grep bin/login$ /var/adm/packages/*
/var/adm/packages/util-linux-2.40.1-x86_64-1:bin/login
$ ls -l /bin/login
-rwxr-xr-x 1 root root 77136 2024-05-06 20:26 /bin/login
14.2:
Code:
$ grep bin/login$ /var/adm/packages/*                         
/var/adm/packages/shadow-4.2.1-x86_64-1:bin/login
$ ls -l /bin/login                                            
-rwxr-xr-x 1 root root 83613 2014-07-02 03:21 /bin/login
I guess you have not set up any signal handlers in your bash config files. Like this:
Code:
kaukasoi@acer:~ $ trap "" SIGHUP 
kaukasoi@acer:~ $ su -
Password: 
root@acer:~# login
acer login: kaukasoi
Password: 
Last login: Tue May 21 09:06:02 on pts/4
Slackware 15.0 / Linux 6.9.1
kaukasoi@acer:~ $
The move of /bin/login from shadow to util-linux happened here:
Code:
Mon May 18 19:17:21 UTC 2020
Greetings! After three months in /testing, the PAM merge into the main tree
is now complete...
...
a/shadow-4.8.1-x86_64-7.txz:  Rebuilt.
  Rebuilt to add PAM support.
a/util-linux-2.35.1-x86_64-6.txz:  Rebuilt.
  Rebuilt to add PAM support.

Last edited by Petri Kaukasoina; 05-21-2024 at 01:37 AM.
 
Old 05-21-2024, 01:57 AM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Code:
hazel@bigboy.localdomain:~
$  grep bin/login$ /var/adm/packages/*
/var/adm/packages/util-linux-2.37.4-x86_64-3_slack15.0:bin/login
hazel@bigboy.localdomain:~
$ ls -l /bin/login
-rwxr-xr-x 1 root root 44144 Mar 28 19:01 /bin/login
hazel@bigboy.localdomain:~
$
Last monthly update 19th May.

Last edited by hazel; 05-21-2024 at 01:58 AM.
 
Old 05-21-2024, 02:08 AM   #20
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
Quote:
Originally Posted by Petri Kaukasoina View Post
No, it's not a bug but a feature. Try to execute command 'login' as root from a terminal window.

Code:
$ su -     
Password: 
# login
<bash gets killed>
/bin/login (of util-linux) uses system call vhangup() to kill all other processes on the current tty, so the shell gets killed. Any version of any shell.

In slackware-14.2 there was the old /bin/login from shadow. It didn't kill anything, so the previous user of the tty could run a process reading everything, passwords included, of what the next user types. Or could write anything to the next user's screen.
In that case it does not depend on that script at all, irrelevant if only one or more users were created. And also the version of bash doesn't really matter.
 
Old 05-21-2024, 03:44 AM   #21
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,930

Rep: Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565
(removed)

Last edited by Petri Kaukasoina; 05-21-2024 at 04:15 AM.
 
Old 05-21-2024, 03:50 AM   #22
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,930

Rep: Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565
Quote:
Originally Posted by hazel View Post
I just tried it from a root XTerm opened with su, which is my usual way of getting to root.

Seems to work.
OK, I found it. If you start the root xterm like this:
Code:
xterm -e su -
Then /bin/login won't kill the window.

I am not sure why, but there is a difference: there is no bash process between xterm and su to be killed.

Another difference: 'ps as --signames' shows for the su command:
Code:
  UID   PID PENDING                     BLOCKED                     IGNORED                     CAUGHT                      STAT TTY        TIME COMMAND
    0  1479 -                           fffffffe7ffb9eff            BUS,KILL,SEGV,USR2,CHLD+    ABRT,FPE,KILL,USR1,SEGV+    Ss   pts/7      0:00 su -
But when there is a bash process between xterm and su:
Code:
  UID   PID PENDING                     BLOCKED                     IGNORED                     CAUGHT                      STAT TTY        TIME COMMAND
    0  1624 -                           fffffffe7ffb9eff            -                           ABRT,FPE,KILL,USR1,SEGV+    S    pts/6      0:00 su -
I would have thought that vhangup() would have killed the 'su -' process and the root shell which shows as '-su', because they were using the same tty. But it didn't. Only the bash shell between xterm and su was killed.

Last edited by Petri Kaukasoina; 05-21-2024 at 06:06 AM.
 
Old 05-21-2024, 04:35 AM   #23
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Code:
$ xterm -e su -

(2nd terminal opens)

Password: 
root@bigboy:~# login
bigboy login: hazel
Password: 
Linux 5.15.145.
hazel@bigboy.localdomain:~
$
Quote:
Originally Posted by Petri Kaukasoina View Post
OK, I found it. If you start the root xterm like this:
Code:
xterm -e su -
Then /bin/login won't kill the window.
But that's the point isn't it? It's supposed to kill the window (that's what the OP was complaining about) but on my machine it doesn't do that, neither with su or su -.

Last edited by hazel; 05-21-2024 at 04:39 AM.
 
Old 05-21-2024, 04:54 AM   #24
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,930

Rep: Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565
Code:
$ xterm

(2nd terminal opens)

$ su -
Password: 
# login

(xterm vanishes)
I edited my post #22 afterwards, added a possible explanation: there is a bash process to be killed between xterm and su on the same tty, while there is none when you do it your way.

Last edited by Petri Kaukasoina; 05-21-2024 at 06:02 AM.
 
Old 05-21-2024, 11:02 AM   #25
backtrack5R1
LQ Newbie
 
Registered: Jul 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Talking

Quote:
Originally Posted by Petri Kaukasoina View Post
No, it's not a bug but a feature. Try to execute command 'login' as root from a terminal window.

Code:
$ su -     
Password: 
# login
<bash gets killed>
/bin/login (of util-linux) uses system call vhangup() to kill all other processes on the current tty, so the shell gets killed. Any version of any shell.

In slackware-14.2 there was the old /bin/login from shadow. It didn't kill anything, so the previous user of the tty could run a process reading everything, passwords included, of what the next user types. Or could write anything to the next user's screen.

You said it's not a bug or feature, but when running this same mass user creation script on Debian and Linux Mint, even when logged in as root, I immediately execute:

Code:
# login usuario1
Password:
I can log in with the user normally without bash giving this crash because they are the same versions of bash which, if I'm not mistaken, is a child process of the real terminal
 
Old 05-21-2024, 11:39 AM   #26
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
Quote:
Originally Posted by Petri Kaukasoina View Post
OK, I found it. If you start the root xterm like this:
Code:
xterm -e su -
Then /bin/login won't kill the window.

I am not sure why, but there is a difference: there is no bash process between xterm and su to be killed.

Another difference: 'ps as --signames' shows for the su command:
Code:
  UID   PID PENDING                     BLOCKED                     IGNORED                     CAUGHT                      STAT TTY        TIME COMMAND
    0  1479 -                           fffffffe7ffb9eff            BUS,KILL,SEGV,USR2,CHLD+    ABRT,FPE,KILL,USR1,SEGV+    Ss   pts/7      0:00 su -
But when there is a bash process between xterm and su:
Code:
  UID   PID PENDING                     BLOCKED                     IGNORED                     CAUGHT                      STAT TTY        TIME COMMAND
    0  1624 -                           fffffffe7ffb9eff            -                           ABRT,FPE,KILL,USR1,SEGV+    S    pts/6      0:00 su -
I would have thought that vhangup() would have killed the 'su -' process and the root shell which shows as '-su', because they were using the same tty. But it didn't. Only the bash shell between xterm and su was killed.
probably process group related, login can (or will) only kill the process group. But need to check it.
 
Old 05-21-2024, 12:20 PM   #27
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,930

Rep: Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565Reputation: 1565
Quote:
Originally Posted by backtrack5R1 View Post
You said it's not a bug or feature, but when running this same mass user creation script on Debian and Linux Mint, even when logged in as root, I immediately execute:

Code:
# login usuario1
Password:
I can log in with the user normally without bash giving this crash because they are the same versions of bash which, if I'm not mistaken, is a child process of the real terminal
I am not familiar with Debian or Linux Mint. But this Debian man page for login(1) says 'shadow-utils 4.11.1', so I guess their login doesn't try to remove any possible password sniffing processes on the tty.
 
  


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
Bash "shellshock" CVE-2014-6271 CVE-2014-7169 - Bash Bug Fix enorbet Slackware 42 09-27-2014 12:44 AM
urgent urgent, need help please with bash script to pass exam... engrmilad Programming 32 11-23-2011 02:02 PM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM

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

All times are GMT -5. The time now is 04:05 AM.

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