tx.c revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <syslog.h>
#include <strings.h>
#include <ucred.h>
/* lpsched include files */
#if defined PS_FAULTED
#endif /* PS_FAULTED */
#include "lp.h"
/*
* get_labeled_zonename - gets the the zonename with the same label.
*
* Input:
* slabel - USER_CLEAR label to match
*
* Output:
* -1 - zonename with that label could not be found
* or no memory for zonename
* 0 - label was GLOBAL_ZONENAME
* addr - zonename of zone matching USER_CLEAR label
* must be retuened by calling Free(addr)
*
*/
char *
get_labeled_zonename(char *slabel)
{
int err = 0;
/*
* convert the label to binary.
*/
/* label could not be converted, error */
"lpsched: %s: label not recognized (error==%d)",
return ((char *)-1);
}
/* no zone with that label, cannot send mail */
"lpsched: cannot send mail, no zone with %s label",
slabel);
return ((char *)-1);
}
== -1) {
/* cannot get zone name, cannot send mail */
"lpsched: cannot send mail, no zone name for %s",
slabel);
return ((char *)-1);
} else {
}
}
return (zname);
}
int
{
if (is_system_labeled()) {
return (-1);
}
return (-1);
ucred_free(uc);
}
}
return (0);
}