[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: slappasswd: read password from stdin (ITS#2411)



Kurt D. Zeilenga wrote:
> In looking at the code, I noticed it didn't support
> password files like the LDAP client tools (-y).  I've
> added support for this.

Is there a reason the option is -T and not -y as it is in the client
tools? Since /dev/stdin isn't portable, would you apply a patch like the
following?

--- libraries/liblutil/passfile.c.orig  2003-03-31 22:06:27.000000000 +0200
+++ libraries/liblutil/passfile.c       2003-03-31 22:10:30.000000000 +0200
@@ -27,7 +27,12 @@
        struct berval *passwd )
 {
        size_t nread, nleft, nr;
-       FILE *f = fopen( filename, "r" );
+       FILE *f;
+
+       if( strcmp( filename, "-" ) == 0 )
+               f = stdin;
+       else
+               f = fopen( filename, "r" );

        if( f == NULL ) {
                perror( filename );

-- 
Roland Bauerschmidt