Yep, as I suspected. I was able to get it to segfault by not giving it the parameters it was expecting and it tried to access a parameter beyond what I had passed it (trying to access unallocated memory). The specific line where I got it to segfault is line 92:
- Code: Select all
strncpy(nambuf, argv[arg], sizeof(nambuf));
Now, not being familiar with this code or the program it is written for it would be best to contact the author of the program and have him fix it. But I suspect that the program works as long as it is used as it is expected to be used and that the /etc/glftpd.conf file is good and proper params are passed etc. However, it should not segfault as I said before, it should properly check for errors and gracefully exit when it encounters one along with a little inforation on what the problem is.
Now, if you want me to actually debug it further and try and figure out exactly what the problem is I'll need a copy of your glftpd.conf file, the location that the glftpd.conf file is installed on your system, the permissions of the file, the exact command line you used when running glupdate that caused the segfault and any other information you might think is helpful. But again, it would be much easier for me if you contacted the original author and tell him it's broke. :)
EDIT: Actually looking at your trace file I see you ran the program like this:
- Code: Select all
./glupdate -r /etc/glftpd.conf
And that is not correct. You did the same thing I did to make it crash. You need another parameter on the end of that command line, the actual directory name that you want to update. I suspect something like:
./glupdate -r /etc/glftpd.conf /var/ftp/somedir
However, that doesn't work for me either, it just exits and when I look at the source I see why. "argc" will be 4 with the above command line which is exactly the syntax it expects according to the help if you just type "./glupdate" by itself to get the help:
- Code: Select all
$ ./glupdate
glFtpD DIRLOG update utility v2.2
Usage: ./glupdate [-r /pathto/glftpd.conf] <full directory path>
Problem is:
- Code: Select all
if (argc < 2 || argc > 3) {
printf("\n\
glFtpD DIRLOG update utility v2.2\n\n\
Usage: %s [-r /pathto/glftpd.conf] <full directory path>\n\n",argv[0]);
exit(0);
}
tells the program to exit if argc is greater than 3. Last time I checked 4 is greater than 3. This program is um... not good.
Maybe try just this:
./glupdate /var/ftp/somedir
Or whatever the directory is that you want to update (I don't really know what this program is supposed to do)....
But I hate to tell you to run it at all for fear it might screw up your system after seeing the little code I saw.
At any rate, reinstalling your operating system would have no effect on this one. :)