From: Ralph Corderoy Date: Sat, 11 Nov 2017 23:53:00 +0000 (+0000) Subject: getpass.c: Move interface to own file. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/9291a5f82480f2458e04cb9ea7e6749bc952b308?ds=sidebyside getpass.c: Move interface to own file. --- diff --git a/Makefile.am b/Makefile.am index 96fcaf51..eeb99980 100644 --- a/Makefile.am +++ b/Makefile.am @@ -397,6 +397,7 @@ noinst_HEADERS = \ sbr/getcpy.h \ sbr/geteditor.h \ sbr/getfolder.h \ + sbr/getpass.h \ sbr/lock_file.h \ sbr/m_atoi.h \ sbr/m_backup.h \ diff --git a/h/prototypes.h b/h/prototypes.h index adfa940a..b706b429 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -62,7 +62,6 @@ char *m_name (int); void m_unknown(m_getfld_state_t *, FILE *); void m_unknown2(m_getfld_state_t *); -char *nmh_getpass(const char *); int pidwait (pid_t, int); void scan_detect_mbox_style (FILE *); diff --git a/sbr/getpass.c b/sbr/getpass.c index 99c03e00..66f02da1 100644 --- a/sbr/getpass.c +++ b/sbr/getpass.c @@ -33,6 +33,7 @@ */ #include "h/mh.h" +#include "getpass.h" #include /* We don't use MAX_PASS here because the maximum password length on a remote diff --git a/sbr/getpass.h b/sbr/getpass.h new file mode 100644 index 00000000..ab4ffae5 --- /dev/null +++ b/sbr/getpass.h @@ -0,0 +1,34 @@ +/* getpass.h -- read a password without echo. + * + * Portions of this code are Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ + +char *nmh_getpass(const char *); diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index dc94d900..55694c82 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -22,6 +22,7 @@ */ #include "h/mh.h" +#include "getpass.h" #include "ruserpass.h" #include "credentials.h" #include "error.h"