A very little Display Manager and an obstacle

Open development discussions

Moderator: Developer

Re: A very little Display Manager and an obstacle

Postby ASX » Sun Aug 13, 2017 6: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]
ASX
Developer
 
Posts: 938
Joined: Wed May 06, 2015 11:46 am
Has thanked: 52 times
Been thanked: 120 times

Re: A very little Display Manager and an obstacle


Re: A very little Display Manager and an obstacle

Postby vaisarger » Mon Aug 14, 2017 10:05 am

Ok. Now it's clear! ;) Thank you
vaisarger
 
Posts: 39
Joined: Fri Oct 03, 2014 11:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: A very little Display Manager and an obstacle

Postby vaisarger » Wed Oct 04, 2017 5: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/my--scripts/my-freebsd/easydm-0.0.2.tar.gz
vaisarger
 
Posts: 39
Joined: Fri Oct 03, 2014 11:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: A very little Display Manager and an obstacle

Postby ASX » Wed Oct 04, 2017 5: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 ;)
ASX
Developer
 
Posts: 938
Joined: Wed May 06, 2015 11:46 am
Has thanked: 52 times
Been thanked: 120 times

Previous

Return to Development Discussions

Who is online

Users browsing this forum: No registered users and 2 guests