A very little Display Manager and an obstacle

Open development discussions

Moderator: Developer

ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: A very little Display Manager and an obstacle

Post by ASX »

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: 40
Joined: Fri Oct 03, 2014 12:04 pm

Re: A very little Display Manager and an obstacle

Post by vaisarger »

Ok. Now it's clear! ;) Thank you
vaisarger
Posts: 40
Joined: Fri Oct 03, 2014 12:04 pm

Re: A very little Display Manager and an obstacle

Post by vaisarger »

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

Re: A very little Display Manager and an obstacle

Post by ASX »

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