LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-14-2018, 03:01 PM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
what is a quick way to get all of files needed for adduser to put it on void linux?


I found this
https://github.com/shadow-maint/shad.../src/useradd.c
but I need the (personal) "headers" and o so I can compile it. maybe mod it a little first even. before installing it onto VOID Linux.

I know Slack got this and maybe it was Slack that came up with adduser over useradd. Anyways... anyone knows what address I got a pull from, or wget it?

I do not think that is even the right one now that I look at it. always getting the two confused. the short order form one.

Last edited by BW-userx; 12-14-2018 at 03:04 PM.
 
Old 12-14-2018, 03:15 PM   #2
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,025

Rep: Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214Reputation: 1214
The VOID Linux is not a Slackware derivative, so far I know. It was written from scratch, so what's the connection with Slackware?
 
1 members found this post helpful.
Old 12-14-2018, 03:21 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Don't you know that this file belongs to the shadow software shipped in Slackware?
Have a look here:
http://slackware.uk/slackware/slackw...urce/a/shadow/
the url is indicated to get the whole archive: http://pkg-shadow.alioth.debian.org/releases/
Alternatively just clone the git repo:
git clone https://github.com/shadow-maint/shadow.git

But, why reinvent the wheel? All is there to package shadow for Void:
https://github.com/void-linux/void-p...hadow/template

PS: generally, if you look at a C program inside a software tree, chances are that the "personal" headers (those not listed between < >) are elsewhere in the same tree

So just download the whole tree and at its root type:
find -name <header name>.

But that's assuming that for some reason you want to cherry pick a program to build just that, instead of building the whole software.

Last edited by Didier Spaier; 12-14-2018 at 03:34 PM. Reason: PS added.
 
1 members found this post helpful.
Old 12-14-2018, 03:35 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ZhaoLin1457 View Post
The VOID Linux is not a Slackware derivative, so far I know. It was written from scratch, so what's the connection with Slackware?
debian has a version but there do not have what I'd call source code, it is gibberish to me what they have. and I think I got a copy of it on manjaro now that I think about it, and it was taken from slackware, I think it even mentions it, and when I used it, it is exacly like slackwares, because they did not even mod it to match there system. maybe I should go see if I can find what or where they down load it from.

I got 4 distros install so I jump around a lot and its hard to remember what I got where some times, for some things.
 
Old 12-14-2018, 03:38 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
Don't you know that this file belongs to the shadow software shipped in Slackware?
Have a look here:
http://slackware.uk/slackware/slackw...urce/a/shadow/
the url is indicated to get the whole archive: http://pkg-shadow.alioth.debian.org/releases/
Alternatively just clone the git repo:
git clone https://github.com/shadow-maint/shadow.git

But, why reinvent the wheel? All is there to package shadow for Void:
https://github.com/void-linux/void-p...hadow/template

PS: generally, if you look at a C program inside a software tree, chances are that the "personal" headers (those not listed between < >) are elsewhere in the same tree

So just download the whole tree and at its root type:
find -name <header name>.

But that's assuming that for some reason you want to cherry pick a program to build just that, instead of building the whole software.
I was query'ing for adduser let me check shadow ...

Code:
userx@voided.org:~
$ sudo xbps-query -Rs shadow
[ * ] shadow-4.6_1                    Shadow password file utilities
[-] shadowsocks-libev-3.2.3_1       Lightweight secured socks5 proxy for emb...
[-] shadowsocks-libev-devel-3.2.3_1 Lightweight secured socks5 proxy for emb...
userx@voided.org:~
$ vup shadow[*] Updating `https://alpha.de.repo.voidlinux.org/...86_64-repodata' ...
x86_64-repodata: 1696KB [avg rate: 2676KB/s][*] Updating `https://alpha.de.repo.voidlinux.org/...86_64-repodata' ...
Package 'shadow' is up to date.
userx@voided.org:~
$ sudo adduser
sudo: adduser: command not found
nope


-----------
Arch Linux swiped a copy from slackware
Quote:
Git Clone URL: https://aur.archlinux.org/adduser.git (read-only)
Package Base: adduser
Description: Interactive front end to /usr/bin/useradd from Slackware Linux
let me git clone that and try to get it to work.
it is just a build package script, time to play.

https://dfw.mirror.rackspace.com/sla...shadow/adduser

Last edited by BW-userx; 12-14-2018 at 03:48 PM.
 
