libshare_legacy.c revision 2
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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * sa_legacy_fix_share_name 2N/A * some valid SMB share names contain characters illegal in SMF. This 2N/A * function maps to a valid character set. Since it is only used when 2N/A * referencing SMF, it only needs a one way mapping. 2N/A static char hex[] =
"0123456789abcdef";
2N/A * legacy_common_transaction 2N/A * implements both store and remove of SMF property. 2N/A /* The value is in the transaction */ 2N/A /* Value couldn't be constructed */ 2N/A /* The entry is in the transaction or NULL */ 2N/A * Cleanup if there were any errors that didn't leave these 2N/A * values where they would be cleaned up later. 2N/A "error writing share '%s': %s",
2N/A /* While fs_name should be a mountpoint, make sure */ 2N/A /* skip since on other file system */ 2N/A * sa_legacy_get_mntpnt_for_path 2N/A * A path identifies its mount point by its st_dev field in stat. To 2N/A * find the mount point, work backward up the path until the st_dev 2N/A * doesn't match. The last to match was the root (mountpoint). 2N/A /* special case of mount point being the path */ 2N/A * lookup mnttab entry for "/" 2N/A * There isn't a way to mark a legacy file system as 2N/A * shareable. Assume ALL. 2N/A * sa_legacy_mntpnt_is_zoned 2N/A * always return negative 2N/A * since sa_legacy_cleanup_mounts() sets legacy_mounts to NULL 2N/A * when cleaning so we use that to force a reload of the mount