static unsigned long
inetstr2int (const char *str)
{
- char buffer[strlen(str)+3];
- int i, j;
+ char buffer[strlen (str) + 3];
+ size_t buflen;
+ size_t i, j;
- strcpy (buffer, str);
+ buflen = stpcpy (buffer, str) - buffer;
j = 0;
- for (i = 0; i < strlen (buffer); ++i)
+ for (i = 0; i < buflen; ++i)
if (buffer[i] == '.')
{
++j;
}
}
- return inet_addr(buffer);
+ return inet_addr (buffer);
}
static CLIENT *
__nis_dobind (const nis_server *server, u_long flags)
{
struct sockaddr_in clnt_saddr;
- int clnt_sock, i;
+ int clnt_sock;
+ size_t i;
CLIENT *client = NULL;
- void *out;
+ /* XXX What is this variable for? */
+ void *out = NULL;
for (i = 0; i < server->ep.ep_len; i++)
{
{
if (server->ep.ep_val[i].uaddr[i] == '-')
clnt_saddr.sin_addr.s_addr =
- inetstr2int(server->ep.ep_val[i].uaddr);
+ inetstr2int (server->ep.ep_val[i].uaddr);
else
if (strcmp (server->ep.ep_val[i].proto,"udp") == 0)
{
if ((flags & USE_DGRAM) == USE_DGRAM)
clnt_saddr.sin_addr.s_addr =
- inetstr2int(server->ep.ep_val[i].uaddr);
+ inetstr2int (server->ep.ep_val[i].uaddr);
else
continue;
}
continue;
else
clnt_saddr.sin_addr.s_addr =
- inetstr2int(server->ep.ep_val[i].uaddr);
+ inetstr2int (server->ep.ep_val[i].uaddr);
}
}
else
char netname[MAXNETNAMELEN+1];
char *p;
- strcpy(netname,"unix.");
- strncat(netname,server->name,MAXNETNAMELEN-5);
+ strcpy (netname, "unix.");
+ strncat (netname, server->name,MAXNETNAMELEN-5);
netname[MAXNETNAMELEN-5] = '\0';
- p = strchr(netname,'.');
+ p = strchr (netname, '.');
*p = '@';
client->cl_auth =
- authdes_pk_create(netname, &server->pkey, 300, NULL, NULL);
+ authdes_pk_create (netname, &server->pkey, 300, NULL, NULL);
if (!client->cl_auth)
- client->cl_auth = authunix_create_default();
+ client->cl_auth = authunix_create_default ();
}
else
#endif
- client->cl_auth = authunix_create_default();
+ client->cl_auth = authunix_create_default ();
}
return client;
}
{
CLIENT *clnt;
directory_obj *dir = NULL;
- nis_server *server;
+ const nis_server *server;
int try, result, server_len;
if (serv == NULL || serv_len == 0)
if (result != RPC_SUCCESS)
{
- clnt_perror (clnt, "do_niscall: clnt_call");
+ /* XXX Grrr. The cast is needed for now since Sun code does
+ note know about `const'. */
+ clnt_perror (clnt, (char *) "do_niscall: clnt_call");
clnt_destroy (clnt);
result = NIS_RPCERROR;
}
* structures used by the NIS service. It includes the file nis_tags.h
* which defines the tag values. This allows the tags to change without
* having to change the nis.x file.
- *
+ *
* NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
- * rpcgen is run on the nis.x file. Note that there is a
+ * rpcgen is run on the nis.x file. Note that there is a
* simple sed script to remove some unneeded lines. (See the
* Makefile target nis.h)
*
} zattr_val;
};
typedef struct nis_attr nis_attr;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_attr(XDR *, nis_attr*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_attr(XDR *, nis_attr*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_attr();
-#endif /* Old Style C */
+#endif /* Old Style C */
typedef char *nis_name;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_name(XDR *, nis_name*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_name(XDR *, nis_name*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_name();
-#endif /* Old Style C */
+#endif /* Old Style C */
enum zotypes {
PRIVATE_OBJ = 7,
};
typedef enum zotypes zotypes;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_zotypes(XDR *, zotypes*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_zotypes(XDR *, zotypes*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_zotypes();
-#endif /* Old Style C */
+#endif /* Old Style C */
enum nstype {
CDS = 8,
};
typedef enum nstype nstype;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nstype(XDR *, nstype*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nstype(XDR *, nstype*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nstype();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct oar_mask {
zotypes oa_otype;
};
typedef struct oar_mask oar_mask;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_oar_mask(XDR *, oar_mask*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_oar_mask(XDR *, oar_mask*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_oar_mask();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct endpoint {
char *proto;
};
typedef struct endpoint endpoint;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_endpoint(XDR *, endpoint*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_endpoint(XDR *, endpoint*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_endpoint();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_server {
netobj pkey;
};
typedef struct nis_server nis_server;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_server(XDR *, nis_server*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_server(XDR *, nis_server*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_server();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct directory_obj {
} do_armask;
};
typedef struct directory_obj directory_obj;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_directory_obj(XDR *, directory_obj*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_directory_obj(XDR *, directory_obj*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_directory_obj();
-#endif /* Old Style C */
+#endif /* Old Style C */
#define EN_BINARY 1
#define EN_CRYPT 2
} ec_value;
};
typedef struct entry_col entry_col;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_entry_col(XDR *, entry_col*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_entry_col(XDR *, entry_col*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_entry_col();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct entry_obj {
} en_cols;
};
typedef struct entry_obj entry_obj;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_entry_obj(XDR *, entry_obj*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_entry_obj(XDR *, entry_obj*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_entry_obj();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct group_obj {
} gr_members;
};
typedef struct group_obj group_obj;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_group_obj(XDR *, group_obj*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_group_obj(XDR *, group_obj*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_group_obj();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct link_obj {
nis_name li_name;
};
typedef struct link_obj link_obj;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_link_obj(XDR *, link_obj*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_link_obj(XDR *, link_obj*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_link_obj();
-#endif /* Old Style C */
+#endif /* Old Style C */
#define TA_BINARY 1
#define TA_CRYPT 2
u_long tc_rights;
};
typedef struct table_col table_col;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_table_col(XDR *, table_col*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_table_col(XDR *, table_col*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_table_col();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct table_obj {
char *ta_path;
};
typedef struct table_obj table_obj;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_table_obj(XDR *, table_obj*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_table_obj(XDR *, table_obj*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_table_obj();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct objdata {
} objdata_u;
};
typedef struct objdata objdata;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_objdata(XDR *, objdata*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_objdata(XDR *, objdata*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_objdata();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_oid {
u_long mtime;
};
typedef struct nis_oid nis_oid;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_oid(XDR *, nis_oid*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_oid(XDR *, nis_oid*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_oid();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_object {
objdata zo_data;
};
typedef struct nis_object nis_object;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_object(XDR *, nis_object*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_object(XDR *, nis_object*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_object();
-#endif /* Old Style C */
+#endif /* Old Style C */
#endif /* if __nis_object_h */
NIS_DUMPLATER = 47,
};
typedef enum nis_error nis_error;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_error(XDR *, nis_error*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_error(XDR *, nis_error*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_error();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_result {
u_long cticks;
};
typedef struct nis_result nis_result;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_result(XDR *, nis_result*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_result(XDR *, nis_result*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_result();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct ns_request {
} ns_object;
};
typedef struct ns_request ns_request;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_ns_request(XDR *, ns_request*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_ns_request(XDR *, ns_request*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_ns_request();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct ib_request {
netobj ibr_cookie;
};
typedef struct ib_request ib_request;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_ib_request(XDR *, ib_request*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_ib_request(XDR *, ib_request*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_ib_request();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct ping_args {
u_long stamp;
};
typedef struct ping_args ping_args;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_ping_args(XDR *, ping_args*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_ping_args(XDR *, ping_args*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_ping_args();
-#endif /* Old Style C */
+#endif /* Old Style C */
enum log_entry_t {
UPD_STAMP = 8,
};
typedef enum log_entry_t log_entry_t;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_log_entry_t(XDR *, log_entry_t*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_log_entry_t(XDR *, log_entry_t*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_log_entry_t();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct log_entry {
nis_object le_object;
};
typedef struct log_entry log_entry;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_log_entry(XDR *, log_entry*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_log_entry(XDR *, log_entry*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_log_entry();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct log_result {
} lr_entries;
};
typedef struct log_result log_result;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_log_result(XDR *, log_result*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_log_result(XDR *, log_result*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_log_result();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct cp_result {
u_long cp_dticks;
};
typedef struct cp_result cp_result;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_cp_result(XDR *, cp_result*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_cp_result(XDR *, cp_result*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_cp_result();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_tag {
char *tag_val;
};
typedef struct nis_tag nis_tag;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_tag(XDR *, nis_tag*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_tag(XDR *, nis_tag*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_tag();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct nis_taglist {
} tags;
};
typedef struct nis_taglist nis_taglist;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_nis_taglist(XDR *, nis_taglist*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_nis_taglist(XDR *, nis_taglist*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_nis_taglist();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct dump_args {
} da_cbhost;
};
typedef struct dump_args dump_args;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_dump_args(XDR *, dump_args*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_dump_args(XDR *, dump_args*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_dump_args();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct fd_args {
nis_name requester;
};
typedef struct fd_args fd_args;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_fd_args(XDR *, fd_args*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_fd_args(XDR *, fd_args*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_fd_args();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct fd_result {
} signature;
};
typedef struct fd_result fd_result;
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" bool_t xdr_fd_result(XDR *, fd_result*);
-#elif __STDC__
+#elif __STDC__
extern bool_t xdr_fd_result(XDR *, fd_result*);
-#else /* Old Style C */
+#else /* Old Style C */
bool_t xdr_fd_result();
-#endif /* Old Style C */
+#endif /* Old Style C */
/*
* Generic "hash" datastructures, used by all types of hashed data.
/*
* nis_3.h
- *
+ *
* This file contains definitions that are only of interest to the actual
* service daemon and client stubs. Normal users of NIS will not include
* this file.
*
- * NOTE : This include file is automatically created by a combination
+ * NOTE : This include file is automatically created by a combination
* of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
* and then remake this file.
*/
#define NIS_PROG ((u_long)100300)
extern struct rpcgen_table nis_prog_3_table[];
-extern nis_prog_3_nproc;
+extern int nis_prog_3_nproc;
#define NIS_VERSION ((u_long)3)
#ifdef __cplusplus
extern nis_error * nis_updkeys_3(nis_name *, CLIENT *);
extern nis_error * nis_updkeys_3_svc(nis_name *, struct svc_req *);
-#else /* Old Style C */
+#else /* Old Style C */
#define NIS_LOOKUP ((u_long)1)
extern nis_result * nis_lookup_3();
extern nis_result * nis_lookup_3_svc();
#define NIS_UPDKEYS ((u_long)24)
extern nis_error * nis_updkeys_3();
extern nis_error * nis_updkeys_3_svc();
-#endif /* Old Style C */
+#endif /* Old Style C */
struct rpcgen_table {
char *(*proc)();
xdrproc_t xdr_arg;