Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
03-27-2019, 09:31 AM
|
#1
|
LQ Newbie
Registered: Mar 2019
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 6
Rep:
|
adduser shell script error
Yea, I'm on Slackware now, don't ask, long story.
Anyhow, it seems like the script doesn't like invalid and/or unsupported characters, cause when I was filling in some info about the new user it didn't work out and it kindly went to the next step of the configuration. So when the user was logged in none of the configuration info I have set in that particular step of the configuration were not preserved even though some info I have set in some of the steps of that particular step of the configuration did not have any invalid and/or unsupported characters.
The question is, is there a list of invalid and/or unsupported characters for this particular script and will it be rewritten so that it gives you an option to fix the info you want to fill in if the characters are invalid and/or unsupported?
Sincerely,
Alan
|
|
|
03-27-2019, 10:18 AM
|
#2
|
Senior Member
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950
Rep:
|
Would you mind spelling out how to reproduce this and share the complete output with errors?
|
|
|
03-27-2019, 11:09 AM
|
#3
|
Slackware Contributor
Registered: Apr 2008
Distribution: Slackware
Posts: 1,591
|
Quote:
Originally Posted by orbea
Would you mind spelling out how to reproduce this and share the complete output with errors?
|
Yep. It uses bash's 'read' builtin, and uses the 'readline' library. If you do the following, you'll see the same issue.
Code:
read -e foo ; echo $foo
I'm not really sure what I could do to change that, but I'll see what input you're providing first.
|
|
|
03-27-2019, 11:28 AM
|
#4
|
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
|
if you go into /usr/sbin you'll find adduser. it is a script. check it out, and you'll see how it's working. maybe give you a lead. Perhaps even you could add a fix to elevate your situation for when you add invalid and/or unsupported characters, it rejects it.
Last edited by BW-userx; 03-27-2019 at 11:34 AM.
|
|
|
03-27-2019, 11:33 AM
|
#5
|
Slackware Contributor
Registered: Apr 2008
Distribution: Slackware
Posts: 1,591
|
Quote:
Originally Posted by BW-userx
if you go into /usr/sbin you'll find adduser. it is a script. check it out, and you'll see how it's working. maybe give you a lead. Perhaps even you could add a fix to elevate your situation.
|
I know. I wrote it. If I know what data it's being fed, I might have an idea about it.
|
|
1 members found this post helpful.
|
03-27-2019, 12:38 PM
|
#6
|
Senior Member
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950
Rep:
|
I assume this is the relevant function?
Code:
# Function to read keyboard input.
# bash1 is broken (even ash will take read -ep!), so we work around
# it (even though bash1 is no longer supported on Slackware).
function get_input() {
local output
if [ "`echo $BASH_VERSION | cut -b1`" = "1" ]; then
echo -n "${1} " >&2 # fudge for use with bash v1
read output
else # this should work with any other /bin/sh
read -ep "${1} " output
fi
echo $output
}
As you said its hard to help without knowing what the invalid input is and also seeing the actual point of failure, is it failing with read or somewhere else?
Also as a side point that comment is not correct, neither Slackware's ash or dash have "read -e". Fwiw here is the posix spec for read.
https://pubs.opengroup.org/onlinepub...ties/read.html
|
|
|
03-27-2019, 02:34 PM
|
#7
|
LQ Newbie
Registered: Mar 2019
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 6
Original Poster
Rep:
|
Thanks for the replies so far, folks!
Well, to answer some questions; as for the input it was as simple as typing an email address under "Other" when I was to type in user's full name, work phone, etc. It was something like this:
Code:
email: somebody@protonmail.com
I hit Enter and boom, error and of to the next step of adding the user we go. After finishing the rest of the configuration and logging in as the user nothing was preserved from that step of the configuration when error occurred as far as I could tell at the moment. I cannot reproduce the error now but if you follow my steps you should see it.
@BW-userx Yea, I could probably fix it, but maybe this would be good for Slackware if it is by default.
Last edited by alan_ri (2.0); 03-27-2019 at 02:41 PM.
|
|
|
03-27-2019, 02:50 PM
|
#8
|
Slackware Contributor
Registered: Apr 2008
Distribution: Slackware
Posts: 1,591
|
Quote:
Originally Posted by alan_ri (2.0)
Thanks for the replies so far, folks!
Well, to answer some questions; as for the input it was as simple as typing an email address under "Other" when I was to type in user's full name, work phone, etc. It was something like this:
Code:
email: somebody@protonmail.com
I hit Enter and boom, error and of to the next step of adding the user we go. After finishing the rest of the configuration and logging in as the user nothing was preserved from that step of the configuration when error occurred as far as I could tell at the moment. I cannot reproduce the error now but if you follow my steps you should see it.
@BW-userx Yea, I could probably fix it, but maybe this would be good for Slackware if it is by default.
|
There's no issue using an email address here. Also, the input at that point is to the 'useradd' binary.
I don't know what's going on there.
|
|
|
03-27-2019, 02:53 PM
|
#9
|
LQ Newbie
Registered: Mar 2019
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by drmozes
There's no issue using an email address here. Also, the input at that point is to the 'useradd' binary.
I don't know what's going on there.
|
Did you try to reproduce the error with the exact input not just with the email address?
|
|
|
03-27-2019, 03:01 PM
|
#10
|
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
|
Quote:
Originally Posted by alan_ri (2.0)
Thanks for the replies so far, folks!
Well, to answer some questions; as for the input it was as simple as typing an email address under "Other" when I was to type in user's full name, work phone, etc. It was something like this:
Code:
email: somebody@protonmail.com
I hit Enter and boom, error and of to the next step of adding the user we go. After finishing the rest of the configuration and logging in as the user nothing was preserved from that step of the configuration when error occurred as far as I could tell at the moment. I cannot reproduce the error now but if you follow my steps you should see it.
@BW-userx Yea, I could probably fix it, but maybe this would be good for Slackware if it is by default.
|
yes, then you'd submit it to the maintainer ...
and as I thought if is is an external program that is being called to take in this information. then it might fall under user error, unless said user wants to go in and fix that source code.
Last edited by BW-userx; 03-27-2019 at 03:03 PM.
|
|
|
03-27-2019, 04:19 PM
|
#11
|
Member
Registered: Oct 2017
Location: UK
Distribution: Slackware 15
Posts: 39
Rep:
|
Quote:
Originally Posted by alan_ri (2.0)
Thanks for the replies so far, folks!
Code:
email: somebody@protonmail.com
|
I can recreate the problem, in that example it's the colon that makes it fail. It's invalid because /etc/passwd where the info gets stored uses the colon as a field separator. It's the program chfn that is falling over, if you look at the man page it tells you other things to avoid.
Code:
Home Phone []: 1
Other []: :
chfn: ':' contains illegal characters
- Warning: an error occurred while setting finger information
Last edited by Ian M; 03-27-2019 at 04:21 PM.
|
|
3 members found this post helpful.
|
03-28-2019, 08:30 AM
|
#12
|
LQ Newbie
Registered: Mar 2019
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by Ian M
I can recreate the problem, in that example it's the colon that makes it fail. It's invalid because /etc/passwd where the info gets stored uses the colon as a field separator. It's the program chfn that is falling over, if you look at the man page it tells you other things to avoid.
Code:
Home Phone []: 1
Other []: :
chfn: ':' contains illegal characters
- Warning: an error occurred while setting finger information
|
Yea, you see when I don't have time or whatever to look into something by myself I ask a question on forums like this hoping for a quick reply and in a way that's what forums are about and since Slackware contributor who wrote this script was here maybe he'll fix certain things cause I think it would be good for Slackware in general. That's why I won't mark this thread as solved.
I had my things with Slackware in the past but it was more of a moral issue not a technical issue, though there are. And you almost can't find a distro on Distrowatch I haven't used, tried or tested, but a, Slackware is now my main OS. So let's make it the best it can be!
Sincerely,
Alan
|
|
|
03-28-2019, 08:39 AM
|
#13
|
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
|
As pointed out in detail. This falls under user error. The program that the script is calling that takes in the information for the user has within it a disclaimer or notification on illegal characters, therefore they cannot be used in the information given to a user, and a substitute has to be used in its place.
This has nothing to do with the person that wrote the script adduser that uses the programs that where created by someone else to add a user into the system.
Someone that is a user of an Operating System, the responsibility then falls on same said user to know the limitations of the programs he or she is using within the same said Operating System. Which does require more knowledge then how to use a keyboard.
Therefore the maintainer of this script adduser is not and cannot be held responsible to this issue. Instead it falls upon the user that posted on it under 'user error" and not the developer of same said script.
Therefore, this issue is solved, and should reflect same.
Last edited by BW-userx; 03-28-2019 at 08:48 AM.
|
|
|
03-28-2019, 08:45 AM
|
#14
|
Senior Member
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950
Rep:
|
Quote:
Originally Posted by alan_ri (2.0)
Yea, you see when I don't have time or whatever to look into something by myself I ask a question on forums like this hoping for a quick reply and in a way that's what forums are about and since Slackware contributor who wrote this script was here maybe he'll fix certain things cause I think it would be good for Slackware in general. That's why I won't mark this thread as solved.
|
Fwiw this is a give and take relationship, people who are willing to try to help themselves are much more likely to get useful help here or at pretty much any forum that offers help or advice.
|
|
|
03-28-2019, 08:49 AM
|
#15
|
Slackware Contributor
Registered: Apr 2008
Distribution: Slackware
Posts: 1,591
|
Quote:
Originally Posted by alan_ri (2.0)
quick reply and in a way that's what forums are about and since Slackware contributor who wrote this script was here maybe he'll fix certain things cause I think it would be good for Slackware in general. That's why I won't mark this thread as solved.
|
The script works fine - it reports a warning when chfn fails, and you receive the error response directly from chfn -- so you can see for yourself what the issue is. Having the "finger" information set isn't required for an operational account, plus it's too late because the user was already created: it's far outside of the scope of "adduser" to handle removing the account or doing something else to fix it.
There's nothing to fix.
|
|
|
All times are GMT -5. The time now is 11:17 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|