4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Can't run htpasswd in script
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
thompsondl
Junior WebHelper
Junior WebHelper


Joined: 28 Jan 2004
Posts: 1

PostPosted: Wed Jan 28, 2004 2:06 am (20 years, 2 months ago) Reply with QuoteBack to Top

I am writing the user registration page for a website and using htpasswd to add the user and password to the websites user file. The program executes fine but it will not add the user to password file. I have written the program in C and I'm using the system() command to do this. The C code lookes like this...

strcpy(system_command,"/usr/bin/htpasswd -b /var/www/users ");
strcat(system_command,new_lender->username);
strcat(system_command," ");
strcat(system_command,new_lender->password);
system(system_command);

I have used this code on other websites and had no problems. I cannot figure out why it will not run on this server. I thought it might be file permisions but I did a chmod 777 on the directory the file is located in and the file itself. (i know this is bad...just for testing) I changed the owner to apache. still nothing. I put in the scipt to output the command and it looks fine. Copy and paste from webpage to shell and it executes and creates the entry in the password file. (logged in as root)

The box I am using for development is running RedHat 9.x and using the Apache that came with it. Did Apache add some restrictions to prevent the execution of htpasswd from a cgi script?

Anybody got any ideas?

Thanks,

Don
OfflineView User's ProfileFind all posts by thompsondlSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.118196 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme