2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A/* printer attributes filters */ 2N/A "(&(objectClass=sunPrinter)(|(printer-name=%s)(printer-aliases=%s)))" 2N/A * Attributes from the following classes: 2N/A * Get all attributes. 2N/A * _nss_ldap_printers2str is the data marshaling method for the printers 2N/A * getXbyY backend processes. This method is called after a successful 2N/A * ldap search has been performed. This method will parse the ldap search 2N/A * values into argp->buf.buffer. Three error conditions are expected and 2N/A * returned to nsswitch. 2N/A * In order to be compatible with old data output, the code is commented out 2N/A * with NSS_LDAP_PRINTERS. The NSS_LDAP_PRINTERS section is for future 2N/A * refrences if it's decided to fix the output format. 2N/A * Pick out the printer name and aliases 2N/A * Add the rest of the attributes 2N/A * The attribute contains key=value 2N/A * Skip some attr names 2N/A "objectclass") == 0 ||
2N/A "printer-uri") == 0 ||
2N/A "printer-aliases") == 0)
2N/A * Translate attr name ->key name 2N/A * The attrname is the key. The attribute 2N/A * data is the value. 2N/A * Add extra for any colons which need to 2N/A * be backslashed plus ending ':' or ','. 2N/A /* count ':' in value */ 2N/A * Attributes which contain colons must be backslashed. 2N/A * getbyname gets printer attributes by printer name. This function 2N/A * constructs an ldap search filter using the printer name invocation 2N/A * parameter and the getprinterbyname search filter defined. Once the 2N/A * filter is constructed, we search for matching entries and marshal 2N/A * the data results into argp->buf.buffer for the frontend process. 2N/A * The function _nss_ldap_printers2str performs the data marshaling. 2N/A * _nss_ldap_printers_constr is where life begins. This function calls 2N/A * the generic ldap constructor function to define and build the abstract 2N/A * data types required to support ldap operations.