Linux Programming help needed

Linux Programming help needed

Post by Josh Hardin » Fri, 30 Jun 2000 04:00:00




> but passwd said "conversation error". anoy way it doesn't work.  So
> anyone know how to handle this kind of problem? or in an alternative
> way to work the task out.

Seems like a problem with passwd reading from stdin (doesn't like echo
asdf^Jasdf | passwd either).  I'd expect it to be a bit smarter and give a
reasonable error message when stdin isn't a tty.

My RH6.1 system has a chpasswd util which you might try using.  If you're
pickier about security, you could even call crypt yourself (seeding it with
your own random salt) and use chpasswd -e.

                        The Amigo

 
 
 

Linux Programming help needed

Post by yaoz.. » Sat, 01 Jul 2000 04:00:00


hello all,

I am developing a webmail system on linux. I need to add a user into the
system by cgi(written in GNU C), of course, I executed useradd program
and passwd, the problem occurred when I tried to send the password to
passwd using a pipe.  my program goes like this

  pipe_out = popen ("passwd username", "w");
  fprintf (pipe_out, "password\npassword\n");
  pclose(pipe_out);

but passwd said "conversation error". anoy way it doesn't work.  So
anyone know how to handle this kind of problem? or in an alternative
way to work the task out.

thanks
nick

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Linux Programming help needed

Post by Thomas Homme » Sat, 01 Jul 2000 04:00:00


Ive had the same problem and it seems that passwd cant handle input
from a pipe. I use the chpasswd program now which can set passwords
correctly.

echo user:password | chpasswd

Tom


> hello all,

> I am developing a webmail system on linux. I need to add a user into the
> system by cgi(written in GNU C), of course, I executed useradd program
> and passwd, the problem occurred when I tried to send the password to
> passwd using a pipe.  my program goes like this

>   pipe_out = popen ("passwd username", "w");
>   fprintf (pipe_out, "password\npassword\n");
>   pclose(pipe_out);

> but passwd said "conversation error". anoy way it doesn't work.  So
> anyone know how to handle this kind of problem? or in an alternative
> way to work the task out.

> thanks
> nick

> Sent via Deja.com http://www.deja.com/
> Before you buy.

 
 
 

1. Linux Programming help needed

hello all,

I am developing a webmail system on linux. I need to add a user into the
system by cgi(written in GNU C), of course, I executed useradd program
and passwd, the problem occurred when I tried to send the password to
passwd using a pipe.  my program goes like this

  pipe_out = popen ("passwd username", "w");
  fprintf (pipe_out, "password\npassword\n");
  pclose(pipe_out);

but passwd said "conversation error". anoy way it doesn't work.  So
anyone know how to handle this kind of problem? or in an alternative
way to work the task out.

thanks
nick

Sent via Deja.com http://www.deja.com/
Before you buy.

2. SMC EtherPower-tulip.o module help!

3. linux programming help needed ......

4. Telnet help please

5. Help for script with programs controlling other programs needed

6. how to store real looooong itegers?

7. NEED HELP WITH PROGRAMMING POP3 MAIL PROGRAM TO RETRIEVE MAIL ON UNIX-TO-UNIX

8. Help for "make bzImage" of 2.4.2 kernel?

9. Help C program in linux help help help !!!!!!!

10. Help-i need a cd-labeler program for linux.

11. Programming a file server for linux using TCP/IP - Need help urgently

12. C++ and Assembly Programming need help in Linux pleaseeeeeeeeeeeeeeeeeeee

13. Need Help to run school's xwindow programs on linux's xwindow