Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*


  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 
  27 #include <syslog.h>
  28 #include "ldap_common.h"
  29 
  30 /* netgroup attributes filters */
  31 #define _N_TRIPLE               "nisnetgrouptriple"
  32 #define _N_MEMBER               "membernisnetgroup"
  33 
  34 #define PRINT_VAL(a)            (((a).argc == 0) || ((a).argv == NULL) || \
  35                                     ((a).argv[0] == NULL)) ? "*" : (a).argv[0]
  36 #define ISNULL(a)               (a == NULL ? "<NULL>" : a)
  37 #define MAX_DOMAIN_LEN          1024
  38 #define MAX_TRIPLE_LEN          (MAXHOSTNAMELEN + LOGNAME_MAX + \
  39                                         MAX_DOMAIN_LEN + 5)
  40 
  41 #define _F_SETMEMBER            "(&(objectClass=nisNetGroup)(cn=%s))"
  42 #define _F_SETMEMBER_SSD        "(&(%%s)(cn=%s))"
  43 
  44 #define N_HASH          257
  45 #define COMMA           ','
  46 
  47 static const char *netgrent_attrs[] = {
  48         _N_TRIPLE,
  49         _N_MEMBER,
  50         (char *)NULL
  51 };
  52 
  53 typedef struct netgroup_name {
  54         char *name;
  55         struct netgroup_name *next;
  56         struct netgroup_name *next_hash;
  57 } netgroup_name_t;
  58 




   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2013 Gary Mills
  23  *
  24  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 
  29 #include <syslog.h>
  30 #include "ldap_common.h"
  31 
  32 /* netgroup attributes filters */
  33 #define _N_TRIPLE               "nisnetgrouptriple"
  34 #define _N_MEMBER               "membernisnetgroup"
  35 
  36 #define PRINT_VAL(a)            (((a).argc == 0) || ((a).argv == NULL) || \
  37                                     ((a).argv[0] == NULL)) ? "*" : (a).argv[0]
  38 #define ISNULL(a)               (a == NULL ? "<NULL>" : a)
  39 #define MAX_DOMAIN_LEN          1024
  40 #define MAX_TRIPLE_LEN          (MAXHOSTNAMELEN + LOGNAME_MAX_ILLUMOS + \
  41                                         MAX_DOMAIN_LEN + 5)
  42 
  43 #define _F_SETMEMBER            "(&(objectClass=nisNetGroup)(cn=%s))"
  44 #define _F_SETMEMBER_SSD        "(&(%%s)(cn=%s))"
  45 
  46 #define N_HASH          257
  47 #define COMMA           ','
  48 
  49 static const char *netgrent_attrs[] = {
  50         _N_TRIPLE,
  51         _N_MEMBER,
  52         (char *)NULL
  53 };
  54 
  55 typedef struct netgroup_name {
  56         char *name;
  57         struct netgroup_name *next;
  58         struct netgroup_name *next_hash;
  59 } netgroup_name_t;
  60