Old 12-14-2018, 03:53 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
I don't know how Void packaging works, but for sure the build script I linked to installs useradd as I see in the postinstall() function:
Code:
    # Install our pam files not the ones supplied with shadow.
    rm -f ${DESTDIR}/etc/pam.d/*
    for f in chage passwd; do
        install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f}
    done
    for f in chpasswd chgpasswd groupadd groupdel groupmems \
         groupmod newusers useradd userdel usermod; do
        install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f}
    done
    install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc
So, just run this script to build a package and be happy.

I attach it to this post for your convenience.

Sorry I can't help you more.

Cheers,
Attached Files
File Type: txt build_shadow.txt (2.5 KB, 10 views)
 
1 members found this post helpful.
Old 12-14-2018, 03:54 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
adduser is just a script. It is available in the source directory of shadow.

Looking at the top of the file, it was originally developed for Slackware by Hrvoje Dogan back in 1995. Then in 2002, Stuart Winter, aka drmozes, took that script as the inspiration for the modern adduser script and it has been tweaked from there by both Stuart and Pat over the years to what it is now (with a changelog documenting those tweaks at the top of the script).

The script will eventually run the useradd binary from shadow to generate the account on the system and assign it the various settings, including groups.
 
1 members found this post helpful.
Old 12-14-2018, 04:15 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by bassmadrigal View Post
adduser is just a script. It is available in the source directory of shadow.

Looking at the top of the file, it was originally developed for Slackware by Hrvoje Dogan back in 1995. Then in 2002, Stuart Winter, aka drmozes, took that script as the inspiration for the modern adduser script and it has been tweaked from there by both Stuart and Pat over the years to what it is now (with a changelog documenting those tweaks at the top of the script).

The script will eventually run the useradd binary from shadow to generate the account on the system and assign it the various settings, including groups.
yeah I see it is looks rather easy. I copied slackwares, and moded the defualt groups to add user to, and ran it not as root, in my home directory, of course it could not access
Code:
Creating new account...


Password: 
useradd: cannot open /etc/passwd
useradd: failed to unlock /etc/passwd
- Error running useradd command -- account not created!
(cmd: /usr/sbin/useradd -d /home/bob -m   -g users -G audio,cdrom,floppy,input,lp,scanner,video -s /bin/bash bob)
but for arch linux pgkbuild and in voids that is for useradd not adduser it references a
Code:
package() {
  install -D -m755 adduser "${pkgdir}/usr/bin/adduser"
  sed '/^###/q;1,2d;s/^# *//' adduser | head -n -2 > LICENSE
  install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
what is this LICENSE, and it has to be something to worry about getting right, and not just adding this script to sbin. yes?

Last edited by BW-userx; 12-14-2018 at 04:22 PM.
 
Old 12-14-2018, 04:21 PM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Void uses PAM, not Slackware. For this reason you need to make adjustments.
 
1 members found this post helpful.
Old 12-14-2018, 04:29 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
I don't know how Void packaging works, but for sure the build script I linked to installs useradd as I see in the postinstall() function:
Code:
    # Install our pam files not the ones supplied with shadow.
    rm -f ${DESTDIR}/etc/pam.d/*
    for f in chage passwd; do
        install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f}
    done
    for f in chpasswd chgpasswd groupadd groupdel groupmems \
         groupmod newusers useradd userdel usermod; do
        install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f}
    done
    install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc
So, just run this script to build a package and be happy.

I attach it to this post for your convenience.

Sorry I can't help you more.

Cheers,
thanks for all of the pointing out stuff BUT this is for useradd which is not adduser, adduser uses useradd after it grathers information, making it a bit better to use. though I do wonder if I got add it to pam like void's script kist change the names for the program it is processing. because there is two different ones.

Code:
Manpage for useradd says: useradd is a low level utility for adding users. On Debian, administrators should
usually use adduser(8) instead. adduser : add user with full profile and info (pass, quota, permission, etc.)
two different ones, one uses the other one. the one VOID has it the other one, the backend one.
 
Old 12-14-2018, 04:31 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
Void uses PAM, not Slackware. For this reason you need to make adjustments.
I am starting to figure that out. thanks! maybe hack VOID's build script for useradd. and use it for adduser.

what is worst case scenario if I screw this up?
 
Old 12-14-2018, 04:43 PM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
I am starting to figure that out. thanks! maybe hack VOID's build script for useradd. and use it for adduser.

what is worst case scenario if I screw this up?
I really don't know. But (not requested advice, I know): considering that basically adduser is mostly a front-end for useradd, maybe your time would be better invested just getting acquainted with useradd and friends like usemod? It has a good man pages, with links to other utilities at the bottom.
 
1 members found this post helpful.
Old 12-14-2018, 04:43 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by BW-userx View Post
but for arch linux pgkbuild and in voids that is for useradd not adduser it references a
Code:
package() {
  install -D -m755 adduser "${pkgdir}/usr/bin/adduser"
  sed '/^###/q;1,2d;s/^# *//' adduser | head -n -2 > LICENSE
  install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
