There seems to be a similar situation with the hashed password found in master.password and the hash generated by crypt(),
they are different, despite hashing being done on the same clear text password. In this case there are no trailing newlines.
Hi,
I'm trying to write a simple authentication plugin which authenticates a user against /etc/master.passwd.
The problem is the call to getpwnam() which fails with 'no such file or directory'
Relevant code below
char username[10];
memset(username,0,sizeof(username));
/* Read the username */...
Ok, so after a bit of fiddling i finally managed to come up with a version that works(not saying anything about code quality etc ;) )
char *reverse(char *buf){
/* Allocate enough memory for the string */
int length = strlen(buf);
char *ptr = calloc(length,sizeof(char));
char **p2p...
One thing i don't understand.
The statement 'char **bufptr = buf' and putchar(bufptr) whould print out the same output as putchar(buf). But it doesn't. Why?
char *reverse(char *buf){
/* Allocate memory for the reversed string */
char *ptr = (char *)malloc(100);
char...
Hi,
I'm trying to write a simple program for reversing a string stored in memory.
This is what I've come up with. For some reason this code coredumps, so something is wrong.
any ideas ?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char *reverse(char *buf,unsigned...
Hi,
I have a simple tcp server, to which i would like to add support for multiple client connections via pthreads. This is what i had in mind, calling accept in a separate thread.
I this similar to what you would do?
.
.
.
int sock = socket(PF_INET,SOCK_STREAM,0);
int...
Howdy,
I came across a regular expression i couldn't get my head around.
' there \([^ ]*\)'
echo "Howdy there neighbor" | sed 's/there \([^ ]*\)//'
returns howdy.
It's the subgroup that's a bit confusing.
match any sentence which contains banana then a space and then a non-space character...
Hi,
I developed a simple ad-hoc client/server chat program, however the design isn't exactly scalable since the addresses are hard coded and one of the clients is also the server.
So i wanted to write a dedicated server, to which multiple clients could connect and chat, like irssi..
how...
Hi,
I'm currently trying to implement a simple client server program in C.
Needless to say i ran into troubles, and being a novice, i turned here for some advice.
I have a function to print the connecting peers address. I don't even know if this is the right way of doing it.
For...