You are not logged in.
Pages: 1
Hi,
I'm searching a way to modify the terminal-based login. I'd like to change the way it says "wrong password" (I'd like it to say something using festival). I haven't found a way, anyone who can help me?
Thanks in advance,
gudgip
Offline
the login is handled by agetty and the "wrong password" message is probably compiled into it's source code, so you may have to patch it. I'm not 100% on this, but I'm about 75% sure.
urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand
Offline
Look in util-linux-2.16/login-utils/simpleinit.c, line 345 or thereabouts
Just replace the puts line with whatever you like.
Offline
Look in util-linux-2.16/login-utils/simpleinit.c, line 345 or thereabouts
Just replace the puts line with whatever you like.
[gudgip@gudhost ~]$ locate util-linux-2.16
[gudgip@gudhost ~]$ locate login-utils
[gudgip@gudhost ~]$ pacman -Ss login-utils
[gudgip@gudhost ~]$
Looks like your system is a little different than mine
Offline
You need to download ftp://ftp.kernel.org/pub/linux/utils/ut … 16.tar.bz2
extract it and edit util-linux-ng-2.16/login-utils/simpleinit.c at line... yeah, 345
Last edited by lolilolicon (2009-10-04 09:24:19)
This silver ladybug at line 28...
Offline
First of all, thanks for the help guys!
So I downloaded the package:
cd ~/Downloads/
cd util-linux-ng-2.16
vim'ing the file, editting what I need
sudo ./configure
make
make install
Now I try to reboot and I see that it says "login incorrect", not even "wrong password" -> like it should be in that package (line 345)
What did I do wrong?
if ( !strcmp (crypt (pass, rootpass), rootpass) ) return 1;
system('echo "Wrong password, please try again." | festival --tts');
puts (_("\nWrong password.\n"));
}
I only added the system() line.
Last edited by gudgip (2009-10-04 10:04:26)
Offline
Aside from any bad source editing (you'll have to ask someone more experienced with C):
NEVER use 'make', 'make install'!! x.x If you still have that source dir, do a 'make uninstall' pronto.
Use ABS for installing stuff, especially stuff Arch already has in the repos: http://wiki.archlinux.org/index.php/ABS … ild_System
With 'make install', the files it dumps all over your system are not tracked by Pacman, and thus cannot easily be installed, uninstalled, upgraded, etc. Plus, the Arch util-linux-ng package may do special things a simple 'make install' does not.
Offline
Aside from any bad source editing (you'll have to ask someone more experienced with C):
NEVER use 'make', 'make install'!! x.x If you still have that source dir, do a 'make uninstall' pronto.
Use ABS for installing stuff, especially stuff Arch already has in the repos: http://wiki.archlinux.org/index.php/ABS … ild_System
With 'make install', the files it dumps all over your system are not tracked by Pacman, and thus cannot easily be installed, uninstalled, upgraded, etc. Plus, the Arch util-linux-ng package may do special things a simple 'make install' does not.
Bad source editting? I just added 1 line, that's it..
And I'll read up about ABS, thanks.
Offline
I'm not much of a C programmer, I deal mostly with Java / PHP / JavaScript / and other web-oriented languages, but I would suggest modifying your system() function call to the following:
system("echo \"Wrong password, please try again.\" | festival --tts");
All the C-based languages I've dealt with (C, C++, Java, etc.) use the single quote (') to encapsulate a single character, not a string (an array of characters). Changing the outer single quotes to double quotes and escaping the inner double quotes should help you a lot. If you prefer, since you don't need to perform any string interpolations (such as substituting $shell with bash) from your system call, you can replace the inner double quotes with single quotes, but make sure you still replace the outer single quotes with double quotes:
system("echo 'Wrong password, please try again.' | festival --tts");
In agreement with @Ranguvar, I would definitely suggest learning about the ABS.
EDIT: Also, I would suggest against running sudo ./configure, for security purposes. Simply running ./configure should suffice.
Last edited by deltaecho (2009-10-04 16:03:26)
Dylon
Offline
So I did 'make uninstall' and suddenly I couldn't boot anymore, so I booted a livecd of archlinux and chrooted into /dev/sda3 and ./configure 'd the util-linux again. I've used slackware/ubuntu before, that's maybe the reason that I ./configure some stuff. Is there a way to convert the way I've done for linux-utils to the ABS-way, or should I just leave it as it is now?
I use sudo because ./configure gives permission denied
Last edited by gudgip (2009-10-04 16:35:42)
Offline
So I did 'make uninstall' and suddenly I couldn't boot anymore
Thus the reason you should use the ABS and Pacman
Assuming the only files that have been changed were those directly related to util-linux-ng, all you should have to do to fix your system is reinstall util-linux-ng from the chroot:
# pacman -Sy util-linux-ng
EDIT: If ./configure gives you permission denied, I would imagine you unpacked the archive with your root account -- compiling applications as root is a bad idea.
Last edited by deltaecho (2009-10-04 16:41:45)
Dylon
Offline
Thanks, I'm installing abs as we speak. I've quickly looked into ABS and it should indeed make things easier. Thanks all for the great help!
I'm going to continue my quest to editting the login
Offline
Cool then!
A quick grep -rni 'login incorrect' . in the util-linux-ng source revealed lines 640, 658, and 863 of the util-linux-ng-2.16/login-utils/login.c file each print "Login incorrect" to the console window; those are probably the lines you want to change.
Last edited by deltaecho (2009-10-04 16:59:08)
Dylon
Offline
Thanks for those amazingly usefull hints! I've just tried to install a package from source using abs and it worked
Offline
ABS is black magic
And well-spotted, pyther (dunno if true).
Offline
Pages: 1