nisplus.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
*/
/*
* Copyright 1994-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "nisplus.h"
#include <ctype.h>
#include <pwd.h>
#include <search.h>
#include <nsswitch.h>
static void space_rm();
/*
* Mailias_print(FILE *fp, nis_object *obj)
* takes an nis_object * which points to an nis mail alias
* object and prints to the file pointed to by fp.
*/
void
{
char *val;
char *c, *o;
/*
* Need to print out an empty comments field if there's no
* comments but there are OPTIONS
*/
return;
return;
}
}
}
char *name;
int field;
{
exit(-1);
}
return (res);
}
switch (field) {
case EXPANSION_COL:
break;
case ALIAS_COL:
default:
break;
}
return (res);
}
/*
* nis_mailias_init(nis_name domain, nis_name map)
* initialiases an alias map in the given domain and gives the map
* the name passed to it in the second parameter. This is usually used
* with the current domain and on the map mail_aliases
*/
void
{
char name_buf[NIS_MAXNAMELEN];
exit(-1);
}
exit(-1);
}
}
/*
* nis_mailias_add( nis_mailias a, nis_name alias_map, nis_name domain)
* adds the alias entry a to the map alias_map in domain "domain".
* e.g. nis_mailias_add( a, "mail_aliases", "Eng.Sun.COM.");
*/
void
nis_mailias a;
{
exit(-1);
}
domain);
exit(-1);
}
}
/*
* nis_mailias_delete( nis_mailias a, nis_name alias_map, nis_name domain)
* removes the alias entry a from the table alias_map in domain "domain".
* e.g. nis_mailias_delete( a, "mail_aliases", "Eng.Sun.COM.");
*/
void
nis_mailias a;
{
exit(-1);
}
domain);
exit(-1);
}
}
/*
* nis_mailias_change( nis_mailias a, nis_name alias_map, nis_name domain)
* changes the alias entry a in the table alias_map in domain "domain".
* e.g. nis_mailias_change( a, "mail_aliases", "Eng.Sun.COM.");
*/
void
nis_mailias a;
{
char *val;
exit(-1);
}
exit(-1);
}
}
/*
* Makes and Nis_alias table entry object, given 4 (possibly NULL)
* values to put in the columns.
*/
nis_mailias a;
{
char name_buf[NIS_MAXNAMELEN];
exit(-1);
}
sizeof (struct entry_col));
exit(-1);
}
return (ret);
}
/*
* Makes and Nis_alias table entry object, given 4 (possibly NULL)
* values to put in the columns.
*/
{
char name_buf[NIS_MAXNAMELEN];
exit(-1);
}
exit(-1);
}
return (ret);
}
#define UNINIT 3
/*
* Check to see if the aliases database is initialized/installed in
* the proper format.
*
*/
int
{
return (succeeded);
case NIS_SUCCESS:
case NIS_TRYAGAIN:
case NIS_RPCERROR:
break;
default: /* all other nisplus errors */
return (FALSE);
};
}
return (FALSE);
}
return (TRUE);
}
/*
* space_rm -- takes a pointer to a string as its input. It removes
* all spaces and tabs from that string, except for those
* inside double quotes.
*/
void
{
char *t1;
int in_comment = FALSE;
while (*str != '\0') {
if (*str == '"')
in_comment = !in_comment;
else
str++;
}
*t1 = '\0';
}