/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*LINTLIBRARY*/
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <unistd.h>
#include <stdlib.h>
#ifdef MAIN
int
main() {
int result = 0;
if (result != 0) {
printf("Add 1 failed, err code = %d\n");
}
if (result != 0) {
printf("Delete 1 failed, err code = %d\n");
}
if (result != 0) {
printf("delete failed, err code = %d\n");
}
if (result != 0) {
printf("delete failed, err code = %d\n");
}
if (result != 0) {
printf("add failed, err code = %d\n");
}
if (result != 0) {
printf("modify failed, err code = %d\n");
}
if (result != 0) {
printf("modify failed, err code = %d\n");
}
exit(0);
}
#endif
int
const char *host,
const char *user,
const char *passwd,
const char *cmd,
const char *locale) {
int ret = 0;
int fd = 0;
char *ferr;
/*
* Re-direct stderr to a file
*/
}
if (fd > -1) {
/*
* rexec worked. Clean up stderr file.
*/
if (ret < 0) {
(BUFSIZ - 1));
return (errno);
}
if (ret < 0) {
(BUFSIZ - 1));
return (errno);
}
} else {
/*
* rexec failed. Read from the stderr file.
*/
if ((strlen(glob_stderr) +
break;
} else {
}
}
}
return (1);
}
return (0);
}
void
{
if (fd > 0) {
}
if (fd2 > 0) {
}
}
void
{
}
}
}
struct ns_bsd_addr {
};
struct ns_kvp {
};
/*
* Information needed to update a name service.
*/
/* LDAP bind password security type */
typedef enum NS_PASSWD_TYPE {
NS_PW_INSECURE = 0,
struct ns_cred {
char *binddn;
char *passwd;
char *host;
};
/* LDAP specific NS Data */
typedef struct NS_LDAPDATA {
} NS_LDAPDATA;
/* Printer Object structure */
struct ns_printer {
};
extern ns_printer_t *ns_printer_get_name(const char *, const char *);
extern int ns_printer_put(const ns_printer_t *);
extern char *ns_get_value_string(const char *, const ns_printer_t *);
extern int ns_set_value(const char *, const void *, ns_printer_t *);
extern int ns_set_value_from_string(const char *, const char *,
ns_printer_t *);
extern ns_bsd_addr_t *bsd_addr_create(const char *, const char *,
const char *);
extern char *bsd_addr_to_string(const ns_bsd_addr_t *);
extern void ns_printer_destroy(ns_printer_t *);
int
const char *action,
const char *printername,
const char *printserver,
const char *extensions,
const char *comment,
const char *isdefault) {
int status = 0;
/*
* libprint returns before we know that the printers.conf
* map is made. So we'll make it again.
*/
(void) yp_get_default_domain(&domain);
} else {
"-f /var/yp/Makefile.print printers.conf "
}
if ((printer = (ns_printer_t *)
return (0);
}
if (status != 0) {
return (status);
}
if ((printer = (ns_printer_t *)
char *dflt = (char *)
if (status != 0) {
return (status);
}
}
}
return (0);
if ((extensions != NULL) &&
(strlen(extensions) > 0)) {
}
ns_set_value_from_string("description",
}
if (status != 0) {
return (status);
}
if (status != 0) {
return (status);
}
}
return (0);
}
/*
* Modify
*/
if ((printer = (ns_printer_t *)
return (1);
}
} else {
ns_set_value_from_string("description",
}
if (status != 0) {
return (status);
}
if ((printer = (ns_printer_t *)
/*
* We were the default printer but not
* any more.
*/
if (status != 0) {
return (status);
}
}
} else {
ns_set_value_from_string("use",
if (status != 0) {
return (status);
}
}
}
} else {
if (status != 0) {
return (status);
}
}
return (0);
}
int
const char *action,
const char *host,
const char *binddn,
const char *passwd,
const char *printername,
const char *printserver,
const char *extensions,
const char *comment,
const char *isdefault)
{
int status;
if (printserver == NULL) {
/* printserver not given so use host */
printserver = host;
}
/*
* Delete printer object from LDAP directory DIT
*/
if ((printer = (ns_printer_t *)
return (0);
}
return (1);
}
(void) ns_printer_destroy(printer);
if (status != 0) {
return (status);
}
if ((printer = (ns_printer_t *)
char *dflt = (char *)
(void) ns_printer_destroy(printer);
return (1);
}
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
}
(void) ns_printer_destroy(printer);
}
return (0);
/*
* Add new printer object into LDAP directory DIT
*/
return (1);
}
/* set BSD address in attribute list */
if (extensions == NULL) {
} else {
}
(void) ns_printer_destroy(printer);
return (1);
}
if (extensions == NULL) {
} else {
}
(void *)item);
(void) ns_printer_destroy(printer);
return (1);
}
(void *)item);
}
(void) ns_printer_destroy(printer);
return (1);
}
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
(void) ns_printer_destroy(printer);
return (1);
}
(void *)item);
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
}
(void) ns_printer_destroy(printer);
return (0);
}
/*
* Modify printer object in the LDAP directory DIT
*/
if ((printer = (ns_printer_t *)
return (1);
}
(void) ns_printer_destroy(printer);
return (1);
}
} else {
(void) ns_printer_destroy(printer);
return (1);
}
}
(void) ns_printer_destroy(printer);
return (1);
}
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
/*
* Handle the default printer.
*/
if ((printer = (ns_printer_t *)
/*
* We were the default printer but not
* any more. So delete the default entry
*/
(void) ns_printer_destroy(printer);
return (1);
}
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
}
/*
* Modify this default entry to use us.
*/
(void) ns_printer_destroy(printer);
return (1);
}
(void) ns_printer_destroy(printer);
return (1);
}
(void *)item);
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
}
/*
* No default entry existed and we need one.
*/
(void) ns_printer_destroy(printer);
return (1);
}
(void) ns_printer_destroy(printer);
return (1);
}
if (status != 0) {
(void) ns_printer_destroy(printer);
return (status);
}
}
(void) ns_printer_destroy(printer);
return (0);
}
/*
* *****************************************************************************
*
* Function: _freeList()
*
* Description: Free the list created by list_append() where the items in
* the list have been strdup'ed.
*
* Parameters:
* Input: char ***list - returned set of kvp values
*
* Result: void
*
* *****************************************************************************
*/
static void
{
int i = 0;
/* ------ */
}
}
}
} /* _freeList */