what is this LICENSE, and it has to be something to worry about getting right, and not just adding this script to sbin. yes?
The LICENSE file is created by the sed command above it, basically grabbing the top portion of the script and saving it as a license file.
 
1 members found this post helpful.
Old 12-14-2018, 04:51 PM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
I really don't know. But (not requested advice, I know): considering that basically adduser is mostly a front-end for useradd, maybe your time would be better invested just getting acquainted with useradd and friends like usemod? It has a good man pages, with links to other utilities at the bottom.
yeaaaahhhhh but I am sooo comfortable with slackware adduser. then having to remember useradd -g -m ... as adding users is not a daily task other then me when I am adding a user to mess around to try things out from time to time then delete same said user.
all of the other ones I do not have much issues with . moduser or is it usermod, and chown etc..

Last edited by BW-userx; 12-14-2018 at 04:52 PM.
 
Old 12-14-2018, 05:00 PM   #15
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
all this script does it gather information then calls useradd and hands it over to it.

Code:
# Add the account to the system
CMD="$useradd "$HME" -m "$EXP" "$U_ID" "$GID" "$AGID" "$SHL" "$LOGIN""
$CMD
I do think all I'd really have to do is add that script to sbin and volia done. maybe do that LICENSE thing, but the pam is already set up for useradd so that is taken care of.

Code:
userx@voided.org:~/Documents
$ sudo ./adduser

Login name for new user []: bob

User ID ('UID') [ defaults to next available ]: 

Initial group [ users ]: 
Additional UNIX groups:

Users can belong to additional UNIX groups on the system.
For local users using graphical desktop login managers such
as XDM/KDM, users may need to be members of additional groups
to access the full functionality of removable media devices.

* Security implications *
Please be aware that by adding users to additional groups may
potentially give access to the removable media of other users.

If you are creating a new user for remote shell access only,
users do not need to belong to any additional groups as standard,
so you may press ENTER at the next prompt.

Press ENTER to continue without adding any additional groups
Or press the UP arrow key to add/select/edit additional groups
:  audio cdrom floppy input lp scanner video wheel

Home directory [ /home/bob ] 

Shell [ /bin/bash ] 

Expiry date (YYYY-MM-DD) []: 

New account will be created as follows:

---------------------------------------
Login name.......:  bob
UID..............:  [ Next available ]
Initial group....:  users
Additional groups:  audio,cdrom,floppy,input,lp,scanner,video,wheel
Home directory...:  /home/bob
Shell............:  /bin/bash
Expiry date......:  [ Never ]

This is it... if you want to bail out, hit Control-C.  Otherwise, press
ENTER to go ahead and make the account.


Creating new account...


Changing finger information for bob.
Name []: booy
Office []: 
Office Phone []: 
Home Phone []: 


Finger information changed.
New password: 
Retype new password: 
passwd: password updated successfully


Account setup complete.


$ su bob
Password: 
[bob@voided Documents]$ whoami
bob

Last edited by BW-userx; 12-14-2018 at 05:04 PM.
 
  


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
LXer: Void Linux gave itself to the void, Korora needs a long siesta -- life is hard for small distros LXer Syndicated Linux News 0 05-16-2018 09:50 AM
Void Linux is... void black-clover Linux - Networking 8 11-23-2017 08:04 PM
pthread giving error: invalid conversion from ‘void* (*)(int*)’ to ‘void* (*)(void*)’ knobby67 Programming 4 05-05-2017 10:54 AM
(void)time(&cur_time); Why did the author put (void) here? e3399 Programming 3 03-28-2011 11:45 AM
void foo(void) and void foo() lackluster Programming 9 02-15-2003 10:57 AM

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

All times are GMT -5. The time now is 02:09 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