ui-sun.c revision 4bff34e37def8a90f9194d81bc345c52ba20086a
/*
* Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
* Original Code as defined in and that are subject to the Apple Public
* Source License Version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License."
*
* @APPLE_LICENSE_HEADER_END@
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines for interacting with the user to get credentials
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <libintl.h>
#include <ctype.h>
#include <netsmb/smb_keychain.h>
#define MAXLINE 127
static void
smb_tty_prompt(char *prmpt,
{
char *cp;
int ch;
break;
continue;
break;
}
/* If input empty, accept default. */
return;
/* Use input as new value. */
}
int
{
char *npw;
} else {
/*
* 1st: try lookup using system name
*/
if (!kcerr) {
/*
* Need passwd to be not empty for existing logic.
* The string here is arbitrary (a debugging hint)
* and will be replaced in the driver by the real
* password from the keychain.
*/
if (smb_debug) {
printf("found keychain entry for"
systemname, usr);
}
return (0);
}
/*
* 2nd: try lookup using domain name
*/
if (!kcerr) {
/* Need passwd to be not empty... (see above) */
if (smb_debug) {
printf("found keychain entry for"
}
return (0);
}
}
}
return (0);
}
/*
* XXX: Ask the user for help, possibly via
* GNOME dbus or some such... (todo).
*/
"Cannot prompt for a password when input is redirected."), 0);
return (ENOTTY);
}
int
{
/*
* Let user pick a share.
* Not supported.
*/
return (EINTR);
}