A very little Display Manager and an obstacle

Open development discussions

Moderator: Developer

ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm
Has thanked: 0
Been thanked: 0

Re: A very little Display Manager and an obstacle

Post by ASX » Sun Aug 13, 2017 7:35 pm

also,, for clarity: strlen("12345"); will return 5 but to store that string you will need at least 6 bytes: --> [1] [2] [3] [4] [5] [\0]

vaisarger
Posts: 39
Joined: Fri Oct 03, 2014 12:04 pm
Has thanked: 0
Been thanked: 0

Re: A very little Display Manager and an obstacle

Post by vaisarger » Mon Aug 14, 2017 11:05 am

Ok. Now it's clear! ;) Thank you

vaisarger
Posts: 39
Joined: Fri Oct 03, 2014 12:04 pm
Has thanked: 0
Been thanked: 0

Re: A very little Display Manager and an obstacle

Post by vaisarger » Wed Oct 04, 2017 6:05 pm

Just to close the topic: despite my time is like gold for me nowadays, I managed to make my little Display Manager "EasyDM" check users' password in FreeBSD too! Through a more POSIX way without the "shadow" library, that is a linuxism. 8-)
I fixed bug #1: password check in *BSD systems not working. ;)

Moreover, I banned sprintf() from my little home-made DM, to use snprintf() instead

Code: Select all

                       #define _XOPEN_SOURCE
			#include <syslog.h>
			#include <unistd.h>
			#include <shadow.h>
			
			main(int argc, char *argv[])
				{
				char parola_da_cryptare[100];
				char utente[100];
				struct spwd * dati_da_etc_passwd ;
				char *puntatore_a_parola_da_cryptare ;
				snprintf(parola_da_cryptare,sizeof(parola_da_cryptare),"%s",argv[1]);
				snprintf(utente,sizeof(utente),"%s",argv[2]);
				dati_da_etc_passwd=getspnam(utente);
				puntatore_a_parola_da_cryptare=crypt(parola_da_cryptare,dati_da_etc_passwd->sp_pwdp) ;
Thank you ASX! I have learnt a lot in forums like this one... :D



Image


If you are curious, here is my toy:
https://sites.google.com/site/vaisarger ... 0.2.tar.gz

ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm
Has thanked: 0
Been thanked: 0

Re: A very little Display Manager and an obstacle

Post by ASX » Wed Oct 04, 2017 6:18 pm

Thanks for sharing you work, I will take a look soon. :)

Btw, the image is not accessible for me ... may be because I'm not logged on google ...
403. That’s an error.

Your client does not have permission to get URL
I will look at the real thing ;)

Post Reply