MFC
This commit is contained in:
commit
d692a159e6
@ -15,6 +15,7 @@
|
||||
# -DNO_WWWUPDATE do not update www in ${MAKE} update
|
||||
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
|
||||
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
||||
# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
|
||||
# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
|
||||
# list
|
||||
# TARGET="machine" to crossbuild world for a different machine type
|
||||
@ -88,7 +89,7 @@ SUBDIR+=etc
|
||||
|
||||
# These are last, since it is nice to at least get the base system
|
||||
# rebuilt before you do them.
|
||||
.for _DIR in ${LOCAL_DIRS}
|
||||
.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS}
|
||||
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
||||
SUBDIR+= ${_DIR}
|
||||
.endif
|
||||
@ -1273,6 +1274,11 @@ _ofed_lib= contrib/ofed/usr.lib/
|
||||
.endif
|
||||
|
||||
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
|
||||
.for _DIR in ${LOCAL_LIB_DIRS}
|
||||
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
||||
_generic_libs+= ${_DIR}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
||||
|
||||
|
@ -38,8 +38,13 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20120613: auth.conf removed
|
||||
OLD_FILES+=etc/auth.conf
|
||||
OLD_FILES+=usr/share/examples/etc/auth.conf
|
||||
OLD_FILES+=usr/share/man/man3/auth.3.gz
|
||||
OLD_FILES+=usr/share/man/man5/auth.conf.5.gz
|
||||
# 20120530: kde pam lives now in ports
|
||||
OLD_FILES+=/etc/pam.d/kde
|
||||
OLD_FILES+=etc/pam.d/kde
|
||||
# 20120505: new clang import installed a redundant internal header
|
||||
OLD_FILES+=usr/include/clang/3.1/stdalign.h
|
||||
# 20120428: MD2 removed from libmd
|
||||
|
11
UPDATING
11
UPDATING
@ -24,6 +24,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20120611:
|
||||
A new version of ZFS (pool version 5000) has been merged to -HEAD.
|
||||
Starting with this version the old system of ZFS pool versioning
|
||||
is superseded by "feature flags". This concept enables forward
|
||||
compatibility against certain future changes in functionality of ZFS
|
||||
pools. The first read-only compatible "feature flag" for ZFS pools
|
||||
is named "com.delphix:async_destroy". For more information
|
||||
read the new zpool-features(5) manual page.
|
||||
Please refer to the "ZFS notes" section of this file for information
|
||||
on upgrading boot ZFS pools.
|
||||
|
||||
20120417:
|
||||
The malloc(3) implementation embedded in libc now uses sources imported
|
||||
as contrib/jemalloc. The most disruptive API change is to
|
||||
|
@ -116,17 +116,11 @@ The
|
||||
.Nm
|
||||
utility handles third party copies, where neither source nor target files
|
||||
are on the current machine.
|
||||
.Sh FILES
|
||||
.Bl -tag -width ".Pa /etc/auth.conf" -compact
|
||||
.It Pa /etc/auth.conf
|
||||
configure authentication services
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr cp 1 ,
|
||||
.Xr ftp 1 ,
|
||||
.Xr rlogin 1 ,
|
||||
.Xr rsh 1 ,
|
||||
.Xr auth.conf 5 ,
|
||||
.Xr hosts.equiv 5
|
||||
.Sh HISTORY
|
||||
The
|
||||
|
@ -18,8 +18,10 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -54,6 +56,7 @@
|
||||
#include <sys/zfs_fuid.h>
|
||||
#include <sys/arc.h>
|
||||
#include <sys/ddt.h>
|
||||
#include <sys/zfeature.h>
|
||||
#undef ZFS_MAXNAMELEN
|
||||
#undef verify
|
||||
#include <libzfs.h>
|
||||
@ -63,7 +66,8 @@
|
||||
#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \
|
||||
zio_checksum_table[(idx)].ci_name : "UNKNOWN")
|
||||
#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \
|
||||
dmu_ot[(idx)].ot_name : "UNKNOWN")
|
||||
dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \
|
||||
dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN")
|
||||
#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES)
|
||||
|
||||
#ifndef lint
|
||||
@ -1088,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
|
||||
ASSERT(size == sizeof (*ds));
|
||||
crtime = ds->ds_creation_time;
|
||||
zdb_nicenum(ds->ds_used_bytes, used);
|
||||
zdb_nicenum(ds->ds_referenced_bytes, used);
|
||||
zdb_nicenum(ds->ds_compressed_bytes, compressed);
|
||||
zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed);
|
||||
zdb_nicenum(ds->ds_unique_bytes, unique);
|
||||
@ -1130,6 +1134,44 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
(void) printf("\t\tbp = %s\n", blkbuf);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
|
||||
{
|
||||
char blkbuf[BP_SPRINTF_LEN];
|
||||
|
||||
if (bp->blk_birth != 0) {
|
||||
sprintf_blkptr(blkbuf, bp);
|
||||
(void) printf("\t%s\n", blkbuf);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_bptree(objset_t *os, uint64_t obj, char *name)
|
||||
{
|
||||
char bytes[32];
|
||||
bptree_phys_t *bt;
|
||||
dmu_buf_t *db;
|
||||
|
||||
if (dump_opt['d'] < 3)
|
||||
return;
|
||||
|
||||
VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
|
||||
bt = db->db_data;
|
||||
zdb_nicenum(bt->bt_bytes, bytes);
|
||||
(void) printf("\n %s: %llu datasets, %s\n",
|
||||
name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes);
|
||||
dmu_buf_rele(db, FTAG);
|
||||
|
||||
if (dump_opt['d'] < 5)
|
||||
return;
|
||||
|
||||
(void) printf("\n");
|
||||
|
||||
(void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
|
||||
@ -1883,11 +1925,13 @@ typedef struct zdb_blkstats {
|
||||
*/
|
||||
#define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0)
|
||||
#define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1)
|
||||
#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2)
|
||||
#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2)
|
||||
#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3)
|
||||
|
||||
static char *zdb_ot_extname[] = {
|
||||
"deferred free",
|
||||
"dedup ditto",
|
||||
"other",
|
||||
"Total",
|
||||
};
|
||||
|
||||
@ -1968,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
||||
|
||||
type = BP_GET_TYPE(bp);
|
||||
|
||||
zdb_count_block(zcb, zilog, bp, type);
|
||||
zdb_count_block(zcb, zilog, bp,
|
||||
(type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type);
|
||||
|
||||
is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata);
|
||||
is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type));
|
||||
|
||||
if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) {
|
||||
int ioerr;
|
||||
@ -2197,6 +2242,12 @@ dump_block_stats(spa_t *spa)
|
||||
(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
|
||||
count_block_cb, &zcb, NULL);
|
||||
}
|
||||
if (spa_feature_is_active(spa,
|
||||
&spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
|
||||
VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset,
|
||||
spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb,
|
||||
&zcb, NULL));
|
||||
}
|
||||
|
||||
if (dump_opt['c'] > 1)
|
||||
flags |= TRAVERSE_PREFETCH_DATA;
|
||||
@ -2373,7 +2424,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||
}
|
||||
|
||||
if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF ||
|
||||
BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata)
|
||||
BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp)))
|
||||
return (0);
|
||||
|
||||
ddt_key_fill(&zdde_search.zdde_key, bp);
|
||||
@ -2478,7 +2529,14 @@ dump_zpool(spa_t *spa)
|
||||
dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees");
|
||||
if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
|
||||
dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj,
|
||||
"Pool frees");
|
||||
"Pool snapshot frees");
|
||||
}
|
||||
|
||||
if (spa_feature_is_active(spa,
|
||||
&spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
|
||||
dump_bptree(spa->spa_meta_objset,
|
||||
spa->spa_dsl_pool->dp_bptree_obj,
|
||||
"Pool dataset frees");
|
||||
}
|
||||
dump_dtl(spa->spa_root_vdev, 0);
|
||||
}
|
||||
|
533
cddl/contrib/opensolaris/cmd/zhack/zhack.c
Normal file
533
cddl/contrib/opensolaris/cmd/zhack/zhack.c
Normal file
@ -0,0 +1,533 @@
|
||||
/*
|
||||
* 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
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* 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 (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* zhack is a debugging tool that can write changes to ZFS pool using libzpool
|
||||
* for testing purposes. Altering pools with zhack is unsupported and may
|
||||
* result in corrupted pools.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/zfs_context.h>
|
||||
#include <sys/spa.h>
|
||||
#include <sys/spa_impl.h>
|
||||
#include <sys/dmu.h>
|
||||
#include <sys/zap.h>
|
||||
#include <sys/zfs_znode.h>
|
||||
#include <sys/dsl_synctask.h>
|
||||
#include <sys/vdev.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
#include <sys/dmu_objset.h>
|
||||
#include <sys/dsl_pool.h>
|
||||
#include <sys/zio_checksum.h>
|
||||
#include <sys/zio_compress.h>
|
||||
#include <sys/zfeature.h>
|
||||
#undef ZFS_MAXNAMELEN
|
||||
#undef verify
|
||||
#include <libzfs.h>
|
||||
|
||||
extern boolean_t zfeature_checks_disable;
|
||||
|
||||
const char cmdname[] = "zhack";
|
||||
libzfs_handle_t *g_zfs;
|
||||
static importargs_t g_importargs;
|
||||
static char *g_pool;
|
||||
static boolean_t g_readonly;
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
(void) fprintf(stderr,
|
||||
"Usage: %s [-c cachefile] [-d dir] <subcommand> <args> ...\n"
|
||||
"where <subcommand> <args> is one of the following:\n"
|
||||
"\n", cmdname);
|
||||
|
||||
(void) fprintf(stderr,
|
||||
" feature stat <pool>\n"
|
||||
" print information about enabled features\n"
|
||||
" feature enable [-d desc] <pool> <feature>\n"
|
||||
" add a new enabled feature to the pool\n"
|
||||
" -d <desc> sets the feature's description\n"
|
||||
" feature ref [-md] <pool> <feature>\n"
|
||||
" change the refcount on the given feature\n"
|
||||
" -d decrease instead of increase the refcount\n"
|
||||
" -m add the feature to the label if increasing refcount\n"
|
||||
"\n"
|
||||
" <feature> : should be a feature guid\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
fatal(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
(void) fprintf(stderr, "%s: ", cmdname);
|
||||
(void) vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
(void) fprintf(stderr, "\n");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
space_delta_cb(dmu_object_type_t bonustype, void *data,
|
||||
uint64_t *userp, uint64_t *groupp)
|
||||
{
|
||||
/*
|
||||
* Is it a valid type of object to track?
|
||||
*/
|
||||
if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
|
||||
return (ENOENT);
|
||||
(void) fprintf(stderr, "modifying object that needs user accounting");
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/*
|
||||
* Target is the dataset whose pool we want to open.
|
||||
*/
|
||||
static void
|
||||
import_pool(const char *target, boolean_t readonly)
|
||||
{
|
||||
nvlist_t *config;
|
||||
nvlist_t *pools;
|
||||
int error;
|
||||
char *sepp;
|
||||
spa_t *spa;
|
||||
nvpair_t *elem;
|
||||
nvlist_t *props;
|
||||
const char *name;
|
||||
|
||||
kernel_init(readonly ? FREAD : (FREAD | FWRITE));
|
||||
g_zfs = libzfs_init();
|
||||
ASSERT(g_zfs != NULL);
|
||||
|
||||
dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb);
|
||||
|
||||
g_readonly = readonly;
|
||||
|
||||
/*
|
||||
* If we only want readonly access, it's OK if we find
|
||||
* a potentially-active (ie, imported into the kernel) pool from the
|
||||
* default cachefile.
|
||||
*/
|
||||
if (readonly && spa_open(target, &spa, FTAG) == 0) {
|
||||
spa_close(spa, FTAG);
|
||||
return;
|
||||
}
|
||||
|
||||
g_importargs.unique = B_TRUE;
|
||||
g_importargs.can_be_active = readonly;
|
||||
g_pool = strdup(target);
|
||||
if ((sepp = strpbrk(g_pool, "/@")) != NULL)
|
||||
*sepp = '\0';
|
||||
g_importargs.poolname = g_pool;
|
||||
pools = zpool_search_import(g_zfs, &g_importargs);
|
||||
|
||||
if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) {
|
||||
if (!g_importargs.can_be_active) {
|
||||
g_importargs.can_be_active = B_TRUE;
|
||||
if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
|
||||
spa_open(target, &spa, FTAG) == 0) {
|
||||
fatal("cannot import '%s': pool is active; run "
|
||||
"\"zpool export %s\" first\n",
|
||||
g_pool, g_pool);
|
||||
}
|
||||
}
|
||||
|
||||
fatal("cannot import '%s': no such pool available\n", g_pool);
|
||||
}
|
||||
|
||||
elem = nvlist_next_nvpair(pools, NULL);
|
||||
name = nvpair_name(elem);
|
||||
verify(nvpair_value_nvlist(elem, &config) == 0);
|
||||
|
||||
props = NULL;
|
||||
if (readonly) {
|
||||
verify(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
|
||||
verify(nvlist_add_uint64(props,
|
||||
zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
|
||||
}
|
||||
|
||||
zfeature_checks_disable = B_TRUE;
|
||||
error = spa_import(name, config, props, ZFS_IMPORT_NORMAL);
|
||||
zfeature_checks_disable = B_FALSE;
|
||||
if (error == EEXIST)
|
||||
error = 0;
|
||||
|
||||
if (error)
|
||||
fatal("can't import '%s': %s", name, strerror(error));
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa)
|
||||
{
|
||||
int err;
|
||||
|
||||
import_pool(target, readonly);
|
||||
|
||||
zfeature_checks_disable = B_TRUE;
|
||||
err = spa_open(target, spa, tag);
|
||||
zfeature_checks_disable = B_FALSE;
|
||||
|
||||
if (err != 0)
|
||||
fatal("cannot open '%s': %s", target, strerror(err));
|
||||
if (spa_version(*spa) < SPA_VERSION_FEATURES) {
|
||||
fatal("'%s' has version %d, features not enabled", target,
|
||||
(int)spa_version(*spa));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_obj(objset_t *os, uint64_t obj, const char *name)
|
||||
{
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t za;
|
||||
|
||||
(void) printf("%s_obj:\n", name);
|
||||
|
||||
for (zap_cursor_init(&zc, os, obj);
|
||||
zap_cursor_retrieve(&zc, &za) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
if (za.za_integer_length == 8) {
|
||||
ASSERT(za.za_num_integers == 1);
|
||||
(void) printf("\t%s = %llu\n",
|
||||
za.za_name, (u_longlong_t)za.za_first_integer);
|
||||
} else {
|
||||
ASSERT(za.za_integer_length == 1);
|
||||
char val[1024];
|
||||
VERIFY(zap_lookup(os, obj, za.za_name,
|
||||
1, sizeof (val), val) == 0);
|
||||
(void) printf("\t%s = %s\n", za.za_name, val);
|
||||
}
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_mos(spa_t *spa)
|
||||
{
|
||||
nvlist_t *nv = spa->spa_label_features;
|
||||
|
||||
(void) printf("label config:\n");
|
||||
for (nvpair_t *pair = nvlist_next_nvpair(nv, NULL);
|
||||
pair != NULL;
|
||||
pair = nvlist_next_nvpair(nv, pair)) {
|
||||
(void) printf("\t%s\n", nvpair_name(pair));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_do_feature_stat(int argc, char **argv)
|
||||
{
|
||||
spa_t *spa;
|
||||
objset_t *os;
|
||||
char *target;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
if (argc < 1) {
|
||||
(void) fprintf(stderr, "error: missing pool name\n");
|
||||
usage();
|
||||
}
|
||||
target = argv[0];
|
||||
|
||||
zhack_spa_open(target, B_TRUE, FTAG, &spa);
|
||||
os = spa->spa_meta_objset;
|
||||
|
||||
dump_obj(os, spa->spa_feat_for_read_obj, "for_read");
|
||||
dump_obj(os, spa->spa_feat_for_write_obj, "for_write");
|
||||
dump_obj(os, spa->spa_feat_desc_obj, "descriptions");
|
||||
dump_mos(spa);
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
}
|
||||
|
||||
static void
|
||||
feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
spa_feature_enable(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_do_feature_enable(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
char *desc, *target;
|
||||
spa_t *spa;
|
||||
objset_t *mos;
|
||||
zfeature_info_t feature;
|
||||
zfeature_info_t *nodeps[] = { NULL };
|
||||
|
||||
/*
|
||||
* Features are not added to the pool's label until their refcounts
|
||||
* are incremented, so fi_mos can just be left as false for now.
|
||||
*/
|
||||
desc = NULL;
|
||||
feature.fi_uname = "zhack";
|
||||
feature.fi_mos = B_FALSE;
|
||||
feature.fi_can_readonly = B_FALSE;
|
||||
feature.fi_depends = nodeps;
|
||||
|
||||
optind = 1;
|
||||
while ((c = getopt(argc, argv, "rmd:")) != -1) {
|
||||
switch (c) {
|
||||
case 'r':
|
||||
feature.fi_can_readonly = B_TRUE;
|
||||
break;
|
||||
case 'd':
|
||||
desc = strdup(optarg);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc == NULL)
|
||||
desc = strdup("zhack injected");
|
||||
feature.fi_desc = desc;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc < 2) {
|
||||
(void) fprintf(stderr, "error: missing feature or pool name\n");
|
||||
usage();
|
||||
}
|
||||
target = argv[0];
|
||||
feature.fi_guid = argv[1];
|
||||
|
||||
if (!zfeature_is_valid_guid(feature.fi_guid))
|
||||
fatal("invalid feature guid: %s", feature.fi_guid);
|
||||
|
||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||
mos = spa->spa_meta_objset;
|
||||
|
||||
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
|
||||
fatal("'%s' is a real feature, will not enable");
|
||||
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
|
||||
fatal("feature already enabled: %s", feature.fi_guid);
|
||||
|
||||
VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
|
||||
feature_enable_sync, spa, &feature, 5));
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
|
||||
free(desc);
|
||||
}
|
||||
|
||||
static void
|
||||
feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
spa_feature_incr(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||
{
|
||||
spa_t *spa = arg1;
|
||||
zfeature_info_t *feature = arg2;
|
||||
|
||||
spa_feature_decr(spa, feature, tx);
|
||||
}
|
||||
|
||||
static void
|
||||
zhack_do_feature_ref(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
char *target;
|
||||
boolean_t decr = B_FALSE;
|
||||
spa_t *spa;
|
||||
objset_t *mos;
|
||||
zfeature_info_t feature;
|
||||
zfeature_info_t *nodeps[] = { NULL };
|
||||
|
||||
/*
|
||||
* fi_desc does not matter here because it was written to disk
|
||||
* when the feature was enabled, but we need to properly set the
|
||||
* feature for read or write based on the information we read off
|
||||
* disk later.
|
||||
*/
|
||||
feature.fi_uname = "zhack";
|
||||
feature.fi_mos = B_FALSE;
|
||||
feature.fi_desc = NULL;
|
||||
feature.fi_depends = nodeps;
|
||||
|
||||
optind = 1;
|
||||
while ((c = getopt(argc, argv, "md")) != -1) {
|
||||
switch (c) {
|
||||
case 'm':
|
||||
feature.fi_mos = B_TRUE;
|
||||
break;
|
||||
case 'd':
|
||||
decr = B_TRUE;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc < 2) {
|
||||
(void) fprintf(stderr, "error: missing feature or pool name\n");
|
||||
usage();
|
||||
}
|
||||
target = argv[0];
|
||||
feature.fi_guid = argv[1];
|
||||
|
||||
if (!zfeature_is_valid_guid(feature.fi_guid))
|
||||
fatal("invalid feature guid: %s", feature.fi_guid);
|
||||
|
||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||
mos = spa->spa_meta_objset;
|
||||
|
||||
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
|
||||
fatal("'%s' is a real feature, will not change refcount");
|
||||
|
||||
if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
|
||||
feature.fi_guid)) {
|
||||
feature.fi_can_readonly = B_FALSE;
|
||||
} else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj,
|
||||
feature.fi_guid)) {
|
||||
feature.fi_can_readonly = B_TRUE;
|
||||
} else {
|
||||
fatal("feature is not enabled: %s", feature.fi_guid);
|
||||
}
|
||||
|
||||
if (decr && !spa_feature_is_active(spa, &feature))
|
||||
fatal("feature refcount already 0: %s", feature.fi_guid);
|
||||
|
||||
VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
|
||||
decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
}
|
||||
|
||||
static int
|
||||
zhack_do_feature(int argc, char **argv)
|
||||
{
|
||||
char *subcommand;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
if (argc == 0) {
|
||||
(void) fprintf(stderr,
|
||||
"error: no feature operation specified\n");
|
||||
usage();
|
||||
}
|
||||
|
||||
subcommand = argv[0];
|
||||
if (strcmp(subcommand, "stat") == 0) {
|
||||
zhack_do_feature_stat(argc, argv);
|
||||
} else if (strcmp(subcommand, "enable") == 0) {
|
||||
zhack_do_feature_enable(argc, argv);
|
||||
} else if (strcmp(subcommand, "ref") == 0) {
|
||||
zhack_do_feature_ref(argc, argv);
|
||||
} else {
|
||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||
subcommand);
|
||||
usage();
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define MAX_NUM_PATHS 1024
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
extern void zfs_prop_init(void);
|
||||
|
||||
char *path[MAX_NUM_PATHS];
|
||||
const char *subcommand;
|
||||
int rv = 0;
|
||||
char c;
|
||||
|
||||
g_importargs.path = path;
|
||||
|
||||
dprintf_setup(&argc, argv);
|
||||
zfs_prop_init();
|
||||
|
||||
while ((c = getopt(argc, argv, "c:d:")) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
g_importargs.cachefile = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
assert(g_importargs.paths < MAX_NUM_PATHS);
|
||||
g_importargs.path[g_importargs.paths++] = optarg;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
optind = 1;
|
||||
|
||||
if (argc == 0) {
|
||||
(void) fprintf(stderr, "error: no command specified\n");
|
||||
usage();
|
||||
}
|
||||
|
||||
subcommand = argv[0];
|
||||
|
||||
if (strcmp(subcommand, "feature") == 0) {
|
||||
rv = zhack_do_feature(argc, argv);
|
||||
} else {
|
||||
(void) fprintf(stderr, "error: unknown subcommand: %s\n",
|
||||
subcommand);
|
||||
usage();
|
||||
}
|
||||
|
||||
if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) {
|
||||
fatal("pool export failed; "
|
||||
"changes may not be committed to disk\n");
|
||||
}
|
||||
|
||||
libzfs_fini(g_zfs);
|
||||
kernel_fini();
|
||||
|
||||
return (rv);
|
||||
}
|
174
cddl/contrib/opensolaris/cmd/zpool/zpool-features.5
Normal file
174
cddl/contrib/opensolaris/cmd/zpool/zpool-features.5
Normal file
@ -0,0 +1,174 @@
|
||||
'\" te
|
||||
.\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
|
||||
.\" All Rights Reserved.
|
||||
.\"
|
||||
.\" 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
|
||||
.\" or http://www.opensolaris.org/os/licensing.
|
||||
.\" 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]
|
||||
.\"
|
||||
.\" Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 28, 2012
|
||||
.Dt ZPOOL-FEATURES 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm zpool-features
|
||||
.Nd ZFS pool feature descriptions
|
||||
.Sh DESCRIPTION
|
||||
ZFS pool on\-disk format versions are specified via "features" which replace
|
||||
the old on\-disk format numbers (the last supported on\-disk format number is
|
||||
28).
|
||||
To enable a feature on a pool use the
|
||||
.Xr zpool 8
|
||||
command to set the
|
||||
.Sy feature@feature_name
|
||||
property to
|
||||
.Ar enabled .
|
||||
.Pp
|
||||
The pool format does not affect file system version compatibility or the ability
|
||||
to send file systems between pools.
|
||||
.Pp
|
||||
Since most features can be enabled independently of each other the on\-disk
|
||||
format of the pool is specified by the set of all features marked as
|
||||
.Sy active
|
||||
on the pool. If the pool was created by another software version this set may
|
||||
include unsupported features.
|
||||
.Ss Identifying features
|
||||
Every feature has a guid of the form
|
||||
.Sy com.example:feature_name .
|
||||
The reverse DNS name ensures that the feature's guid is unique across all ZFS
|
||||
implementations. When unsupported features are encountered on a pool they will
|
||||
be identified by their guids.
|
||||
Refer to the documentation for the ZFS implementation that created the pool
|
||||
for information about those features.
|
||||
.Pp
|
||||
Each supported feature also has a short name.
|
||||
By convention a feature's short name is the portion of its guid which follows
|
||||
the ':' (e.g.
|
||||
.Sy com.example:feature_name
|
||||
would have the short name
|
||||
.Sy feature_name ),
|
||||
however a feature's short name may differ across ZFS implementations if
|
||||
following the convention would result in name conflicts.
|
||||
.Ss Feature states
|
||||
Features can be in one of three states:
|
||||
.Bl -tag
|
||||
.It Sy active
|
||||
This feature's on\-disk format changes are in effect on the pool.
|
||||
Support for this feature is required to import the pool in read\-write mode.
|
||||
If this feature is not read-only compatible, support is also required to
|
||||
import the pool in read\-only mode (see "Read\-only compatibility").
|
||||
.It Sy enabled
|
||||
An administrator has marked this feature as enabled on the pool, but the
|
||||
feature's on\-disk format changes have not been made yet.
|
||||
The pool can still be imported by software that does not support this feature,
|
||||
but changes may be made to the on\-disk format at any time which will move
|
||||
the feature to the
|
||||
.Sy active
|
||||
state.
|
||||
Some features may support returning to the
|
||||
.Sy enabled
|
||||
state after becoming
|
||||
.Sy active .
|
||||
See feature\-specific documentation for details.
|
||||
.It Sy disabled
|
||||
This feature's on\-disk format changes have not been made and will not be made
|
||||
unless an administrator moves the feature to the
|
||||
.Sy enabled
|
||||
state.
|
||||
Features cannot be disabled once they have been enabled.
|
||||
.El
|
||||
The state of supported features is exposed through pool properties of the form
|
||||
.Sy feature@short_name .
|
||||
.Ss Read\-only compatibility
|
||||
Some features may make on\-disk format changes that do not interfere with other
|
||||
software's ability to read from the pool.
|
||||
These features are referred to as "read\-only compatible".
|
||||
If all unsupported features on a pool are read\-only compatible, the pool can
|
||||
be imported in read\-only mode by setting the
|
||||
.Sy readonly
|
||||
property during import (see
|
||||
.Xr zpool 8
|
||||
for details on importing pools).
|
||||
.Ss Unsupported features
|
||||
For each unsupported feature enabled on an imported pool a pool property
|
||||
named
|
||||
.Sy unsupported@feature_guid
|
||||
will indicate why the import was allowed despite the unsupported feature.
|
||||
Possible values for this property are:
|
||||
.Bl -tag
|
||||
.It Sy inactive
|
||||
The feature is in the
|
||||
.Sy enabled
|
||||
state and therefore the pool's on\-disk format is still compatible with
|
||||
software that does not support this feature.
|
||||
.It Sy readonly
|
||||
The feature is read\-only compatible and the pool has been imported in
|
||||
read\-only mode.
|
||||
.El
|
||||
.Ss Feature dependencies
|
||||
Some features depend on other features being enabled in order to function
|
||||
properly.
|
||||
Enabling a feature will automatically enable any features it depends on.
|
||||
.Sh FEATURES
|
||||
The following features are supported on this system:
|
||||
.Bl -tag
|
||||
.It Sy async_destroy
|
||||
.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:async_destroy"
|
||||
.It GUID Ta com.delphix:async_destroy
|
||||
.It READ\-ONLY COMPATIBLE Ta yes
|
||||
.It DEPENDENCIES Ta none
|
||||
.El
|
||||
.Pp
|
||||
Destroying a file system requires traversing all of its data in order to
|
||||
return its used space to the pool.
|
||||
Without
|
||||
.Sy async_destroy
|
||||
the file system is not fully removed until all space has been reclaimed.
|
||||
If the destroy operation is interrupted by a reboot or power outage the next
|
||||
attempt to open the pool will need to complete the destroy operation
|
||||
synchronously.
|
||||
.Pp
|
||||
When
|
||||
.Sy async_destroy
|
||||
is enabled the file system's data will be reclaimed by a background process,
|
||||
allowing the destroy operation to complete without traversing the entire file
|
||||
system.
|
||||
The background process is able to resume interrupted destroys after the pool
|
||||
has been opened, eliminating the need to finish interrupted destroys as part
|
||||
of the open operation.
|
||||
The amount of space remaining to be reclaimed by the background process is
|
||||
available through the
|
||||
.Sy freeing
|
||||
property.
|
||||
.Sh SEE ALSO
|
||||
.Xr zpool 8
|
||||
.Sh AUTHORS
|
||||
This manual page is a
|
||||
.Xr mdoc 7
|
||||
reimplementation of the
|
||||
.Tn illumos
|
||||
manual page
|
||||
.Em zpool-features(5) ,
|
||||
modified and customized for
|
||||
.Fx
|
||||
and licensed under the Common Development and Distribution License
|
||||
.Pq Tn CDDL .
|
||||
.Pp
|
||||
The
|
||||
.Xr mdoc 7
|
||||
implementation of this manual page was initially written by
|
||||
.An Martin Matuska Aq mm@FreeBSD.org .
|
@ -1,5 +1,5 @@
|
||||
'\" te
|
||||
.\" Copyright (c) 2011, Martin Matuska <mm@FreeBSD.org>.
|
||||
.\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
|
||||
.\" All Rights Reserved.
|
||||
.\"
|
||||
.\" The contents of this file are subject to the terms of the
|
||||
@ -20,6 +20,7 @@
|
||||
.\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
|
||||
.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
|
||||
.\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
|
||||
.\" Copyright (c) 2012 by Delphix. All Rights Reserved.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
@ -47,7 +48,7 @@
|
||||
.Op Ar device
|
||||
.Nm
|
||||
.Cm create
|
||||
.Op Fl fn
|
||||
.Op Fl fnd
|
||||
.Op Fl o Ar property Ns = Ns Ar value
|
||||
.Ar ...
|
||||
.Op Fl O Ar file-system-property Ns = Ns Ar value
|
||||
@ -189,7 +190,7 @@ for information on managing datasets.
|
||||
A
|
||||
.Qq virtual device
|
||||
.Pq No vdev
|
||||
describes a single device or a collection of devices organized according to
|
||||
describes a single device or a collection of devices organized according to
|
||||
certain performance and fault characteristics. The following virtual devices
|
||||
are supported:
|
||||
.Bl -tag
|
||||
@ -237,7 +238,7 @@ A
|
||||
group can have single-, double- , or triple parity, meaning that the
|
||||
.No raidz
|
||||
group can sustain one, two, or three failures, respectively, without
|
||||
losing any data. The
|
||||
losing any data. The
|
||||
.Sy raidz1 No vdev
|
||||
type specifies a single-parity
|
||||
.No raidz
|
||||
@ -287,7 +288,7 @@ writes are load-balanced between devices. Log devices can be mirrored. However,
|
||||
.No raidz
|
||||
.No vdev
|
||||
types are not supported for the intent log. For more information,
|
||||
see the
|
||||
see the
|
||||
.Qq Sx Intent Log
|
||||
section.
|
||||
.It Sy cache
|
||||
@ -309,13 +310,13 @@ A pool can have any number of virtual devices at the top of the configuration
|
||||
(known as
|
||||
.Qq root
|
||||
.No vdev Ns s).
|
||||
Data is dynamically distributed across all top-level devices to balance data
|
||||
Data is dynamically distributed across all top-level devices to balance data
|
||||
among devices. As new virtual devices are added,
|
||||
.Tn ZFS
|
||||
automatically places data on the newly available devices.
|
||||
.Pp
|
||||
Virtual devices are specified one at a time on the command line, separated by
|
||||
whitespace. The keywords
|
||||
whitespace. The keywords
|
||||
.Qq mirror
|
||||
and
|
||||
.Qq raidz
|
||||
@ -428,7 +429,7 @@ allows devices to be associated with pools as
|
||||
.Qq hot spares .
|
||||
These devices are not actively used in the pool, but when an active device
|
||||
fails, it is automatically replaced by a hot spare. To create a pool with hot
|
||||
spares, specify a
|
||||
spares, specify a
|
||||
.Qq spare
|
||||
.No vdev
|
||||
with any number of devices. For example,
|
||||
@ -458,7 +459,7 @@ pools.
|
||||
.Pp
|
||||
Spares cannot replace log devices.
|
||||
.Ss Intent Log
|
||||
The
|
||||
The
|
||||
.Tn ZFS
|
||||
Intent Log
|
||||
.Pq Tn ZIL
|
||||
@ -537,6 +538,16 @@ value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of d
|
||||
for a description of the deduplication feature.
|
||||
.It Sy free
|
||||
Number of blocks within the pool that are not allocated.
|
||||
.It Sy freeing
|
||||
After a file system or snapshot is destroyed, the space it was using is
|
||||
returned to the pool asynchronously.
|
||||
.Sy freeing
|
||||
is the amount of space remaining to be reclaimed.
|
||||
Over time
|
||||
.Sy freeing
|
||||
will decrease while
|
||||
.Sy free
|
||||
increases.
|
||||
.It Sy expandsize
|
||||
This property has currently no value on FreeBSD.
|
||||
.It Sy guid
|
||||
@ -552,11 +563,16 @@ or
|
||||
.Qq Sy UNAVAIL .
|
||||
.It Sy size
|
||||
Total size of the storage pool.
|
||||
.It Sy unsupported@ Ns Ar feature_guid
|
||||
Information about unsupported features that are enabled on the pool.
|
||||
See
|
||||
.Xr zpool-features 5
|
||||
for details.
|
||||
.It Sy used
|
||||
Amount of storage space used within the pool.
|
||||
.El
|
||||
.Pp
|
||||
These space usage properties report actual physical space available to the
|
||||
The space usage properties report actual physical space available to the
|
||||
storage pool. The physical space can be different from the total amount of
|
||||
space that any contained datasets can actually use. The amount of space used in
|
||||
a
|
||||
@ -582,7 +598,7 @@ the typical paths are not valid.
|
||||
.Sy altroot
|
||||
is not a persistent property. It is valid only while the system is up.
|
||||
Setting
|
||||
.Sy altroot
|
||||
.Sy altroot
|
||||
defaults to using
|
||||
.Cm cachefile=none ,
|
||||
though this may be overridden using an explicit setting.
|
||||
@ -627,9 +643,9 @@ This property can also be referred to by its shortened column name,
|
||||
.It Sy autoreplace Ns = Ns Cm on No | Cm off
|
||||
Controls automatic device replacement. If set to
|
||||
.Qq Cm off ,
|
||||
device replacement must be initiated by the administrator by using the
|
||||
device replacement must be initiated by the administrator by using the
|
||||
.Qq Nm Cm replace
|
||||
command. If set to
|
||||
command. If set to
|
||||
.Qq Cm on ,
|
||||
any new device, found in the same
|
||||
physical location as a device that previously belonged to the pool, is
|
||||
@ -650,13 +666,18 @@ pool configuration in a different location that can later be imported with
|
||||
.Qq Nm Cm import Fl c .
|
||||
Setting it to the special value
|
||||
.Qq Cm none
|
||||
creates a temporary pool that is never cached, and the special value
|
||||
creates a temporary pool that is never cached, and the special value
|
||||
.Cm ''
|
||||
(empty string) uses the default location.
|
||||
.It Sy comment Ns = Ns Ar text
|
||||
A text string consisting of printable ASCII characters that will be stored
|
||||
such that it is available even if the pool becomes faulted.
|
||||
An administrator can provide additional information about a pool using this
|
||||
property.
|
||||
.It Sy dedupditto Ns = Ns Ar number
|
||||
Threshold for the number of block ditto copies. If the reference count for a
|
||||
deduplicated block increases above this number, a new ditto copy of this block
|
||||
is automatically stored. Deafult setting is
|
||||
is automatically stored. Default setting is
|
||||
.Cm 0 .
|
||||
.It Sy delegation Ns = Ns Cm on No | Cm off
|
||||
Controls whether a non-privileged user is granted access based on the dataset
|
||||
@ -686,6 +707,17 @@ requests that have yet to be committed to disk would be blocked.
|
||||
.It Sy panic
|
||||
Prints out a message to the console and generates a system crash dump.
|
||||
.El
|
||||
.It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled
|
||||
The value of this property is the current state of
|
||||
.Ar feature_name .
|
||||
The only valid value when setting this property is
|
||||
.Sy enabled
|
||||
which moves
|
||||
.Ar feature_name
|
||||
to the enabled state.
|
||||
See
|
||||
.Xr zpool-features 5
|
||||
for details on feature states.
|
||||
.It Sy listsnaps Ns = Ns Cm on No | Cm off
|
||||
Controls whether information about snapshots associated with this pool is
|
||||
output when
|
||||
@ -699,9 +731,9 @@ The current on-disk version of the pool. This can be increased, but never
|
||||
decreased. The preferred method of updating pools is with the
|
||||
.Qq Nm Cm upgrade
|
||||
command, though this property can be used when a specific version is needed
|
||||
for backwards compatibility. This property can be any number between 1 and the
|
||||
current version reported by
|
||||
.Qo Ic zpool upgrade -v Qc .
|
||||
for backwards compatibility.
|
||||
Once feature flags is enabled on a pool this property will no longer have a
|
||||
value.
|
||||
.El
|
||||
.Sh SUBCOMMANDS
|
||||
All subcommands that modify state are logged persistently to the pool in their
|
||||
@ -810,7 +842,7 @@ do not actually discard any transactions.
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm create
|
||||
.Op Fl fn
|
||||
.Op Fl fnd
|
||||
.Op Fl o Ar property Ns = Ns Ar value
|
||||
.Ar ...
|
||||
.Op Fl O Ar file-system-property Ns = Ns Ar value
|
||||
@ -859,9 +891,13 @@ The mount point must not exist or must be empty, or else the
|
||||
root dataset cannot be mounted. This can be overridden with the
|
||||
.Fl m
|
||||
option.
|
||||
.Pp
|
||||
By default all supported features are enabled on the new pool unless the
|
||||
.Fl d
|
||||
option is specified.
|
||||
.Bl -tag -width indent
|
||||
.It Fl f
|
||||
Forces use of
|
||||
Forces use of
|
||||
.Ar vdev Ns s,
|
||||
even if they appear in use or specify a conflicting replication level.
|
||||
Not all devices can be overridden in this manner.
|
||||
@ -869,6 +905,17 @@ Not all devices can be overridden in this manner.
|
||||
Displays the configuration that would be used without actually creating the
|
||||
pool. The actual pool creation can still fail due to insufficient privileges or
|
||||
device sharing.
|
||||
.It Fl d
|
||||
Do not enable any features on the new pool.
|
||||
Individual features can be enabled by setting their corresponding properties
|
||||
to
|
||||
.Sy enabled
|
||||
with the
|
||||
.Fl o
|
||||
option.
|
||||
See
|
||||
.Xr zpool-features 5
|
||||
for details about feature properties.
|
||||
.It Xo
|
||||
.Fl o Ar property Ns = Ns Ar value
|
||||
.Op Fl o Ar property Ns = Ns Ar value
|
||||
@ -897,7 +944,7 @@ or
|
||||
.Qq Cm altroot Ns Pa /pool
|
||||
if
|
||||
.Sy altroot
|
||||
is specified. The mount point must be an absolute path,
|
||||
is specified. The mount point must be an absolute path,
|
||||
.Qq Cm legacy ,
|
||||
or
|
||||
.Qq Cm none .
|
||||
@ -1234,7 +1281,7 @@ seconds until
|
||||
.Sy Ctrl-C
|
||||
is pressed. If no
|
||||
.Ar pools
|
||||
are specified, statistics for every pool in the system is shown. If
|
||||
are specified, statistics for every pool in the system is shown. If
|
||||
.Ar count
|
||||
is specified, the command exits after
|
||||
.Ar count
|
||||
@ -1292,7 +1339,7 @@ When given an interval, the output is printed every
|
||||
.Ar interval
|
||||
seconds until
|
||||
.Sy Ctrl-C
|
||||
is pressed. If
|
||||
is pressed. If
|
||||
.Ar count
|
||||
is specified, the command exits after
|
||||
.Ar count
|
||||
@ -1301,6 +1348,8 @@ reports are printed.
|
||||
.It Fl H
|
||||
Scripted mode. Do not display headers, and separate fields by a single tab
|
||||
instead of arbitrary space.
|
||||
.It Fl v
|
||||
Show more detailed information.
|
||||
.It Fl o Ar property Ns Op , Ns Ar ...
|
||||
Comma-separated list of properties to display. See the
|
||||
.Qq Sx Properties
|
||||
@ -1396,7 +1445,7 @@ This is equivalent to attaching
|
||||
waiting for it to resilver, and then detaching
|
||||
.Ar old_device .
|
||||
.Pp
|
||||
The size of
|
||||
The size of
|
||||
.Ar new_device
|
||||
must be greater than or equal to the minimum size
|
||||
of all the devices in a mirror or
|
||||
@ -1407,7 +1456,7 @@ configuration.
|
||||
is required if the pool is not redundant. If
|
||||
.Ar new_device
|
||||
is not specified, it defaults to
|
||||
.Ar old_device .
|
||||
.Ar old_device .
|
||||
This form of replacement is useful after an existing disk has failed and has
|
||||
been physically replaced. In this case, the new disk may have the same
|
||||
.Pa /dev
|
||||
@ -1494,12 +1543,12 @@ unless overridden by a device specification on the command line.
|
||||
.Pp
|
||||
When using a
|
||||
.Ar device
|
||||
argument,
|
||||
argument,
|
||||
.Cm split
|
||||
includes the specified device(s) in a new pool and, should any devices remain
|
||||
includes the specified device(s) in a new pool and, should any devices remain
|
||||
unspecified, assigns the last device in each mirror
|
||||
.No vdev
|
||||
to that pool, as it does normally. If you are uncertain about the outcome of a
|
||||
to that pool, as it does normally. If you are uncertain about the outcome of a
|
||||
.Cm split
|
||||
command, use the
|
||||
.Fl n
|
||||
@ -1552,7 +1601,7 @@ When given an interval, the output is printed every
|
||||
.Ar interval
|
||||
seconds until
|
||||
.Sy Ctrl-C
|
||||
is pressed. If
|
||||
is pressed. If
|
||||
.Ar count
|
||||
is specified, the command exits after
|
||||
.Ar count
|
||||
@ -1873,6 +1922,7 @@ Invalid command line options were specified.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr zfs 8
|
||||
.Xr zpool-features 5
|
||||
.Sh AUTHORS
|
||||
This manual page is a
|
||||
.Xr mdoc 7
|
||||
|
@ -54,6 +54,7 @@
|
||||
|
||||
#include "zpool_util.h"
|
||||
#include "zfs_comutil.h"
|
||||
#include "zfeature_common.h"
|
||||
|
||||
#include "statcommon.h"
|
||||
|
||||
@ -207,7 +208,7 @@ get_usage(zpool_help_t idx) {
|
||||
case HELP_CLEAR:
|
||||
return (gettext("\tclear [-nF] <pool> [device]\n"));
|
||||
case HELP_CREATE:
|
||||
return (gettext("\tcreate [-fn] [-o property=value] ... \n"
|
||||
return (gettext("\tcreate [-fnd] [-o property=value] ... \n"
|
||||
"\t [-O file-system-property=value] ... \n"
|
||||
"\t [-m mountpoint] [-R root] <pool> <vdev> ...\n"));
|
||||
case HELP_DESTROY:
|
||||
@ -234,7 +235,7 @@ get_usage(zpool_help_t idx) {
|
||||
case HELP_LABELCLEAR:
|
||||
return (gettext("\tlabelclear [-f] <vdev>\n"));
|
||||
case HELP_LIST:
|
||||
return (gettext("\tlist [-H] [-o property[,...]] "
|
||||
return (gettext("\tlist [-Hv] [-o property[,...]] "
|
||||
"[-T d|u] [pool] ... [interval [count]]\n"));
|
||||
case HELP_OFFLINE:
|
||||
return (gettext("\toffline [-t] <pool> <device> ...\n"));
|
||||
@ -339,6 +340,12 @@ usage(boolean_t requested)
|
||||
/* Iterate over all properties */
|
||||
(void) zprop_iter(print_prop_cb, fp, B_FALSE, B_TRUE,
|
||||
ZFS_TYPE_POOL);
|
||||
|
||||
(void) fprintf(fp, "\t%-15s ", "feature@...");
|
||||
(void) fprintf(fp, "YES disabled | enabled | active\n");
|
||||
|
||||
(void) fprintf(fp, gettext("\nThe feature@ properties must be "
|
||||
"appended with a feature name.\nSee zpool-features(5).\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -405,12 +412,16 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props,
|
||||
proplist = *props;
|
||||
|
||||
if (poolprop) {
|
||||
if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL) {
|
||||
if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL &&
|
||||
!zpool_prop_feature(propname)) {
|
||||
(void) fprintf(stderr, gettext("property '%s' is "
|
||||
"not a valid pool property\n"), propname);
|
||||
return (2);
|
||||
}
|
||||
normnm = zpool_prop_to_name(prop);
|
||||
if (zpool_prop_feature(propname))
|
||||
normnm = propname;
|
||||
else
|
||||
normnm = zpool_prop_to_name(prop);
|
||||
} else {
|
||||
if ((fprop = zfs_name_to_prop(propname)) != ZPROP_INVAL) {
|
||||
normnm = zfs_prop_to_name(fprop);
|
||||
@ -701,7 +712,7 @@ errout:
|
||||
}
|
||||
|
||||
/*
|
||||
* zpool create [-fn] [-o property=value] ...
|
||||
* zpool create [-fnd] [-o property=value] ...
|
||||
* [-O file-system-property=value] ...
|
||||
* [-R root] [-m mountpoint] <pool> <dev> ...
|
||||
*
|
||||
@ -710,8 +721,10 @@ errout:
|
||||
* were to be created.
|
||||
* -R Create a pool under an alternate root
|
||||
* -m Set default mountpoint for the root dataset. By default it's
|
||||
* '/<pool>'
|
||||
* '/<pool>'
|
||||
* -o Set property=value.
|
||||
* -d Don't automatically enable all supported pool features
|
||||
* (individual features can be enabled with -o).
|
||||
* -O Set fsproperty=value in the pool's root file system
|
||||
*
|
||||
* Creates the named pool according to the given vdev specification. The
|
||||
@ -724,6 +737,7 @@ zpool_do_create(int argc, char **argv)
|
||||
{
|
||||
boolean_t force = B_FALSE;
|
||||
boolean_t dryrun = B_FALSE;
|
||||
boolean_t enable_all_pool_feat = B_TRUE;
|
||||
int c;
|
||||
nvlist_t *nvroot = NULL;
|
||||
char *poolname;
|
||||
@ -735,7 +749,7 @@ zpool_do_create(int argc, char **argv)
|
||||
char *propval;
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt(argc, argv, ":fnR:m:o:O:")) != -1) {
|
||||
while ((c = getopt(argc, argv, ":fndR:m:o:O:")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
force = B_TRUE;
|
||||
@ -743,6 +757,9 @@ zpool_do_create(int argc, char **argv)
|
||||
case 'n':
|
||||
dryrun = B_TRUE;
|
||||
break;
|
||||
case 'd':
|
||||
enable_all_pool_feat = B_FALSE;
|
||||
break;
|
||||
case 'R':
|
||||
altroot = optarg;
|
||||
if (add_prop_list(zpool_prop_to_name(
|
||||
@ -770,6 +787,21 @@ zpool_do_create(int argc, char **argv)
|
||||
|
||||
if (add_prop_list(optarg, propval, &props, B_TRUE))
|
||||
goto errout;
|
||||
|
||||
/*
|
||||
* If the user is creating a pool that doesn't support
|
||||
* feature flags, don't enable any features.
|
||||
*/
|
||||
if (zpool_name_to_prop(optarg) == ZPOOL_PROP_VERSION) {
|
||||
char *end;
|
||||
u_longlong_t ver;
|
||||
|
||||
ver = strtoull(propval, &end, 10);
|
||||
if (*end == '\0' &&
|
||||
ver < SPA_VERSION_FEATURES) {
|
||||
enable_all_pool_feat = B_FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'O':
|
||||
if ((propval = strchr(optarg, '=')) == NULL) {
|
||||
@ -835,7 +867,6 @@ zpool_do_create(int argc, char **argv)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
||||
if (altroot != NULL && altroot[0] != '/') {
|
||||
(void) fprintf(stderr, gettext("invalid alternate root '%s': "
|
||||
"must be an absolute path\n"), altroot);
|
||||
@ -917,6 +948,27 @@ zpool_do_create(int argc, char **argv)
|
||||
/*
|
||||
* Hand off to libzfs.
|
||||
*/
|
||||
if (enable_all_pool_feat) {
|
||||
int i;
|
||||
for (i = 0; i < SPA_FEATURES; i++) {
|
||||
char propname[MAXPATHLEN];
|
||||
zfeature_info_t *feat = &spa_feature_table[i];
|
||||
|
||||
(void) snprintf(propname, sizeof (propname),
|
||||
"feature@%s", feat->fi_uname);
|
||||
|
||||
/*
|
||||
* Skip feature if user specified it manually
|
||||
* on the command line.
|
||||
*/
|
||||
if (nvlist_exists(props, propname))
|
||||
continue;
|
||||
|
||||
if (add_prop_list(propname, ZFS_FEATURE_ENABLED,
|
||||
&props, B_TRUE) != 0)
|
||||
goto errout;
|
||||
}
|
||||
}
|
||||
if (zpool_create(g_zfs, poolname,
|
||||
nvroot, props, fsprops) == 0) {
|
||||
zfs_handle_t *pool = zfs_open(g_zfs, poolname,
|
||||
@ -1249,6 +1301,10 @@ print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
(void) printf(gettext("newer version"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_UNSUP_FEAT:
|
||||
(void) printf(gettext("unsupported feature(s)"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_SPARED:
|
||||
verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
|
||||
&cb.cb_guid) == 0);
|
||||
@ -1366,6 +1422,10 @@ print_import_config(const char *name, nvlist_t *nv, int namewidth, int depth)
|
||||
(void) printf(gettext("newer version"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_UNSUP_FEAT:
|
||||
(void) printf(gettext("unsupported feature(s)"));
|
||||
break;
|
||||
|
||||
case VDEV_AUX_ERR_EXCEEDED:
|
||||
(void) printf(gettext("too many errors"));
|
||||
break;
|
||||
@ -1532,6 +1592,20 @@ show_import(nvlist_t *config)
|
||||
"incompatible version.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_READ:
|
||||
(void) printf(gettext("status: The pool uses the following "
|
||||
"feature(s) not supported on this sytem:\n"));
|
||||
zpool_print_unsup_feat(config);
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
|
||||
(void) printf(gettext("status: The pool can only be accessed "
|
||||
"in read-only mode on this system. It\n\tcannot be "
|
||||
"accessed in read-write mode because it uses the "
|
||||
"following\n\tfeature(s) not supported on this system:\n"));
|
||||
zpool_print_unsup_feat(config);
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_HOSTID_MISMATCH:
|
||||
(void) printf(gettext(" status: The pool was last accessed by "
|
||||
"another system.\n"));
|
||||
@ -1589,6 +1663,20 @@ show_import(nvlist_t *config)
|
||||
"newer\n\tsoftware, or recreate the pool from "
|
||||
"backup.\n"));
|
||||
break;
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_READ:
|
||||
(void) printf(gettext("action: The pool cannot be "
|
||||
"imported. Access the pool on a system that "
|
||||
"supports\n\tthe required feature(s), or recreate "
|
||||
"the pool from backup.\n"));
|
||||
break;
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
|
||||
(void) printf(gettext("action: The pool cannot be "
|
||||
"imported in read-write mode. Import the pool "
|
||||
"with\n"
|
||||
"\t\"-o readonly=on\", access the pool on a system "
|
||||
"that supports the\n\trequired feature(s), or "
|
||||
"recreate the pool from backup.\n"));
|
||||
break;
|
||||
case ZPOOL_STATUS_MISSING_DEV_R:
|
||||
case ZPOOL_STATUS_MISSING_DEV_NR:
|
||||
case ZPOOL_STATUS_BAD_GUID_SUM:
|
||||
@ -1664,9 +1752,9 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
|
||||
ZPOOL_CONFIG_POOL_STATE, &state) == 0);
|
||||
verify(nvlist_lookup_uint64(config,
|
||||
ZPOOL_CONFIG_VERSION, &version) == 0);
|
||||
if (version > SPA_VERSION) {
|
||||
if (!SPA_VERSION_IS_SUPPORTED(version)) {
|
||||
(void) fprintf(stderr, gettext("cannot import '%s': pool "
|
||||
"is formatted using a newer ZFS version\n"), name);
|
||||
"is formatted using an unsupported ZFS version\n"), name);
|
||||
return (1);
|
||||
} else if (state != POOL_STATE_EXPORTED &&
|
||||
!(flags & ZFS_IMPORT_ANY_HOST)) {
|
||||
@ -2601,15 +2689,13 @@ static void
|
||||
print_header(list_cbdata_t *cb)
|
||||
{
|
||||
zprop_list_t *pl = cb->cb_proplist;
|
||||
char headerbuf[ZPOOL_MAXPROPLEN];
|
||||
const char *header;
|
||||
boolean_t first = B_TRUE;
|
||||
boolean_t right_justify;
|
||||
size_t width = 0;
|
||||
|
||||
for (; pl != NULL; pl = pl->pl_next) {
|
||||
if (pl->pl_prop == ZPROP_INVAL)
|
||||
continue;
|
||||
|
||||
width = pl->pl_width;
|
||||
if (first && cb->cb_verbose) {
|
||||
/*
|
||||
@ -2624,8 +2710,18 @@ print_header(list_cbdata_t *cb)
|
||||
else
|
||||
first = B_FALSE;
|
||||
|
||||
header = zpool_prop_column_name(pl->pl_prop);
|
||||
right_justify = zpool_prop_align_right(pl->pl_prop);
|
||||
right_justify = B_FALSE;
|
||||
if (pl->pl_prop != ZPROP_INVAL) {
|
||||
header = zpool_prop_column_name(pl->pl_prop);
|
||||
right_justify = zpool_prop_align_right(pl->pl_prop);
|
||||
} else {
|
||||
int i;
|
||||
|
||||
for (i = 0; pl->pl_user_prop[i] != '\0'; i++)
|
||||
headerbuf[i] = toupper(pl->pl_user_prop[i]);
|
||||
headerbuf[i] = '\0';
|
||||
header = headerbuf;
|
||||
}
|
||||
|
||||
if (pl->pl_next == NULL && !right_justify)
|
||||
(void) printf("%s", header);
|
||||
@ -2685,6 +2781,11 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
|
||||
propstr = property;
|
||||
|
||||
right_justify = zpool_prop_align_right(pl->pl_prop);
|
||||
} else if ((zpool_prop_feature(pl->pl_user_prop) ||
|
||||
zpool_prop_unsupported(pl->pl_user_prop)) &&
|
||||
zpool_prop_get_feature(zhp, pl->pl_user_prop, property,
|
||||
sizeof (property)) == 0) {
|
||||
propstr = property;
|
||||
} else {
|
||||
propstr = "-";
|
||||
}
|
||||
@ -4024,6 +4125,31 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
"backup.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_READ:
|
||||
(void) printf(gettext("status: The pool cannot be accessed on "
|
||||
"this system because it uses the\n\tfollowing feature(s) "
|
||||
"not supported on this system:\n"));
|
||||
zpool_print_unsup_feat(config);
|
||||
(void) printf("\n");
|
||||
(void) printf(gettext("action: Access the pool from a system "
|
||||
"that supports the required feature(s),\n\tor restore the "
|
||||
"pool from backup.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
|
||||
(void) printf(gettext("status: The pool can only be accessed "
|
||||
"in read-only mode on this system. It\n\tcannot be "
|
||||
"accessed in read-write mode because it uses the "
|
||||
"following\n\tfeature(s) not supported on this system:\n"));
|
||||
zpool_print_unsup_feat(config);
|
||||
(void) printf("\n");
|
||||
(void) printf(gettext("action: The pool cannot be accessed in "
|
||||
"read-write mode. Import the pool with\n"
|
||||
"\t\"-o readonly=on\", access the pool from a system that "
|
||||
"supports the\n\trequired feature(s), or restore the "
|
||||
"pool from backup.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_FAULTED_DEV_R:
|
||||
(void) printf(gettext("status: One or more devices are "
|
||||
"faulted in response to persistent errors.\n\tSufficient "
|
||||
@ -4274,7 +4400,8 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
|
||||
&version) == 0);
|
||||
|
||||
if (!cbp->cb_newer && version < SPA_VERSION) {
|
||||
if (!cbp->cb_newer && SPA_VERSION_IS_SUPPORTED(version) &&
|
||||
version != SPA_VERSION) {
|
||||
if (!cbp->cb_all) {
|
||||
if (cbp->cb_first) {
|
||||
(void) printf(gettext("The following pools are "
|
||||
@ -4303,13 +4430,14 @@ upgrade_cb(zpool_handle_t *zhp, void *arg)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cbp->cb_newer && version > SPA_VERSION) {
|
||||
} else if (cbp->cb_newer && !SPA_VERSION_IS_SUPPORTED(version)) {
|
||||
assert(!cbp->cb_all);
|
||||
|
||||
if (cbp->cb_first) {
|
||||
(void) printf(gettext("The following pools are "
|
||||
"formatted using a newer software version and\n"
|
||||
"cannot be accessed on the current system.\n\n"));
|
||||
"formatted using an unsupported software version "
|
||||
"and\ncannot be accessed on the current "
|
||||
"system.\n\n"));
|
||||
(void) printf(gettext("VER POOL\n"));
|
||||
(void) printf(gettext("--- ------------\n"));
|
||||
cbp->cb_first = B_FALSE;
|
||||
@ -4397,8 +4525,8 @@ zpool_do_upgrade(int argc, char **argv)
|
||||
break;
|
||||
case 'V':
|
||||
cb.cb_version = strtoll(optarg, &end, 10);
|
||||
if (*end != '\0' || cb.cb_version > SPA_VERSION ||
|
||||
cb.cb_version < SPA_VERSION_1) {
|
||||
if (*end != '\0' ||
|
||||
!SPA_VERSION_IS_SUPPORTED(cb.cb_version)) {
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid version '%s'\n"), optarg);
|
||||
usage(B_FALSE);
|
||||
@ -4443,8 +4571,8 @@ zpool_do_upgrade(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
(void) printf(gettext("This system is currently running "
|
||||
"ZFS pool version %llu.\n\n"), SPA_VERSION);
|
||||
(void) printf(gettext("This system supports ZFS pool feature "
|
||||
"flags.\n\n"));
|
||||
cb.cb_first = B_TRUE;
|
||||
if (showversions) {
|
||||
(void) printf(gettext("The following versions are "
|
||||
@ -4705,13 +4833,26 @@ get_callback(zpool_handle_t *zhp, void *data)
|
||||
pl == cbp->cb_proplist)
|
||||
continue;
|
||||
|
||||
if (zpool_get_prop(zhp, pl->pl_prop,
|
||||
value, sizeof (value), &srctype) != 0)
|
||||
continue;
|
||||
if (pl->pl_prop == ZPROP_INVAL &&
|
||||
(zpool_prop_feature(pl->pl_user_prop) ||
|
||||
zpool_prop_unsupported(pl->pl_user_prop))) {
|
||||
srctype = ZPROP_SRC_LOCAL;
|
||||
|
||||
zprop_print_one_property(zpool_get_name(zhp), cbp,
|
||||
zpool_prop_to_name(pl->pl_prop), value, srctype, NULL,
|
||||
NULL);
|
||||
if (zpool_prop_get_feature(zhp, pl->pl_user_prop,
|
||||
value, sizeof (value)) == 0) {
|
||||
zprop_print_one_property(zpool_get_name(zhp),
|
||||
cbp, pl->pl_user_prop, value, srctype,
|
||||
NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
if (zpool_get_prop(zhp, pl->pl_prop, value,
|
||||
sizeof (value), &srctype) != 0)
|
||||
continue;
|
||||
|
||||
zprop_print_one_property(zpool_get_name(zhp), cbp,
|
||||
zpool_prop_to_name(pl->pl_prop), value, srctype,
|
||||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@ -4723,8 +4864,11 @@ zpool_do_get(int argc, char **argv)
|
||||
zprop_list_t fake_name = { 0 };
|
||||
int ret;
|
||||
|
||||
if (argc < 3)
|
||||
if (argc < 2) {
|
||||
(void) fprintf(stderr, gettext("missing property "
|
||||
"argument\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
cb.cb_first = B_TRUE;
|
||||
cb.cb_sources = ZPROP_SRC_ALL;
|
||||
@ -4734,7 +4878,7 @@ zpool_do_get(int argc, char **argv)
|
||||
cb.cb_columns[3] = GET_COL_SOURCE;
|
||||
cb.cb_type = ZFS_TYPE_POOL;
|
||||
|
||||
if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
|
||||
if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
|
||||
ZFS_TYPE_POOL) != 0)
|
||||
usage(B_FALSE);
|
||||
|
||||
|
@ -107,6 +107,7 @@
|
||||
#include <sys/dsl_scan.h>
|
||||
#include <sys/zio_checksum.h>
|
||||
#include <sys/refcount.h>
|
||||
#include <sys/zfeature.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <stdlib.h>
|
||||
@ -5575,10 +5576,9 @@ make_random_props()
|
||||
{
|
||||
nvlist_t *props;
|
||||
|
||||
if (ztest_random(2) == 0)
|
||||
return (NULL);
|
||||
|
||||
VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
|
||||
if (ztest_random(2) == 0)
|
||||
return (props);
|
||||
VERIFY(nvlist_add_uint64(props, "autoreplace", 1) == 0);
|
||||
|
||||
return (props);
|
||||
@ -5609,6 +5609,12 @@ ztest_init(ztest_shared_t *zs)
|
||||
nvroot = make_vdev_root(NULL, NULL, ztest_opts.zo_vdev_size, 0,
|
||||
0, ztest_opts.zo_raidz, zs->zs_mirrors, 1);
|
||||
props = make_random_props();
|
||||
for (int i = 0; i < SPA_FEATURES; i++) {
|
||||
char buf[1024];
|
||||
(void) snprintf(buf, sizeof (buf), "feature@%s",
|
||||
spa_feature_table[i].fi_uname);
|
||||
VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0));
|
||||
}
|
||||
VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props,
|
||||
NULL, NULL));
|
||||
nvlist_free(nvroot);
|
||||
@ -5616,6 +5622,7 @@ ztest_init(ztest_shared_t *zs)
|
||||
VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
|
||||
zs->zs_metaslab_sz =
|
||||
1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
|
||||
kernel_fini();
|
||||
@ -5654,9 +5661,24 @@ setup_fds(void)
|
||||
ASSERT3U(fd, ==, ZTEST_FD_RAND);
|
||||
}
|
||||
|
||||
static int
|
||||
shared_data_size(ztest_shared_hdr_t *hdr)
|
||||
{
|
||||
int size;
|
||||
|
||||
size = hdr->zh_hdr_size;
|
||||
size += hdr->zh_opts_size;
|
||||
size += hdr->zh_size;
|
||||
size += hdr->zh_stats_size * hdr->zh_stats_count;
|
||||
size += hdr->zh_ds_size * hdr->zh_ds_count;
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_hdr(void)
|
||||
{
|
||||
int size;
|
||||
ztest_shared_hdr_t *hdr;
|
||||
|
||||
#ifndef illumos
|
||||
@ -5667,6 +5689,8 @@ setup_hdr(void)
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
|
||||
ASSERT(hdr != MAP_FAILED);
|
||||
|
||||
VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t)));
|
||||
|
||||
hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t);
|
||||
hdr->zh_opts_size = sizeof (ztest_shared_opts_t);
|
||||
hdr->zh_size = sizeof (ztest_shared_t);
|
||||
@ -5675,6 +5699,9 @@ setup_hdr(void)
|
||||
hdr->zh_ds_size = sizeof (ztest_shared_ds_t);
|
||||
hdr->zh_ds_count = ztest_opts.zo_datasets;
|
||||
|
||||
size = shared_data_size(hdr);
|
||||
VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size));
|
||||
|
||||
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
|
||||
}
|
||||
|
||||
@ -5689,11 +5716,7 @@ setup_data(void)
|
||||
PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0);
|
||||
ASSERT(hdr != MAP_FAILED);
|
||||
|
||||
size = hdr->zh_hdr_size;
|
||||
size += hdr->zh_opts_size;
|
||||
size += hdr->zh_size;
|
||||
size += hdr->zh_stats_size * hdr->zh_stats_count;
|
||||
size += hdr->zh_ds_size * hdr->zh_ds_count;
|
||||
size = shared_data_size(hdr);
|
||||
|
||||
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
|
||||
hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()),
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <solaris.h>
|
||||
@ -802,6 +803,10 @@ dump_nvlist(nvlist_t *list, int indent)
|
||||
|
||||
while ((elem = nvlist_next_nvpair(list, elem)) != NULL) {
|
||||
switch (nvpair_type(elem)) {
|
||||
case DATA_TYPE_BOOLEAN:
|
||||
(void) printf("%*s%s\n", indent, "", nvpair_name(elem));
|
||||
break;
|
||||
|
||||
case DATA_TYPE_BOOLEAN_VALUE:
|
||||
(void) nvpair_value_boolean_value(elem, &bool_value);
|
||||
(void) printf("%*s%s: %s\n", indent, "",
|
||||
|
@ -294,6 +294,15 @@ typedef enum {
|
||||
ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
|
||||
ZPOOL_STATUS_BAD_LOG, /* cannot read log chain(s) */
|
||||
|
||||
/*
|
||||
* If the pool has unsupported features but can still be opened in
|
||||
* read-only mode, its status is ZPOOL_STATUS_UNSUP_FEAT_WRITE. If the
|
||||
* pool has unsupported features but cannot be opened at all, its
|
||||
* status is ZPOOL_STATUS_UNSUP_FEAT_READ.
|
||||
*/
|
||||
ZPOOL_STATUS_UNSUP_FEAT_READ, /* unsupported features for read */
|
||||
ZPOOL_STATUS_UNSUP_FEAT_WRITE, /* unsupported features for write */
|
||||
|
||||
/*
|
||||
* These faults have no corresponding message ID. At the time we are
|
||||
* checking the status, the original reason for the FMA fault (I/O or
|
||||
@ -326,6 +335,7 @@ extern void zpool_dump_ddt(const ddt_stat_t *dds, const ddt_histogram_t *ddh);
|
||||
* Statistics and configuration functions.
|
||||
*/
|
||||
extern nvlist_t *zpool_get_config(zpool_handle_t *, nvlist_t **);
|
||||
extern nvlist_t *zpool_get_features(zpool_handle_t *);
|
||||
extern int zpool_refresh_stats(zpool_handle_t *, boolean_t *);
|
||||
extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
|
||||
|
||||
@ -338,6 +348,7 @@ extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
|
||||
char *altroot);
|
||||
extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
|
||||
nvlist_t *, int);
|
||||
extern void zpool_print_unsup_feat(nvlist_t *config);
|
||||
|
||||
/*
|
||||
* Search for pools to import
|
||||
@ -427,6 +438,8 @@ extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
|
||||
uint64_t *propvalue);
|
||||
extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
|
||||
char *propbuf, int proplen, boolean_t literal);
|
||||
extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
|
||||
char *buf, size_t len);
|
||||
extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap,
|
||||
uint64_t *usedp);
|
||||
extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
|
||||
@ -454,10 +467,19 @@ extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
|
||||
#define ZFS_MOUNTPOINT_NONE "none"
|
||||
#define ZFS_MOUNTPOINT_LEGACY "legacy"
|
||||
|
||||
#define ZFS_FEATURE_DISABLED "disabled"
|
||||
#define ZFS_FEATURE_ENABLED "enabled"
|
||||
#define ZFS_FEATURE_ACTIVE "active"
|
||||
|
||||
#define ZFS_UNSUPPORTED_INACTIVE "inactive"
|
||||
#define ZFS_UNSUPPORTED_READONLY "readonly"
|
||||
|
||||
/*
|
||||
* zpool property management
|
||||
*/
|
||||
extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
|
||||
extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
|
||||
size_t);
|
||||
extern const char *zpool_prop_default_string(zpool_prop_t);
|
||||
extern uint64_t zpool_prop_default_numeric(zpool_prop_t);
|
||||
extern const char *zpool_prop_column_name(zpool_prop_t);
|
||||
|
@ -18,11 +18,16 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The pool configuration repository is stored in /etc/zfs/zpool.cache as a
|
||||
* single packed nvlist. While it would be nice to just read in this
|
||||
@ -217,6 +222,36 @@ zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig)
|
||||
return (zhp->zpool_config);
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieves a list of enabled features and their refcounts and caches it in
|
||||
* the pool handle.
|
||||
*/
|
||||
nvlist_t *
|
||||
zpool_get_features(zpool_handle_t *zhp)
|
||||
{
|
||||
nvlist_t *config, *features;
|
||||
|
||||
config = zpool_get_config(zhp, NULL);
|
||||
|
||||
if (config == NULL || !nvlist_exists(config,
|
||||
ZPOOL_CONFIG_FEATURE_STATS)) {
|
||||
int error;
|
||||
boolean_t missing = B_FALSE;
|
||||
|
||||
error = zpool_refresh_stats(zhp, &missing);
|
||||
|
||||
if (error != 0 || missing)
|
||||
return (NULL);
|
||||
|
||||
config = zpool_get_config(zhp, NULL);
|
||||
}
|
||||
|
||||
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
|
||||
&features) == 0);
|
||||
|
||||
return (features);
|
||||
}
|
||||
|
||||
/*
|
||||
* Refresh the vdev statistics associated with the given pool. This is used in
|
||||
* iostat to show configuration changes and determine the delta from the last
|
||||
|
@ -1485,11 +1485,13 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
|
||||
|
||||
/*
|
||||
* If the dataset's canmount property is being set to noauto,
|
||||
* or being set to on and the dataset is already mounted,
|
||||
* then we want to prevent unmounting & remounting it.
|
||||
*/
|
||||
do_prefix = !((prop == ZFS_PROP_CANMOUNT) &&
|
||||
(zprop_string_to_index(prop, propval, &idx,
|
||||
ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO));
|
||||
ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO ||
|
||||
(idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL))));
|
||||
|
||||
if (do_prefix && (ret = changelist_prefix(cl)) != 0)
|
||||
goto error;
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "zfs_prop.h"
|
||||
#include "libzfs_impl.h"
|
||||
#include "zfs_comutil.h"
|
||||
#include "zfeature_common.h"
|
||||
|
||||
static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
|
||||
|
||||
@ -301,6 +302,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
|
||||
case ZPOOL_PROP_SIZE:
|
||||
case ZPOOL_PROP_ALLOCATED:
|
||||
case ZPOOL_PROP_FREE:
|
||||
case ZPOOL_PROP_FREEING:
|
||||
case ZPOOL_PROP_EXPANDSZ:
|
||||
(void) zfs_nicenum(intval, buf, len);
|
||||
break;
|
||||
@ -326,6 +328,12 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
|
||||
(void) strlcpy(buf, zpool_state_to_name(intval,
|
||||
vs->vs_aux), len);
|
||||
break;
|
||||
case ZPOOL_PROP_VERSION:
|
||||
if (intval >= SPA_VERSION_FEATURES) {
|
||||
(void) snprintf(buf, len, "-");
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
(void) snprintf(buf, len, "%llu", intval);
|
||||
}
|
||||
@ -430,10 +438,48 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
|
||||
while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
|
||||
const char *propname = nvpair_name(elem);
|
||||
|
||||
prop = zpool_name_to_prop(propname);
|
||||
if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
|
||||
int err;
|
||||
zfeature_info_t *feature;
|
||||
char *fname = strchr(propname, '@') + 1;
|
||||
|
||||
err = zfeature_lookup_name(fname, &feature);
|
||||
if (err != 0) {
|
||||
ASSERT3U(err, ==, ENOENT);
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"invalid feature '%s'"), fname);
|
||||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (nvpair_type(elem) != DATA_TYPE_STRING) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"'%s' must be a string"), propname);
|
||||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
(void) nvpair_value_string(elem, &strval);
|
||||
if (strcmp(strval, ZFS_FEATURE_ENABLED) != 0) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"property '%s' can only be set to "
|
||||
"'enabled'"), propname);
|
||||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (nvlist_add_uint64(retprops, propname, 0) != 0) {
|
||||
(void) no_memory(hdl);
|
||||
goto error;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure this property is valid and applies to this type.
|
||||
*/
|
||||
if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL) {
|
||||
if (prop == ZPROP_INVAL) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"invalid property '%s'"), propname);
|
||||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
@ -456,7 +502,8 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
|
||||
*/
|
||||
switch (prop) {
|
||||
case ZPOOL_PROP_VERSION:
|
||||
if (intval < version || intval > SPA_VERSION) {
|
||||
if (intval < version ||
|
||||
!SPA_VERSION_IS_SUPPORTED(intval)) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"property '%s' number %d is invalid."),
|
||||
propname, intval);
|
||||
@ -680,10 +727,77 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
|
||||
libzfs_handle_t *hdl = zhp->zpool_hdl;
|
||||
zprop_list_t *entry;
|
||||
char buf[ZFS_MAXPROPLEN];
|
||||
nvlist_t *features = NULL;
|
||||
zprop_list_t **last;
|
||||
boolean_t firstexpand = (NULL == *plp);
|
||||
|
||||
if (zprop_expand_list(hdl, plp, ZFS_TYPE_POOL) != 0)
|
||||
return (-1);
|
||||
|
||||
last = plp;
|
||||
while (*last != NULL)
|
||||
last = &(*last)->pl_next;
|
||||
|
||||
if ((*plp)->pl_all)
|
||||
features = zpool_get_features(zhp);
|
||||
|
||||
if ((*plp)->pl_all && firstexpand) {
|
||||
for (int i = 0; i < SPA_FEATURES; i++) {
|
||||
zprop_list_t *entry = zfs_alloc(hdl,
|
||||
sizeof (zprop_list_t));
|
||||
entry->pl_prop = ZPROP_INVAL;
|
||||
entry->pl_user_prop = zfs_asprintf(hdl, "feature@%s",
|
||||
spa_feature_table[i].fi_uname);
|
||||
entry->pl_width = strlen(entry->pl_user_prop);
|
||||
entry->pl_all = B_TRUE;
|
||||
|
||||
*last = entry;
|
||||
last = &entry->pl_next;
|
||||
}
|
||||
}
|
||||
|
||||
/* add any unsupported features */
|
||||
for (nvpair_t *nvp = nvlist_next_nvpair(features, NULL);
|
||||
nvp != NULL; nvp = nvlist_next_nvpair(features, nvp)) {
|
||||
char *propname;
|
||||
boolean_t found;
|
||||
zprop_list_t *entry;
|
||||
|
||||
if (zfeature_is_supported(nvpair_name(nvp)))
|
||||
continue;
|
||||
|
||||
propname = zfs_asprintf(hdl, "unsupported@%s",
|
||||
nvpair_name(nvp));
|
||||
|
||||
/*
|
||||
* Before adding the property to the list make sure that no
|
||||
* other pool already added the same property.
|
||||
*/
|
||||
found = B_FALSE;
|
||||
entry = *plp;
|
||||
while (entry != NULL) {
|
||||
if (entry->pl_user_prop != NULL &&
|
||||
strcmp(propname, entry->pl_user_prop) == 0) {
|
||||
found = B_TRUE;
|
||||
break;
|
||||
}
|
||||
entry = entry->pl_next;
|
||||
}
|
||||
if (found) {
|
||||
free(propname);
|
||||
continue;
|
||||
}
|
||||
|
||||
entry = zfs_alloc(hdl, sizeof (zprop_list_t));
|
||||
entry->pl_prop = ZPROP_INVAL;
|
||||
entry->pl_user_prop = propname;
|
||||
entry->pl_width = strlen(entry->pl_user_prop);
|
||||
entry->pl_all = B_TRUE;
|
||||
|
||||
*last = entry;
|
||||
last = &entry->pl_next;
|
||||
}
|
||||
|
||||
for (entry = *plp; entry != NULL; entry = entry->pl_next) {
|
||||
|
||||
if (entry->pl_fixed)
|
||||
@ -700,6 +814,66 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the state for the given feature on the given ZFS pool.
|
||||
*/
|
||||
int
|
||||
zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
|
||||
size_t len)
|
||||
{
|
||||
uint64_t refcount;
|
||||
boolean_t found = B_FALSE;
|
||||
nvlist_t *features = zpool_get_features(zhp);
|
||||
boolean_t supported;
|
||||
const char *feature = strchr(propname, '@') + 1;
|
||||
|
||||
supported = zpool_prop_feature(propname);
|
||||
ASSERT(supported || zpool_prop_unsupported(propname));
|
||||
|
||||
/*
|
||||
* Convert from feature name to feature guid. This conversion is
|
||||
* unecessary for unsupported@... properties because they already
|
||||
* use guids.
|
||||
*/
|
||||
if (supported) {
|
||||
int ret;
|
||||
zfeature_info_t *fi;
|
||||
|
||||
ret = zfeature_lookup_name(feature, &fi);
|
||||
if (ret != 0) {
|
||||
(void) strlcpy(buf, "-", len);
|
||||
return (ENOTSUP);
|
||||
}
|
||||
feature = fi->fi_guid;
|
||||
}
|
||||
|
||||
if (nvlist_lookup_uint64(features, feature, &refcount) == 0)
|
||||
found = B_TRUE;
|
||||
|
||||
if (supported) {
|
||||
if (!found) {
|
||||
(void) strlcpy(buf, ZFS_FEATURE_DISABLED, len);
|
||||
} else {
|
||||
if (refcount == 0)
|
||||
(void) strlcpy(buf, ZFS_FEATURE_ENABLED, len);
|
||||
else
|
||||
(void) strlcpy(buf, ZFS_FEATURE_ACTIVE, len);
|
||||
}
|
||||
} else {
|
||||
if (found) {
|
||||
if (refcount == 0) {
|
||||
(void) strcpy(buf, ZFS_UNSUPPORTED_INACTIVE);
|
||||
} else {
|
||||
(void) strcpy(buf, ZFS_UNSUPPORTED_READONLY);
|
||||
}
|
||||
} else {
|
||||
(void) strlcpy(buf, "-", len);
|
||||
return (ENOTSUP);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't start the slice at the default block of 34; many storage
|
||||
@ -1286,8 +1460,10 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
|
||||
if (!hdl->libzfs_printerr || config == NULL)
|
||||
return;
|
||||
|
||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0)
|
||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
|
||||
nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
|
||||
return;
|
||||
@ -1343,6 +1519,7 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
|
||||
|
||||
/* All attempted rewinds failed if ZPOOL_CONFIG_LOAD_TIME missing */
|
||||
if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
|
||||
nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0 ||
|
||||
nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
|
||||
goto no_info;
|
||||
|
||||
@ -1465,6 +1642,30 @@ print_vdev_tree(libzfs_handle_t *hdl, const char *name, nvlist_t *nv,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
zpool_print_unsup_feat(nvlist_t *config)
|
||||
{
|
||||
nvlist_t *nvinfo, *unsup_feat;
|
||||
|
||||
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nvinfo) ==
|
||||
0);
|
||||
verify(nvlist_lookup_nvlist(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT,
|
||||
&unsup_feat) == 0);
|
||||
|
||||
for (nvpair_t *nvp = nvlist_next_nvpair(unsup_feat, NULL); nvp != NULL;
|
||||
nvp = nvlist_next_nvpair(unsup_feat, nvp)) {
|
||||
char *desc;
|
||||
|
||||
verify(nvpair_type(nvp) == DATA_TYPE_STRING);
|
||||
verify(nvpair_value_string(nvp, &desc) == 0);
|
||||
|
||||
if (strlen(desc) > 0)
|
||||
(void) printf("\t%s (%s)\n", nvpair_name(nvp), desc);
|
||||
else
|
||||
(void) printf("\t%s\n", nvpair_name(nvp));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Import the given pool using the known configuration and a list of
|
||||
* properties to be set. The configuration should have come from
|
||||
@ -1571,6 +1772,22 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||
|
||||
switch (error) {
|
||||
case ENOTSUP:
|
||||
if (nv != NULL && nvlist_lookup_nvlist(nv,
|
||||
ZPOOL_CONFIG_LOAD_INFO, &nvinfo) == 0 &&
|
||||
nvlist_exists(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT)) {
|
||||
(void) printf(dgettext(TEXT_DOMAIN, "This "
|
||||
"pool uses the following feature(s) not "
|
||||
"supported by this system:\n"));
|
||||
zpool_print_unsup_feat(nv);
|
||||
if (nvlist_exists(nvinfo,
|
||||
ZPOOL_CONFIG_CAN_RDONLY)) {
|
||||
(void) printf(dgettext(TEXT_DOMAIN,
|
||||
"All unsupported features are only "
|
||||
"required for writing to the pool."
|
||||
"\nThe pool can be imported using "
|
||||
"'-o readonly=on'.\n"));
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Unsupported version.
|
||||
*/
|
||||
|
@ -18,8 +18,10 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -213,6 +215,20 @@ check_status(nvlist_t *config, boolean_t isimport)
|
||||
vs->vs_aux == VDEV_AUX_VERSION_NEWER)
|
||||
return (ZPOOL_STATUS_VERSION_NEWER);
|
||||
|
||||
/*
|
||||
* Unsupported feature(s).
|
||||
*/
|
||||
if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
|
||||
vs->vs_aux == VDEV_AUX_UNSUP_FEAT) {
|
||||
nvlist_t *nvinfo;
|
||||
|
||||
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
|
||||
&nvinfo) == 0);
|
||||
if (nvlist_exists(nvinfo, ZPOOL_CONFIG_CAN_RDONLY))
|
||||
return (ZPOOL_STATUS_UNSUP_FEAT_WRITE);
|
||||
return (ZPOOL_STATUS_UNSUP_FEAT_READ);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that the config is complete.
|
||||
*/
|
||||
@ -300,7 +316,7 @@ check_status(nvlist_t *config, boolean_t isimport)
|
||||
/*
|
||||
* Outdated, but usable, version
|
||||
*/
|
||||
if (version < SPA_VERSION)
|
||||
if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION)
|
||||
return (ZPOOL_STATUS_VERSION_OLDER);
|
||||
|
||||
return (ZPOOL_STATUS_OK);
|
||||
|
@ -18,9 +18,10 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -50,6 +51,7 @@
|
||||
|
||||
#include "libzfs_impl.h"
|
||||
#include "zfs_prop.h"
|
||||
#include "zfeature_common.h"
|
||||
|
||||
int aok;
|
||||
|
||||
@ -119,7 +121,8 @@ libzfs_error_description(libzfs_handle_t *hdl)
|
||||
case EZFS_RESILVERING:
|
||||
return (dgettext(TEXT_DOMAIN, "currently resilvering"));
|
||||
case EZFS_BADVERSION:
|
||||
return (dgettext(TEXT_DOMAIN, "unsupported version"));
|
||||
return (dgettext(TEXT_DOMAIN, "unsupported version or "
|
||||
"feature"));
|
||||
case EZFS_POOLUNAVAIL:
|
||||
return (dgettext(TEXT_DOMAIN, "pool is unavailable"));
|
||||
case EZFS_DEVOVERFLOW:
|
||||
@ -656,6 +659,7 @@ libzfs_init(void)
|
||||
|
||||
zfs_prop_init();
|
||||
zpool_prop_init();
|
||||
zpool_feature_init();
|
||||
libzfs_mnttab_init(hdl);
|
||||
|
||||
return (hdl);
|
||||
@ -1325,9 +1329,11 @@ addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
|
||||
* this is a pool property or if this isn't a user-defined
|
||||
* dataset property,
|
||||
*/
|
||||
if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL ||
|
||||
(!zfs_prop_user(propname) && !zfs_prop_userquota(propname) &&
|
||||
!zfs_prop_written(propname)))) {
|
||||
if (prop == ZPROP_INVAL && ((type == ZFS_TYPE_POOL &&
|
||||
!zpool_prop_feature(propname) &&
|
||||
!zpool_prop_unsupported(propname)) ||
|
||||
(type == ZFS_TYPE_DATASET && !zfs_prop_user(propname) &&
|
||||
!zfs_prop_userquota(propname) && !zfs_prop_written(propname)))) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"invalid property '%s'"), propname);
|
||||
return (zfs_error(hdl, EZFS_BADPROP,
|
||||
@ -1339,7 +1345,8 @@ addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
|
||||
|
||||
entry->pl_prop = prop;
|
||||
if (prop == ZPROP_INVAL) {
|
||||
if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == NULL) {
|
||||
if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) ==
|
||||
NULL) {
|
||||
free(entry);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -474,7 +474,9 @@ vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
|
||||
* To simulate partial disk writes, we split writes into two
|
||||
* system calls so that the process can be killed in between.
|
||||
*/
|
||||
split = (len > 0 ? rand() % len : 0);
|
||||
int sectors = len >> SPA_MINBLOCKSHIFT;
|
||||
split = (sectors > 0 ? rand() % sectors : 0) <<
|
||||
SPA_MINBLOCKSHIFT;
|
||||
iolen = pwrite64(vp->v_fd, addr, split, offset);
|
||||
iolen += pwrite64(vp->v_fd, (char *)addr + split,
|
||||
len - split, offset + split);
|
||||
|
@ -8,12 +8,17 @@ LIB= nvpair
|
||||
SRCS= libnvpair.c \
|
||||
nvpair_alloc_system.c \
|
||||
nvpair_alloc_fixed.c \
|
||||
nvpair.c
|
||||
nvpair.c \
|
||||
fnvpair.c
|
||||
|
||||
WARNS?= 0
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
@ -27,6 +27,7 @@ SRCS+= libzfs_changelist.c \
|
||||
libzfs_sendrecv.c \
|
||||
libzfs_status.c \
|
||||
libzfs_util.c \
|
||||
zfeature_common.c \
|
||||
zfs_comutil.c \
|
||||
zfs_deleg.c \
|
||||
zfs_fletcher.c \
|
||||
|
@ -5,7 +5,7 @@
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
|
||||
PROG= zpool
|
||||
MAN= zpool.8
|
||||
MAN= zpool.8 zpool-features.5
|
||||
SRCS= zpool_main.c zpool_vdev.c zpool_iter.c zpool_util.c zfs_comutil.c
|
||||
SRCS+= timestamp.c
|
||||
|
||||
|
@ -11,15 +11,16 @@ CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include
|
||||
CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem
|
||||
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common
|
||||
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
|
||||
${LIBPTHREAD} ${LIBAVL}
|
||||
LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lavl
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
|
||||
${LIBPTHREAD} ${LIBAVL} ${LIBZFS} ${LIBUUTIL}
|
||||
LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs -luutil
|
||||
|
||||
CSTD= c99
|
||||
|
||||
|
@ -5,11 +5,13 @@
|
||||
SUBDIR= ${_dtrace} \
|
||||
${_dtruss} \
|
||||
${_lockstat} \
|
||||
${_zdb}
|
||||
${_zdb} \
|
||||
${_zhack}
|
||||
|
||||
.if ${MK_ZFS} != "no"
|
||||
.if ${MK_LIBTHR} != "no"
|
||||
_zdb= zdb
|
||||
_zhack= zhack
|
||||
.endif
|
||||
.endif
|
||||
|
||||
|
29
cddl/usr.sbin/zhack/Makefile
Normal file
29
cddl/usr.sbin/zhack/Makefile
Normal file
@ -0,0 +1,29 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack
|
||||
|
||||
PROG= zhack
|
||||
NO_MAN=
|
||||
|
||||
WARNS?= 0
|
||||
CSTD= c99
|
||||
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
|
||||
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
|
||||
CFLAGS+= -I${.CURDIR}/../../lib/libumem
|
||||
|
||||
DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
|
||||
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -50,6 +50,7 @@
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
|
||||
%{static:-Bstatic}} \
|
||||
%{!static:--hash-style=both} \
|
||||
%{symbolic:-Bsymbolic} \
|
||||
-X %{mbig-endian:-EB} %{mlittle-endian:-EL}"
|
||||
|
||||
|
@ -887,7 +887,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
||||
const fmtflags __fmt = __io.flags();
|
||||
__io.flags(__fmt & ~ios_base::basefield | ios_base::hex);
|
||||
|
||||
unsigned long __ul;
|
||||
typedef __gnu_cxx::__conditional_type<(sizeof(void*)
|
||||
<= sizeof(unsigned long)),
|
||||
unsigned long, unsigned long long>::__type _UIntPtrType;
|
||||
|
||||
_UIntPtrType __ul;
|
||||
__beg = _M_extract_int(__beg, __end, __io, __err, __ul);
|
||||
|
||||
// Reset from hex formatted input.
|
||||
@ -1309,8 +1313,12 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
||||
| ios_base::internal);
|
||||
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
|
||||
|
||||
typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
|
||||
<= sizeof(unsigned long)),
|
||||
unsigned long, unsigned long long>::__type _UIntPtrType;
|
||||
|
||||
__s = _M_insert_int(__s, __io, __fill,
|
||||
reinterpret_cast<unsigned long>(__v));
|
||||
reinterpret_cast<_UIntPtrType>(__v));
|
||||
__io.flags(__flags);
|
||||
return __s;
|
||||
}
|
||||
|
@ -385,6 +385,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
_Bit_iterator _M_start;
|
||||
_Bit_iterator _M_finish;
|
||||
_Bit_type* _M_end_of_storage;
|
||||
|
||||
_Bvector_impl()
|
||||
: _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
|
||||
{ }
|
||||
|
||||
_Bvector_impl(const _Bit_alloc_type& __a)
|
||||
: _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
|
||||
{ }
|
||||
@ -405,7 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
get_allocator() const
|
||||
{ return allocator_type(_M_get_Bit_allocator()); }
|
||||
|
||||
_Bvector_base(const allocator_type& __a) : _M_impl(__a) { }
|
||||
_Bvector_base()
|
||||
: _M_impl() { }
|
||||
|
||||
_Bvector_base(const allocator_type& __a)
|
||||
: _M_impl(__a) { }
|
||||
|
||||
~_Bvector_base()
|
||||
{ this->_M_deallocate(); }
|
||||
@ -480,8 +489,11 @@ template<typename _Alloc>
|
||||
using _Base::_M_get_Bit_allocator;
|
||||
|
||||
public:
|
||||
vector()
|
||||
: _Base() { }
|
||||
|
||||
explicit
|
||||
vector(const allocator_type& __a = allocator_type())
|
||||
vector(const allocator_type& __a)
|
||||
: _Base(__a) { }
|
||||
|
||||
explicit
|
||||
@ -678,7 +690,7 @@ template<typename _Alloc>
|
||||
}
|
||||
|
||||
void
|
||||
swap(vector<bool, _Alloc>& __x)
|
||||
swap(vector& __x)
|
||||
{
|
||||
std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
|
||||
std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
|
||||
|
@ -380,6 +380,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
|
||||
typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
|
||||
|
||||
_Deque_base()
|
||||
: _M_impl()
|
||||
{ _M_initialize_map(0); }
|
||||
|
||||
_Deque_base(const allocator_type& __a, size_t __num_elements)
|
||||
: _M_impl(__a)
|
||||
{ _M_initialize_map(__num_elements); }
|
||||
@ -406,6 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
iterator _M_start;
|
||||
iterator _M_finish;
|
||||
|
||||
_Deque_impl()
|
||||
: _Tp_alloc_type(), _M_map(0), _M_map_size(0),
|
||||
_M_start(), _M_finish()
|
||||
{ }
|
||||
|
||||
_Deque_impl(const _Tp_alloc_type& __a)
|
||||
: _Tp_alloc_type(__a), _M_map(0), _M_map_size(0),
|
||||
_M_start(), _M_finish()
|
||||
@ -679,8 +688,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
/**
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
deque()
|
||||
: _Base() { }
|
||||
|
||||
explicit
|
||||
deque(const allocator_type& __a = allocator_type())
|
||||
deque(const allocator_type& __a)
|
||||
: _Base(__a, 0) {}
|
||||
|
||||
/**
|
||||
|
@ -305,6 +305,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
{
|
||||
_List_node_base _M_node;
|
||||
|
||||
_List_impl()
|
||||
: _Node_alloc_type(), _M_node()
|
||||
{ }
|
||||
|
||||
_List_impl(const _Node_alloc_type& __a)
|
||||
: _Node_alloc_type(__a), _M_node()
|
||||
{ }
|
||||
@ -339,6 +343,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
get_allocator() const
|
||||
{ return allocator_type(_M_get_Node_allocator()); }
|
||||
|
||||
_List_base()
|
||||
: _M_impl()
|
||||
{ _M_init(); }
|
||||
|
||||
_List_base(const allocator_type& __a)
|
||||
: _M_impl(__a)
|
||||
{ _M_init(); }
|
||||
@ -468,8 +476,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
/**
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
list()
|
||||
: _Base() { }
|
||||
|
||||
explicit
|
||||
list(const allocator_type& __a = allocator_type())
|
||||
list(const allocator_type& __a)
|
||||
: _Base(__a) { }
|
||||
|
||||
/**
|
||||
|
@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
map()
|
||||
: _M_t(_Compare(), allocator_type()) { }
|
||||
: _M_t() { }
|
||||
|
||||
// for some reason this was made a separate function
|
||||
/**
|
||||
@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
*/
|
||||
template <typename _InputIterator>
|
||||
map(_InputIterator __first, _InputIterator __last)
|
||||
: _M_t(_Compare(), allocator_type())
|
||||
: _M_t()
|
||||
{ _M_t._M_insert_unique(__first, __last); }
|
||||
|
||||
/**
|
||||
|
@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
multimap()
|
||||
: _M_t(_Compare(), allocator_type()) { }
|
||||
: _M_t() { }
|
||||
|
||||
// for some reason this was made a separate function
|
||||
/**
|
||||
@ -184,8 +184,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
*/
|
||||
template <typename _InputIterator>
|
||||
multimap(_InputIterator __first, _InputIterator __last)
|
||||
: _M_t(_Compare(), allocator_type())
|
||||
{ _M_t._M_insert_equal(__first, __last); }
|
||||
: _M_t()
|
||||
{ _M_t._M_insert_unique(__first, __last); }
|
||||
|
||||
/**
|
||||
* @brief Builds a %multimap from a range.
|
||||
|
@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
multiset()
|
||||
: _M_t(_Compare(), allocator_type()) { }
|
||||
: _M_t() { }
|
||||
|
||||
explicit
|
||||
multiset(const _Compare& __comp,
|
||||
@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
*/
|
||||
template <class _InputIterator>
|
||||
multiset(_InputIterator __first, _InputIterator __last)
|
||||
: _M_t(_Compare(), allocator_type())
|
||||
: _M_t()
|
||||
{ _M_t._M_insert_equal(__first, __last); }
|
||||
|
||||
/**
|
||||
@ -180,7 +180,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* The newly-created %multiset uses a copy of the allocation object used
|
||||
* by @a x.
|
||||
*/
|
||||
multiset(const multiset<_Key,_Compare,_Alloc>& __x)
|
||||
multiset(const multiset& __x)
|
||||
: _M_t(__x._M_t) { }
|
||||
|
||||
/**
|
||||
@ -190,8 +190,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* All the elements of @a x are copied, but unlike the copy constructor,
|
||||
* the allocator object is not copied.
|
||||
*/
|
||||
multiset<_Key,_Compare,_Alloc>&
|
||||
operator=(const multiset<_Key,_Compare,_Alloc>& __x)
|
||||
multiset&
|
||||
operator=(const multiset& __x)
|
||||
{
|
||||
_M_t = __x._M_t;
|
||||
return *this;
|
||||
@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* std::swap(s1,s2) will feed to this function.
|
||||
*/
|
||||
void
|
||||
swap(multiset<_Key, _Compare, _Alloc>& __x)
|
||||
swap(multiset& __x)
|
||||
{ _M_t.swap(__x._M_t); }
|
||||
|
||||
// insert/erase
|
||||
|
@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
// allocation/deallocation
|
||||
/// Default constructor creates no elements.
|
||||
set()
|
||||
: _M_t(_Compare(), allocator_type()) {}
|
||||
: _M_t() { }
|
||||
|
||||
/**
|
||||
* @brief Default constructor creates no elements.
|
||||
@ -162,7 +162,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
*/
|
||||
template<class _InputIterator>
|
||||
set(_InputIterator __first, _InputIterator __last)
|
||||
: _M_t(_Compare(), allocator_type())
|
||||
: _M_t()
|
||||
{ _M_t._M_insert_unique(__first, __last); }
|
||||
|
||||
/**
|
||||
@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* The newly-created %set uses a copy of the allocation object used
|
||||
* by @a x.
|
||||
*/
|
||||
set(const set<_Key,_Compare,_Alloc>& __x)
|
||||
set(const set& __x)
|
||||
: _M_t(__x._M_t) { }
|
||||
|
||||
/**
|
||||
@ -200,8 +200,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* All the elements of @a x are copied, but unlike the copy constructor,
|
||||
* the allocator object is not copied.
|
||||
*/
|
||||
set<_Key,_Compare,_Alloc>&
|
||||
operator=(const set<_Key, _Compare, _Alloc>& __x)
|
||||
set&
|
||||
operator=(const set& __x)
|
||||
{
|
||||
_M_t = __x._M_t;
|
||||
return *this;
|
||||
@ -283,7 +283,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
* std::swap(s1,s2) will feed to this function.
|
||||
*/
|
||||
void
|
||||
swap(set<_Key,_Compare,_Alloc>& __x)
|
||||
swap(set& __x)
|
||||
{ _M_t.swap(__x._M_t); }
|
||||
|
||||
// insert/erase
|
||||
|
@ -410,10 +410,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
_Rb_tree_node_base _M_header;
|
||||
size_type _M_node_count; // Keeps track of size of tree.
|
||||
|
||||
_Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
|
||||
const _Key_compare& __comp = _Key_compare())
|
||||
: _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
|
||||
_Rb_tree_impl()
|
||||
: _Node_allocator(), _M_key_compare(), _M_header(),
|
||||
_M_node_count(0)
|
||||
{ _M_initialize(); }
|
||||
|
||||
_Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
|
||||
: _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
|
||||
_M_node_count(0)
|
||||
{ _M_initialize(); }
|
||||
|
||||
private:
|
||||
void
|
||||
_M_initialize()
|
||||
{
|
||||
this->_M_header._M_color = _S_red;
|
||||
this->_M_header._M_parent = 0;
|
||||
@ -431,11 +440,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
_Rb_tree_node_base _M_header;
|
||||
size_type _M_node_count; // Keeps track of size of tree.
|
||||
|
||||
_Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
|
||||
const _Key_compare& __comp = _Key_compare())
|
||||
_Rb_tree_impl()
|
||||
: _Node_allocator(), _M_key_compare(), _M_header(),
|
||||
_M_node_count(0)
|
||||
{ _M_initialize(); }
|
||||
|
||||
_Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
|
||||
: _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
|
||||
_M_node_count(0)
|
||||
{
|
||||
{ _M_initialize(); }
|
||||
|
||||
private:
|
||||
void
|
||||
_M_initialize()
|
||||
{
|
||||
this->_M_header._M_color = _S_red;
|
||||
this->_M_header._M_parent = 0;
|
||||
this->_M_header._M_left = &this->_M_header;
|
||||
@ -568,16 +586,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
_Rb_tree()
|
||||
{ }
|
||||
|
||||
_Rb_tree(const _Compare& __comp)
|
||||
: _M_impl(allocator_type(), __comp)
|
||||
_Rb_tree(const _Compare& __comp,
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _M_impl(__comp, __a)
|
||||
{ }
|
||||
|
||||
_Rb_tree(const _Compare& __comp, const allocator_type& __a)
|
||||
: _M_impl(__a, __comp)
|
||||
{ }
|
||||
|
||||
_Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
|
||||
: _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare)
|
||||
_Rb_tree(const _Rb_tree& __x)
|
||||
: _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
|
||||
{
|
||||
if (__x._M_root() != 0)
|
||||
{
|
||||
@ -591,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
~_Rb_tree()
|
||||
{ _M_erase(_M_begin()); }
|
||||
|
||||
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
|
||||
operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x);
|
||||
_Rb_tree&
|
||||
operator=(const _Rb_tree& __x);
|
||||
|
||||
// Accessors.
|
||||
_Compare
|
||||
@ -653,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
{ return get_allocator().max_size(); }
|
||||
|
||||
void
|
||||
swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t);
|
||||
swap(_Rb_tree& __t);
|
||||
|
||||
// Insert/erase.
|
||||
pair<iterator, bool>
|
||||
|
@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
_Tp* _M_start;
|
||||
_Tp* _M_finish;
|
||||
_Tp* _M_end_of_storage;
|
||||
|
||||
_Vector_impl()
|
||||
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
|
||||
{ }
|
||||
|
||||
_Vector_impl(_Tp_alloc_type const& __a)
|
||||
: _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
|
||||
{ }
|
||||
@ -104,6 +109,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
get_allocator() const
|
||||
{ return allocator_type(_M_get_Tp_allocator()); }
|
||||
|
||||
_Vector_base()
|
||||
: _M_impl() { }
|
||||
|
||||
_Vector_base(const allocator_type& __a)
|
||||
: _M_impl(__a)
|
||||
{ }
|
||||
@ -194,8 +202,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
|
||||
/**
|
||||
* @brief Default constructor creates no elements.
|
||||
*/
|
||||
vector()
|
||||
: _Base() { }
|
||||
|
||||
explicit
|
||||
vector(const allocator_type& __a = allocator_type())
|
||||
vector(const allocator_type& __a)
|
||||
: _Base(__a)
|
||||
{ }
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
SUBDIR= sendmail
|
||||
.endif
|
||||
|
||||
BIN1= auth.conf \
|
||||
crontab \
|
||||
BIN1= crontab \
|
||||
devd.conf \
|
||||
devfs.conf \
|
||||
ddb.conf \
|
||||
|
@ -1,8 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Configure some authentication-related defaults. This file is being
|
||||
# gradually subsumed by user class and PAM configuration.
|
||||
#
|
||||
|
||||
# crypt_default = md5 des
|
@ -59,7 +59,7 @@
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if the target supports thread-local storage. */
|
||||
#if !defined(__arm__) && !defined(__mips__)
|
||||
#if !defined(__mips__)
|
||||
#define HAVE_TLS 1
|
||||
#endif
|
||||
|
||||
|
@ -371,7 +371,7 @@
|
||||
/* #undef HAVE_TANL */
|
||||
|
||||
/* Define to 1 if the target supports thread-local storage. */
|
||||
#if !defined(__arm__) && !defined(__mips__)
|
||||
#if !defined(__mips__)
|
||||
#define HAVE_TLS 1
|
||||
#endif
|
||||
|
||||
|
@ -126,26 +126,22 @@ CXXABI_1.3 {
|
||||
# __gnu_cxx::_verbose_terminate_handler()
|
||||
_ZN9__gnu_cxx27__verbose_terminate_handlerEv;
|
||||
|
||||
# operator new and new[], 32-bit size_t
|
||||
_Znaj;
|
||||
_ZnajRKSt9nothrow_t;
|
||||
_Znwj;
|
||||
_ZnwjRKSt9nothrow_t;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
# operator new and new[], 64-bit size_t
|
||||
_Znam;
|
||||
_ZnamRKSt9nothrow_t;
|
||||
_Znwm;
|
||||
_ZnwmRKSt9nothrow_t;
|
||||
GLIBCXX_3.4 {
|
||||
# operator new and new[]
|
||||
_Znai[jm];
|
||||
_Zna[jm]RKSt9nothrow_t;
|
||||
_Znw[jm];
|
||||
_Znw[jm]RKSt9nothrow_t;
|
||||
|
||||
# operator delete and delete[]
|
||||
_ZdaPv;
|
||||
_ZdaPvRKSt9nothrow_t;
|
||||
_ZdlPv;
|
||||
_ZdlPvRKSt9nothrow_t;
|
||||
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
CXXABI_1.3.1 {
|
||||
|
@ -42,7 +42,6 @@
|
||||
/* Locate system binaries. */
|
||||
#define _PATH_SYSPATH "/sbin:/usr/sbin"
|
||||
|
||||
#define _PATH_AUTHCONF "/etc/auth.conf"
|
||||
#define _PATH_BSHELL "/bin/sh"
|
||||
#define _PATH_CAPABILITY "/etc/capability"
|
||||
#define _PATH_CAPABILITY_DB "/etc/capability.db"
|
||||
|
@ -33,6 +33,10 @@ FBSD_1.0 {
|
||||
sbrk;
|
||||
};
|
||||
|
||||
FBSD_1.3 {
|
||||
__flt_rounds;
|
||||
};
|
||||
|
||||
FBSDprivate_1.0 {
|
||||
/* PSEUDO syscalls */
|
||||
__sys_getlogin;
|
||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fstab.h>
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
@ -246,6 +247,8 @@ getfsfile(name)
|
||||
int
|
||||
setfsent()
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (_fs_fp) {
|
||||
rewind(_fs_fp);
|
||||
LineNo = 0;
|
||||
@ -257,11 +260,18 @@ setfsent()
|
||||
else
|
||||
setfstab(getenv("PATH_FSTAB"));
|
||||
}
|
||||
if ((_fs_fp = fopen(path_fstab, "r")) != NULL) {
|
||||
fd = _open(path_fstab, O_RDONLY | O_CLOEXEC);
|
||||
if (fd == -1) {
|
||||
error(errno);
|
||||
return (0);
|
||||
}
|
||||
_fs_fp = fdopen(fd, "r");
|
||||
if (_fs_fp != NULL) {
|
||||
LineNo = 0;
|
||||
return(1);
|
||||
}
|
||||
error(errno);
|
||||
_close(fd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -161,8 +161,7 @@ setnetgrent(const char *group)
|
||||
if (group == NULL || !strlen(group))
|
||||
return;
|
||||
|
||||
if (grouphead.gr == (struct netgrp *)0 ||
|
||||
strcmp(group, grouphead.grname)) {
|
||||
if (grouphead.gr == NULL || strcmp(group, grouphead.grname)) {
|
||||
endnetgrent();
|
||||
#ifdef YP
|
||||
/* Presumed guilty until proven innocent. */
|
||||
@ -172,7 +171,7 @@ setnetgrent(const char *group)
|
||||
* use NIS exclusively.
|
||||
*/
|
||||
if (((stat(_PATH_NETGROUP, &_yp_statp) < 0) &&
|
||||
errno == ENOENT) || _yp_statp.st_size == 0)
|
||||
errno == ENOENT) || _yp_statp.st_size == 0)
|
||||
_use_only_yp = _netgr_yp_enabled = 1;
|
||||
if ((netf = fopen(_PATH_NETGROUP,"r")) != NULL ||_use_only_yp){
|
||||
/*
|
||||
@ -247,27 +246,24 @@ endnetgrent(void)
|
||||
lp = lp->l_next;
|
||||
free(olp->l_groupname);
|
||||
free(olp->l_line);
|
||||
free((char *)olp);
|
||||
free(olp);
|
||||
}
|
||||
linehead = (struct linelist *)0;
|
||||
linehead = NULL;
|
||||
if (grouphead.grname) {
|
||||
free(grouphead.grname);
|
||||
grouphead.grname = (char *)0;
|
||||
grouphead.grname = NULL;
|
||||
}
|
||||
gp = grouphead.gr;
|
||||
while (gp) {
|
||||
ogp = gp;
|
||||
gp = gp->ng_next;
|
||||
if (ogp->ng_str[NG_HOST])
|
||||
free(ogp->ng_str[NG_HOST]);
|
||||
if (ogp->ng_str[NG_USER])
|
||||
free(ogp->ng_str[NG_USER]);
|
||||
if (ogp->ng_str[NG_DOM])
|
||||
free(ogp->ng_str[NG_DOM]);
|
||||
free((char *)ogp);
|
||||
free(ogp->ng_str[NG_HOST]);
|
||||
free(ogp->ng_str[NG_USER]);
|
||||
free(ogp->ng_str[NG_DOM]);
|
||||
free(ogp);
|
||||
}
|
||||
grouphead.gr = (struct netgrp *)0;
|
||||
nextgrp = (struct netgrp *)0;
|
||||
grouphead.gr = NULL;
|
||||
nextgrp = NULL;
|
||||
#ifdef YP
|
||||
_netgr_yp_enabled = 0;
|
||||
#endif
|
||||
@ -282,7 +278,7 @@ _listmatch(const char *list, const char *group, int len)
|
||||
int glen = strlen(group);
|
||||
|
||||
/* skip possible leading whitespace */
|
||||
while(isspace((unsigned char)*ptr))
|
||||
while (isspace((unsigned char)*ptr))
|
||||
ptr++;
|
||||
|
||||
while (ptr < list + len) {
|
||||
@ -291,7 +287,7 @@ _listmatch(const char *list, const char *group, int len)
|
||||
ptr++;
|
||||
if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr))
|
||||
return (1);
|
||||
while(*ptr == ',' || isspace((unsigned char)*ptr))
|
||||
while (*ptr == ',' || isspace((unsigned char)*ptr))
|
||||
ptr++;
|
||||
}
|
||||
|
||||
@ -436,8 +432,7 @@ parse_netgrp(const char *group)
|
||||
break;
|
||||
lp = lp->l_next;
|
||||
}
|
||||
if (lp == (struct linelist *)0 &&
|
||||
(lp = read_for_group(group)) == (struct linelist *)0)
|
||||
if (lp == NULL && (lp = read_for_group(group)) == NULL)
|
||||
return (1);
|
||||
if (lp->l_parsed) {
|
||||
#ifdef DEBUG
|
||||
@ -538,7 +533,7 @@ parse_netgrp(const char *group)
|
||||
static struct linelist *
|
||||
read_for_group(const char *group)
|
||||
{
|
||||
char *pos, *spos, *linep;
|
||||
char *linep, *olinep, *pos, *spos;
|
||||
int len, olen;
|
||||
int cont;
|
||||
struct linelist *lp;
|
||||
@ -615,15 +610,20 @@ read_for_group(const char *group)
|
||||
} else
|
||||
cont = 0;
|
||||
if (len > 0) {
|
||||
linep = reallocf(linep, olen + len + 1);
|
||||
linep = malloc(olen + len + 1);
|
||||
if (linep == NULL) {
|
||||
free(lp->l_groupname);
|
||||
free(lp);
|
||||
return (NULL);
|
||||
}
|
||||
if (olen > 0) {
|
||||
bcopy(olinep, linep, olen);
|
||||
free(olinep);
|
||||
}
|
||||
bcopy(pos, linep + olen, len);
|
||||
olen += len;
|
||||
*(linep + olen) = '\0';
|
||||
olinep = linep;
|
||||
}
|
||||
if (cont) {
|
||||
if (fgets(line, LINSIZ, netf)) {
|
||||
|
@ -38,20 +38,11 @@
|
||||
.Lb libc
|
||||
.Sh SYNOPSIS
|
||||
.In signal.h
|
||||
.\" XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
|
||||
.\" The prototype for signal(3) cannot be cleanly marked up in -mdoc
|
||||
.\" without the following lower-level tweak.
|
||||
.nr in-synopsis-section 0
|
||||
.\" The following is Quite Ugly, but syntactically correct.
|
||||
.\" Don't try to fix it.
|
||||
.Ft void
|
||||
.Fn \*(lp*signal "int sig" "void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint"
|
||||
.Pp
|
||||
.Ft "void \*(lp*" Ns
|
||||
.Fo signal
|
||||
.Fa "int sig"
|
||||
.Fa "void \*(lp*func\*(rp\*(lpint\*(rp"
|
||||
.Fc Ns
|
||||
.Ft "\*(rp\*(lpint\*(rp" ;
|
||||
.Pp
|
||||
.nr in-synopsis-section 1
|
||||
.\" XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
|
||||
or in
|
||||
.Fx Ap s
|
||||
equivalent but easier to read typedef'd version:
|
||||
@ -98,7 +89,7 @@ an interrupt.
|
||||
These signals are defined in the file
|
||||
.In signal.h :
|
||||
.Bl -column No ".Dv SIGVTALRM" "create core image"
|
||||
.It Sy "No Name Default Action Description"
|
||||
.It Sy "Num" Ta Sy "Name" Ta Sy "Default Action" Ta Sy "Description"
|
||||
.It 1 Ta Dv SIGHUP Ta "terminate process" Ta "terminal line hangup"
|
||||
.It 2 Ta Dv SIGINT Ta "terminate process" Ta "interrupt program"
|
||||
.It 3 Ta Dv SIGQUIT Ta "create core image" Ta "quit program"
|
||||
|
@ -89,6 +89,17 @@ const _RuneLocale *__getCurrentRuneLocale(void)
|
||||
return XLOCALE_CTYPE(__get_locale())->runes;
|
||||
}
|
||||
|
||||
static void free_runes(_RuneLocale *rl)
|
||||
{
|
||||
/* FIXME: The "EUC" check here is a hideous abstraction violation. */
|
||||
if ((rl != &_DefaultRuneLocale) && (rl)) {
|
||||
if (strcmp(rl->__encoding, "EUC") == 0) {
|
||||
free(rl->__variable);
|
||||
}
|
||||
free(rl);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
__setrunelocale(struct xlocale_ctype *l, const char *encoding)
|
||||
{
|
||||
@ -102,6 +113,7 @@ __setrunelocale(struct xlocale_ctype *l, const char *encoding)
|
||||
* The "C" and "POSIX" locale are always here.
|
||||
*/
|
||||
if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) {
|
||||
free_runes(saved.runes);
|
||||
(void) _none_init(l, (_RuneLocale*)&_DefaultRuneLocale);
|
||||
return (0);
|
||||
}
|
||||
@ -153,13 +165,7 @@ __setrunelocale(struct xlocale_ctype *l, const char *encoding)
|
||||
|
||||
if (ret == 0) {
|
||||
/* Free the old runes if it exists. */
|
||||
/* FIXME: The "EUC" check here is a hideous abstraction violation. */
|
||||
if ((saved.runes != &_DefaultRuneLocale) && (saved.runes)) {
|
||||
if (strcmp(saved.runes->__encoding, "EUC") == 0) {
|
||||
free(saved.runes->__variable);
|
||||
}
|
||||
free(saved.runes);
|
||||
}
|
||||
free_runes(saved.runes);
|
||||
} else {
|
||||
/* Restore the saved version if this failed. */
|
||||
memcpy(l, &saved, sizeof(struct xlocale_ctype));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: getopt_long.c,v 1.21 2006/09/22 17:22:05 millert Exp $ */
|
||||
/* $OpenBSD: getopt_long.c,v 1.22 2006/10/04 21:29:04 jmc Exp $ */
|
||||
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
|
||||
|
||||
/*
|
||||
@ -35,13 +35,6 @@
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
|
@ -26,11 +26,7 @@ SRCS+= crypt-des.c crypt-blowfish.c blowfish.c
|
||||
CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
|
||||
.endif
|
||||
|
||||
# And the auth_getval() code and support.
|
||||
.PATH: ${.CURDIR}/../libutil
|
||||
SRCS+= auth.c property.c
|
||||
.for sym in auth_getval property_find properties_read properties_free \
|
||||
MD4Init MD4Final MD4Update MD4Pad \
|
||||
.for sym in MD4Init MD4Final MD4Update MD4Pad \
|
||||
MD5Init MD5Final MD5Update MD5Pad \
|
||||
SHA256_Init SHA256_Final SHA256_Update \
|
||||
SHA512_Init SHA512_Final SHA512_Update
|
||||
|
@ -238,12 +238,6 @@ The
|
||||
.Fn crypt_set_format
|
||||
function sets the default encoding format according to the supplied
|
||||
.Fa string .
|
||||
.Pp
|
||||
The global default format can be set using the
|
||||
.Pa /etc/auth.conf
|
||||
file using the
|
||||
.Va crypt_default
|
||||
property.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn crypt
|
||||
@ -260,9 +254,7 @@ Otherwise, a value of 0 is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr login 1 ,
|
||||
.Xr passwd 1 ,
|
||||
.Xr auth_getval 3 ,
|
||||
.Xr getpass 3 ,
|
||||
.Xr auth.conf 5 ,
|
||||
.Xr passwd 5
|
||||
.Sh HISTORY
|
||||
A rotor-based
|
||||
|
@ -79,23 +79,23 @@ static const struct {
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef HAS_DES
|
||||
#define CRYPT_DEFAULT "des"
|
||||
#else
|
||||
#define CRYPT_DEFAULT "md5"
|
||||
#endif
|
||||
|
||||
static int crypt_type = -1;
|
||||
|
||||
static void
|
||||
crypt_setdefault(void)
|
||||
{
|
||||
char *def;
|
||||
size_t i;
|
||||
|
||||
if (crypt_type != -1)
|
||||
return;
|
||||
def = auth_getval("crypt_default");
|
||||
if (def == NULL) {
|
||||
crypt_type = 0;
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) {
|
||||
if (strcmp(def, crypt_types[i].name) == 0) {
|
||||
if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) {
|
||||
crypt_type = (int)i;
|
||||
return;
|
||||
}
|
||||
|
@ -306,11 +306,6 @@ CXXRT_1.0 {
|
||||
"std::type_info::__is_pointer_p() const";
|
||||
|
||||
|
||||
"operator delete[](void*)";
|
||||
"operator delete(void*)";
|
||||
"operator new[](unsigned long)";
|
||||
"operator new(unsigned long)";
|
||||
"operator new(unsigned long, std::nothrow_t const&)";
|
||||
|
||||
};
|
||||
__cxa_allocate_dependent_exception;
|
||||
@ -321,3 +316,16 @@ CXXRT_1.0 {
|
||||
__cxa_rethrow_primary_exception;
|
||||
|
||||
} CXXABI_1.3.1;
|
||||
|
||||
GLIBCXX_3.4 {
|
||||
extern "C++" {
|
||||
"operator delete[](void*)";
|
||||
"operator delete(void*)";
|
||||
"operator new[](unsigned int)";
|
||||
"operator new(unsigned int)";
|
||||
"operator new(unsigned int, std::nothrow_t const&)";
|
||||
"operator new[](unsigned long)";
|
||||
"operator new(unsigned long)";
|
||||
"operator new(unsigned long, std::nothrow_t const&)";
|
||||
};
|
||||
};
|
||||
|
@ -212,7 +212,7 @@ exist in version 1 of the GSS-API specification, so applications that
|
||||
wish to run over version 1 implementations must special-case these
|
||||
codes.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It input_chan_bindings"
|
||||
.It context_handle
|
||||
Context handle for new context.
|
||||
Supply
|
||||
@ -400,7 +400,7 @@ Specify
|
||||
Mechanism specific status code.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL"
|
||||
.It GSS_S_CONTINUE_NEEDED
|
||||
Indicates that a token from the peer application is required to
|
||||
complete the context,
|
||||
@ -442,7 +442,7 @@ the implementation or the provided credential.
|
||||
.Xr gss_release_name 3 ,
|
||||
.Xr gss_wrap 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -126,7 +126,7 @@ immediately following the call of
|
||||
must return valid credential data,
|
||||
and may therefore incur the overhead of a deferred credential acquisition.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It output_cred_handle"
|
||||
.It desired_name
|
||||
Name of principal whose credential should be acquired.
|
||||
.It time_req
|
||||
@ -174,7 +174,7 @@ Specify NULL if not required.
|
||||
Mechanism specific status code.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_BAD_MECH
|
||||
@ -196,7 +196,7 @@ No credentials were found for the specified name.
|
||||
.Xr gss_release_cred 3 ,
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -170,7 +170,7 @@ a non-
|
||||
.Fa output_cred_handle
|
||||
must be supplied.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It output_cred_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_cred_handle
|
||||
@ -270,7 +270,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_BAD_MECH
|
||||
@ -296,7 +296,7 @@ No credentials were found for the specified name.
|
||||
.Xr gss_release_cred 3 ,
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -71,7 +71,7 @@ the
|
||||
.Fa oid_set
|
||||
should remain unchanged.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It member_oid
|
||||
@ -80,7 +80,7 @@ The object identifier to copied into the set.
|
||||
The set in which the object identifier should be inserted.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
@ -88,7 +88,7 @@ Successful completion
|
||||
.Xr gss_create_empty_oid_set 3 ,
|
||||
.Xr gss_acquire_cred 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -62,7 +62,7 @@ specifying
|
||||
.Fa mech_type
|
||||
as the authentication mechanism.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_name
|
||||
@ -79,7 +79,7 @@ after use with a call to
|
||||
.Fn gss_release_name .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_BAD_NAMETYPE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_BAD_MECH
|
||||
@ -95,7 +95,7 @@ The provided internal name was ill-formed.
|
||||
.Xr gss_init_sec_context 3 ,
|
||||
.Xr gss_release_name 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -54,7 +54,7 @@ denotes an anonymous principal,
|
||||
the routines should indicate that the two names do not refer to the
|
||||
same identity.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width "minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It name1
|
||||
@ -62,7 +62,7 @@ Internal-form name.
|
||||
.It name2
|
||||
Internal-form name.
|
||||
.It name_equal
|
||||
.Bl -tag
|
||||
.Bl -tag -width "non-zero"
|
||||
.It non-zero
|
||||
Names refer to same entity
|
||||
.It zero
|
||||
@ -71,7 +71,7 @@ to refer to the same identity).
|
||||
.El
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_BAD_NAMETYPE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAMETYPE
|
||||
@ -80,7 +80,7 @@ The two names were of incomparable types.
|
||||
One or both of name1 or name2 was ill-formed.
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -47,7 +47,7 @@
|
||||
Determines the number of seconds for which the specified context will
|
||||
remain valid.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It context_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -57,7 +57,7 @@ Number of seconds that the context will remain valid.
|
||||
If the context has already expired, zero will be returned.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_CONTEXT_EXPIRED
|
||||
@ -66,7 +66,7 @@ The context has already expired
|
||||
The context_handle parameter did not identify a valid context
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -51,7 +51,7 @@ These routines are intended to be used to construct sets of mechanism
|
||||
object identifiers for input to
|
||||
.Fn gss_acquire_cred .
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It oid_set
|
||||
@ -61,7 +61,7 @@ which the application must free after use with a call to
|
||||
.Fn gss_release_oid_set .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
@ -69,7 +69,7 @@ Successful completion
|
||||
.Xr gss_add_oid_set_member 3 ,
|
||||
.Xr gss_acquire_cred 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -88,7 +88,7 @@ mechanisms are encouraged to return a zero-length token,
|
||||
indicating that no peer action is necessary,
|
||||
and that no token should be transferred by the application.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It context_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -110,7 +110,7 @@ field of this token to zero to indicate to the application that no
|
||||
token is to be sent to the peer.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It context_handle"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CONTEXT
|
||||
@ -121,7 +121,7 @@ No valid context was supplied
|
||||
.Xr gss_init_sec_context 3 ,
|
||||
.Xr gss_accept_sec_context 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -76,7 +76,7 @@ via the
|
||||
.Fa output_name_type
|
||||
parameter.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It output_name_buffer"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_name
|
||||
@ -98,7 +98,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAME
|
||||
@ -109,7 +109,7 @@ was ill-formed
|
||||
.Xr gss_import_name 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -111,13 +111,13 @@ do {
|
||||
} while (message_context != 0);
|
||||
.Ed
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It status_value
|
||||
Status value to be converted
|
||||
.It status_type
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_C_MECH_CODE"
|
||||
.It GSS_C_GSS_CODE
|
||||
.Fa status_value
|
||||
is a GSS status code
|
||||
@ -153,7 +153,7 @@ application after use with a call to
|
||||
.Fn gss_release_buffer .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_BAD_STATUS"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_MECH
|
||||
@ -168,7 +168,7 @@ nor
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -57,7 +57,7 @@ and
|
||||
must both be released,
|
||||
and the release of one shall not affect the validity of the other).
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It src_name
|
||||
@ -70,7 +70,7 @@ after use with a call to
|
||||
.Fn gss_release_name .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAME
|
||||
@ -81,7 +81,7 @@ parameter was ill-formed
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_name 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -58,7 +58,7 @@ parameter must specify a valid MN
|
||||
or by
|
||||
.Fn gss_canonicalize_name ).
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It exported_name"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_name
|
||||
@ -71,7 +71,7 @@ after use with
|
||||
.Fn gss_release_buffer .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_BAD_NAMETYPE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NAME_NOT_MN
|
||||
@ -86,7 +86,7 @@ The internal name was of a type not supported by the GSS-API implementation.
|
||||
.Xr gss_canonicalize_name 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -100,7 +100,7 @@ providing it also sets the
|
||||
parameter to
|
||||
.Dv GSS_C_NO_CONTEXT .
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It interprocess_token"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -112,7 +112,7 @@ after use with a call to
|
||||
.Fn gss_release_buffer .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_CONTEXT_EXPIRED
|
||||
@ -126,7 +126,7 @@ The operation is not supported
|
||||
.Xr gss_import_sec_context 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -81,7 +81,7 @@ both to allow GSS-API V1 applications to link
|
||||
and to retain the slight parameter type differences between the
|
||||
obsolete versions of this routine and its current form.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It message_buffer"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -109,7 +109,7 @@ use with a call to
|
||||
.Fn gss_release_buffer .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_CONTEXT_EXPIRED
|
||||
@ -123,7 +123,7 @@ The specified QOP is not supported by the mechanism
|
||||
.Xr gss_wrap 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -59,7 +59,7 @@ parameter is of type
|
||||
in which case the returned internal name will be an MN for the
|
||||
mechanism that exported the name.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It input_name_buffer"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_name_buffer
|
||||
@ -78,7 +78,7 @@ after use with a call to
|
||||
.Fn gss_release_name .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width "It GSS_S_BAD_NAMETYPE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAMETYPE
|
||||
@ -97,7 +97,7 @@ but the mechanism contained within the input-name is not supported
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_name 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -50,7 +50,7 @@ A given interprocess token may be imported only once.
|
||||
See
|
||||
.Fn gss_export_sec_context .
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It interprocess_token"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It interprocess_token
|
||||
@ -62,7 +62,7 @@ application after use with a call to
|
||||
.Fn gss_delete_sec_context .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_DEFECTIVE_TOKEN"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CONTEXT
|
||||
@ -78,7 +78,7 @@ Local policy prevents the import of this context by the current process
|
||||
.Xr gss_export_sec_context 3 ,
|
||||
.Xr gss_delete_sec_context 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -46,7 +46,7 @@
|
||||
Allows an application to determine which underlying security
|
||||
mechanisms are available.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It mech_set
|
||||
@ -58,14 +58,14 @@ that should be released by the caller after use with a call to
|
||||
.Fn gss_release_oid_set .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -233,7 +233,7 @@ exist in version 1 of the GSS-API specification, so applications that
|
||||
wish to run over version 1 implementations must special-case these
|
||||
codes.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It initiator_cred_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It initiator_cred_handle
|
||||
@ -475,7 +475,7 @@ not support context expiration, the value
|
||||
.Dv NULL if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_CONTINUE_NEEDED
|
||||
@ -529,7 +529,7 @@ implementation.
|
||||
.Xr gss_release_buffer 3 ,
|
||||
.Xr gss_wrap 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -55,7 +55,7 @@ The caller must already have obtained a handle that refers to the
|
||||
context,
|
||||
although the context need not be fully established.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It locally_initiated"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -229,7 +229,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_NO_CONTEXT"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CONTEXT
|
||||
@ -242,7 +242,7 @@ The referenced context could not be accessed
|
||||
.Xr gss_get_mic 3 ,
|
||||
.Xr gss_export_sec_context 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -50,7 +50,7 @@
|
||||
.Sh DESCRIPTION
|
||||
Obtains information about a credential.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It cred_handle
|
||||
@ -99,7 +99,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CRED
|
||||
@ -116,7 +116,7 @@ it will be set to 0
|
||||
.Xr gss_release_name 3 ,
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -50,7 +50,7 @@
|
||||
.Sh DESCRIPTION
|
||||
Obtains per-mechanism information about a credential.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It initiator_lifetime"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It cred_handle
|
||||
@ -114,7 +114,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CRED
|
||||
@ -130,7 +130,7 @@ it will be set to 0.
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_name 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -68,7 +68,7 @@ type).
|
||||
Thus this routine should be used only as a pre-filter for a call to a
|
||||
subsequent mechanism-specific routine.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It input_name
|
||||
@ -80,7 +80,7 @@ to
|
||||
.Fn gss_release_oid_set .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAME
|
||||
@ -91,7 +91,7 @@ parameter was ill-formed
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -46,7 +46,7 @@
|
||||
.Sh DESCRIPTION
|
||||
Returns the set of name-types supported by the specified mechanism.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It mechanism
|
||||
@ -58,14 +58,14 @@ call to
|
||||
.Fn gss_release_oid_set .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width "GSS_S_COMPLETEXX"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_release_oid_set 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -71,7 +71,7 @@ believing that the context is fully established.
|
||||
.Fn gss_process_context_token
|
||||
provides a way to pass such a token to the mechanism at any time.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It context_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -80,7 +80,7 @@ Context handle of context on which token is to be processed.
|
||||
Token to process.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_DEFECTIVE_TOKEN"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_DEFECTIVE_TOKEN
|
||||
@ -94,7 +94,7 @@ did not refer to a valid context
|
||||
.Xr gss_init_sec_context 3 ,
|
||||
.Xr gss_accept_sec_context 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -55,7 +55,7 @@ Any buffer object returned by a GSS-API routine may be passed to
|
||||
.Fn gss_release_buffer
|
||||
(even if there is no storage associated with the buffer).
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It buffer
|
||||
@ -64,12 +64,12 @@ The gss_buffer_desc object will not be freed,
|
||||
but its length field will be zeroed.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -50,7 +50,7 @@ Implementations are encouraged to set the cred_handle to
|
||||
.Dv GSS_C_NO_CREDENTIAL
|
||||
on successful completion of this call.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It cred_handle
|
||||
@ -59,14 +59,14 @@ If GSS_C_NO_CREDENTIAL is supplied,
|
||||
the routine will complete successfully, but will do nothing.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_NO_CRED
|
||||
Credentials could not be accessed
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -48,21 +48,21 @@ Implementations are encouraged to set the name to
|
||||
.Dv GSS_C_NO_NAME
|
||||
on successful completion of this call.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It name
|
||||
The name to be deleted.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_BAD_NAME
|
||||
The name parameter did not contain a valid name
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -55,19 +55,19 @@ Implementations are encouraged to set the gss_OID_set parameter to
|
||||
.Dv GSS_C_NO_OID_SET
|
||||
on successful completion of this routine.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It set
|
||||
The storage associated with the gss_OID_set will be deleted.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -54,7 +54,7 @@ and
|
||||
.Fn gss_inquire_cred ,
|
||||
but will also work with user-generated sets.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It minor_status"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It member
|
||||
@ -65,7 +65,7 @@ The Object Identifier set.
|
||||
Non-zero if the specified OID is a member of the set, zero if not.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_COMPLETE"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.El
|
||||
@ -74,7 +74,7 @@ Successful completion
|
||||
.Xr gss_acquire_cred 3 ,
|
||||
.Xr gss_inquire_cred 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -90,7 +90,7 @@ both to allow GSS-API V1 applications to link
|
||||
and to retain the slight parameter type differences between the
|
||||
obsolete versions of this routine and its current form.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It output_message_buffer"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -116,7 +116,7 @@ Specify NULL if not required.
|
||||
Quality of protection provided. Specify NULL if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_DEFECTIVE_TOKEN
|
||||
@ -150,7 +150,7 @@ The context_handle parameter did not identify a valid context.
|
||||
.Xr gss_wrap 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -81,7 +81,7 @@ both to allow GSS-API V1 applications to link
|
||||
and to retain the slight parameter type differences between the
|
||||
obsolete versions of this routine and its current form.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It context_handle"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -97,7 +97,7 @@ Specify
|
||||
if not required.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion
|
||||
.It GSS_S_DEFECTIVE_TOKEN
|
||||
@ -130,7 +130,7 @@ The context_handle parameter did not identify a valid context
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_wrap 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -85,13 +85,13 @@ both to allow GSS-API V1 applications to link
|
||||
and to retain the slight parameter type differences between the
|
||||
obsolete versions of this routine and its current form.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It output_message_buffer"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
Identifies the context on which the message will be sent.
|
||||
.It conf_req_flag
|
||||
.Bl -tag -width "Non-zero"
|
||||
.Bl -tag -width "Non-zero" -compact
|
||||
.It Non-zero
|
||||
Both confidentiality and integrity services are requested.
|
||||
.It Zero
|
||||
@ -108,7 +108,7 @@ will return a major_status of
|
||||
.It input_message_buffer
|
||||
Message to be protected.
|
||||
.It conf_state
|
||||
.Bl -tag -width "Non-zero"
|
||||
.Bl -tag -width "Non-zero" -compact
|
||||
.It Non-zero
|
||||
Confidentiality, data origin authentication and integrity services
|
||||
have been applied.
|
||||
@ -123,7 +123,7 @@ with a call to
|
||||
.Xr gss_release_buffer 3 .
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_CONTEXT_EXPIRED
|
||||
@ -137,7 +137,7 @@ The specified QOP is not supported by the mechanism.
|
||||
.Xr gss_unwrap 3 ,
|
||||
.Xr gss_release_buffer 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -83,7 +83,7 @@ the implementation should not return a value via
|
||||
.Dv max_input_bytes
|
||||
that is greater than this length.
|
||||
.Sh PARAMETERS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It req_output_size"
|
||||
.It minor_status
|
||||
Mechanism specific status code.
|
||||
.It context_handle
|
||||
@ -109,7 +109,7 @@ be no larger than
|
||||
bytes.
|
||||
.El
|
||||
.Sh RETURN VALUES
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
|
||||
.It GSS_S_COMPLETE
|
||||
Successful completion.
|
||||
.It GSS_S_NO_CONTEXT
|
||||
@ -122,7 +122,7 @@ The specified QOP is not supported by the mechanism.
|
||||
.Sh SEE ALSO
|
||||
.Xr gss_wrap 3
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -219,7 +219,7 @@ functionality is not available from the generic forms.
|
||||
Applications are encouraged to use the generic routines wherever
|
||||
possible on portability grounds.
|
||||
.Sh STANDARDS
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It RFC 2743"
|
||||
.It RFC 2743
|
||||
Generic Security Service Application Program Interface Version 2, Update 1
|
||||
.It RFC 2744
|
||||
|
@ -39,17 +39,17 @@ The
|
||||
file contains a list of installed GSS-API security mechanisms.
|
||||
Each line of the file either contains a comment if the first character
|
||||
is '#' or it contains five fields with the following meanings:
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It Object identifier"
|
||||
.It Name
|
||||
The name of this GSS-API mechanism.
|
||||
.It Object identifier
|
||||
The OID for this mechanism.
|
||||
.It Library
|
||||
A shared library containing the implementation of this mechanism.
|
||||
.It Kernel module (optional)
|
||||
A kernel module containing the implementation of this mechanism (not
|
||||
.It Kernel module
|
||||
Optional kernel module containing the implementation of this mechanism (not
|
||||
yet supported in FreeBSD).
|
||||
.It Library options (optional)
|
||||
.It Library options
|
||||
Optional parameters interpreted by the mechanism. Library options
|
||||
must be enclosed in brackets ([ ]) to differentiate them from the
|
||||
optional kernel module entry.
|
||||
@ -68,7 +68,7 @@ file contains a list of Quality of Protection values for use with
|
||||
GSS-API.
|
||||
Each line of the file either contains a comment if the first character
|
||||
is '#' or it contains three fields with the following meanings:
|
||||
.Bl -tag
|
||||
.Bl -tag -width ".It Mechanism name"
|
||||
.It QOP string
|
||||
The name of this Quality of Protection algorithm.
|
||||
.It QOP value
|
||||
|
@ -1,9 +1,10 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SHLIBDIR?= /lib
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
LIB= kiconv
|
||||
SHLIBDIR?= /lib
|
||||
SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c
|
||||
SRCS+= quirks.c
|
||||
|
||||
|
@ -18,6 +18,9 @@ NOGCCERROR=
|
||||
|
||||
WARNS?= 2
|
||||
|
||||
DPADD= ${LIBPTHREAD}
|
||||
LDADD= -lpthread
|
||||
|
||||
MLINKS+= libusb.3 usb.3
|
||||
|
||||
# libusb 0.1 compat
|
||||
|
@ -92,6 +92,7 @@ int
|
||||
libusb_init(libusb_context **context)
|
||||
{
|
||||
struct libusb_context *ctx;
|
||||
pthread_condattr_t attr;
|
||||
char *debug;
|
||||
int ret;
|
||||
|
||||
@ -110,8 +111,28 @@ libusb_init(libusb_context **context)
|
||||
TAILQ_INIT(&ctx->pollfds);
|
||||
TAILQ_INIT(&ctx->tr_done);
|
||||
|
||||
pthread_mutex_init(&ctx->ctx_lock, NULL);
|
||||
pthread_cond_init(&ctx->ctx_cond, NULL);
|
||||
if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) {
|
||||
free(ctx);
|
||||
return (LIBUSB_ERROR_NO_MEM);
|
||||
}
|
||||
if (pthread_condattr_init(&attr) != 0) {
|
||||
pthread_mutex_destroy(&ctx->ctx_lock);
|
||||
free(ctx);
|
||||
return (LIBUSB_ERROR_NO_MEM);
|
||||
}
|
||||
if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) {
|
||||
pthread_mutex_destroy(&ctx->ctx_lock);
|
||||
pthread_condattr_destroy(&attr);
|
||||
free(ctx);
|
||||
return (LIBUSB_ERROR_OTHER);
|
||||
}
|
||||
if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) {
|
||||
pthread_mutex_destroy(&ctx->ctx_lock);
|
||||
pthread_condattr_destroy(&attr);
|
||||
free(ctx);
|
||||
return (LIBUSB_ERROR_NO_MEM);
|
||||
}
|
||||
pthread_condattr_destroy(&attr);
|
||||
|
||||
ctx->ctx_handler = NO_THREAD;
|
||||
|
||||
|
@ -307,12 +307,16 @@ libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
|
||||
&ctx->ctx_lock);
|
||||
return (0);
|
||||
}
|
||||
err = clock_gettime(CLOCK_REALTIME, &ts);
|
||||
err = clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
if (err < 0)
|
||||
return (LIBUSB_ERROR_OTHER);
|
||||
|
||||
ts.tv_sec = tv->tv_sec;
|
||||
ts.tv_nsec = tv->tv_usec * 1000;
|
||||
/*
|
||||
* The "tv" arguments points to a relative time structure and
|
||||
* not an absolute time structure.
|
||||
*/
|
||||
ts.tv_sec += tv->tv_sec;
|
||||
ts.tv_nsec += tv->tv_usec * 1000;
|
||||
if (ts.tv_nsec >= 1000000000) {
|
||||
ts.tv_nsec -= 1000000000;
|
||||
ts.tv_sec++;
|
||||
|
@ -25,14 +25,13 @@ CFLAGS+= -DINET6
|
||||
|
||||
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/
|
||||
|
||||
MAN+= auth.3 expand_number.3 flopen.3 fparseln.3 hexdump.3 \
|
||||
MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \
|
||||
humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \
|
||||
kinfo_getproc.3 kinfo_getvmmap.3 kld.3 login_auth.3 login_cap.3 \
|
||||
login_class.3 login_ok.3 login_times.3 login_tty.3 pidfile.3 \
|
||||
property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \
|
||||
_secure_path.3 trimdomain.3 uucplock.3
|
||||
MAN+= auth.conf.5 login.conf.5
|
||||
MLINKS+= auth.3 auth_getval.3
|
||||
MAN+= login.conf.5
|
||||
MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3
|
||||
MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3
|
||||
MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \
|
||||
|
@ -1,56 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Jordan Hubbard
|
||||
.\"
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\" "
|
||||
.Dd October 7, 1998
|
||||
.Dt AUTH_GETVAL 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm auth_getval
|
||||
.Nd functions for reading values from
|
||||
.Pa /etc/auth.conf
|
||||
.Sh LIBRARY
|
||||
.Lb libutil
|
||||
.Sh SYNOPSIS
|
||||
.In sys/types.h
|
||||
.In libutil.h
|
||||
.Ft char *
|
||||
.Fn auth_getval "const char *name"
|
||||
.Sh DESCRIPTION
|
||||
The function
|
||||
.Fn auth_getval
|
||||
returns the value associated with the field called
|
||||
.Fa name
|
||||
or NULL if no such field is found or the auth file cannot be opened.
|
||||
.Sh FILES
|
||||
.Pa /etc/auth.conf
|
||||
contains the name=value pairs looked up by
|
||||
.Fn auth_getval .
|
||||
.Sh SEE ALSO
|
||||
.Xr properties_free 3 ,
|
||||
.Xr properties_read 3 ,
|
||||
.Xr property_find 3 ,
|
||||
.Xr auth.conf 5
|
@ -31,40 +31,14 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libutil.h>
|
||||
#include <paths.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static properties P;
|
||||
|
||||
static int
|
||||
initauthconf(const char *path)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (!P) {
|
||||
if ((fd = open(path, O_RDONLY)) < 0) {
|
||||
syslog(LOG_ERR, "initauthconf: unable to open file: %s", path);
|
||||
return 1;
|
||||
}
|
||||
P = properties_read(fd);
|
||||
close(fd);
|
||||
if (!P) {
|
||||
syslog(LOG_ERR, "initauthconf: unable to parse file: %s", path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
auth_getval(const char *name)
|
||||
{
|
||||
if (!P && initauthconf(_PATH_AUTHCONF))
|
||||
return NULL;
|
||||
else
|
||||
return property_find(P, name);
|
||||
|
||||
(void)name;
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
.\" Copyright (c) 1998 Jordan Hubbard
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, is permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice immediately at the beginning of the file, without modification,
|
||||
.\" this list of conditions, and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 7, 1998
|
||||
.Dt AUTH.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm auth.conf
|
||||
.Nd authentication capability database
|
||||
.Sh SYNOPSIS
|
||||
.Pa /etc/auth.conf
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
contains various attributes important to the authentication
|
||||
code, most notably
|
||||
.Xr crypt 3
|
||||
for the time being.
|
||||
This documentation will be updated as the
|
||||
.Pa /etc/auth.conf
|
||||
file, which is very new, evolves.
|
||||
.Sh SEE ALSO
|
||||
.Xr auth_getval 3 ,
|
||||
.Xr crypt 3
|
@ -269,7 +269,9 @@ multiplied by 5 seconds.
|
||||
allowed before the login fails.
|
||||
.It "passwd_format string md5 The encryption format that new or"
|
||||
changed passwords will use.
|
||||
Valid values include "des", "md5" and "blf".
|
||||
Valid values include "des", "md5", "blf", "sha256" and "sha512"; see
|
||||
.Xr crypt 3
|
||||
for details.
|
||||
NIS clients using a
|
||||
.No non- Ns Fx
|
||||
NIS server should probably use "des".
|
||||
|
@ -90,8 +90,6 @@ are desired, the entire value should be enclosed in { } (curly-bracket)
|
||||
characters.
|
||||
Any line beginning with a # or ; character is assumed to
|
||||
be a comment and will be ignored.
|
||||
.Sh SEE ALSO
|
||||
.Xr auth_getval 3
|
||||
.Sh AUTHORS
|
||||
.An Jordan Hubbard
|
||||
.Sh BUGS
|
||||
|
@ -237,7 +237,6 @@ and is not preceded by a flag byte.
|
||||
.Xr gethostbyaddr 3 ,
|
||||
.Xr rcmd 3 ,
|
||||
.Xr ruserok 3 ,
|
||||
.Xr auth.conf 5 ,
|
||||
.Xr hosts 5 ,
|
||||
.Xr hosts.equiv 5 ,
|
||||
.Xr login.conf 5 ,
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "debug.h"
|
||||
#include "rtld.h"
|
||||
|
||||
static Elf_Ehdr *get_elf_header (int, const char *);
|
||||
static Elf_Ehdr *get_elf_header(int, const char *);
|
||||
static int convert_prot(int); /* Elf flags -> mmap protection */
|
||||
static int convert_flags(int); /* Elf flags -> mmap flags */
|
||||
|
||||
@ -121,7 +121,7 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
if ((segs[nsegs]->p_align & (PAGE_SIZE - 1)) != 0) {
|
||||
_rtld_error("%s: PT_LOAD segment %d not page-aligned",
|
||||
path, nsegs);
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -161,12 +161,12 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
}
|
||||
if (phdyn == NULL) {
|
||||
_rtld_error("%s: object is not dynamically-linked", path);
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (nsegs < 0) {
|
||||
_rtld_error("%s: too few PT_LOAD segments", path);
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -183,13 +183,12 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
if (mapbase == (caddr_t) -1) {
|
||||
_rtld_error("%s: mmap of entire address space failed: %s",
|
||||
path, rtld_strerror(errno));
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
if (base_addr != NULL && mapbase != base_addr) {
|
||||
_rtld_error("%s: mmap returned wrong address: wanted %p, got %p",
|
||||
path, base_addr, mapbase);
|
||||
munmap(mapbase, mapsize);
|
||||
return NULL;
|
||||
goto error1;
|
||||
}
|
||||
|
||||
for (i = 0; i <= nsegs; i++) {
|
||||
@ -201,10 +200,10 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
data_prot = convert_prot(segs[i]->p_flags);
|
||||
data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED;
|
||||
if (mmap(data_addr, data_vlimit - data_vaddr, data_prot,
|
||||
data_flags, fd, data_offset) == (caddr_t) -1) {
|
||||
data_flags | MAP_PREFAULT_READ, fd, data_offset) == (caddr_t) -1) {
|
||||
_rtld_error("%s: mmap of data failed: %s", path,
|
||||
rtld_strerror(errno));
|
||||
return NULL;
|
||||
goto error1;
|
||||
}
|
||||
|
||||
/* Do BSS setup */
|
||||
@ -221,7 +220,7 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
mprotect(clear_page, PAGE_SIZE, data_prot|PROT_WRITE)) {
|
||||
_rtld_error("%s: mprotect failed: %s", path,
|
||||
rtld_strerror(errno));
|
||||
return NULL;
|
||||
goto error1;
|
||||
}
|
||||
|
||||
memset(clear_addr, 0, nclear);
|
||||
@ -240,7 +239,7 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
data_flags | MAP_ANON, -1, 0) == (caddr_t)-1) {
|
||||
_rtld_error("%s: mmap of bss failed: %s", path,
|
||||
rtld_strerror(errno));
|
||||
return NULL;
|
||||
goto error1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -273,7 +272,7 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
if (obj->phdr == NULL) {
|
||||
obj_free(obj);
|
||||
_rtld_error("%s: cannot allocate program header", path);
|
||||
return NULL;
|
||||
goto error1;
|
||||
}
|
||||
memcpy((char *)obj->phdr, (char *)hdr + hdr->e_phoff, phsize);
|
||||
obj->phdr_alloc = true;
|
||||
@ -293,63 +292,72 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
obj->relro_page = obj->relocbase + trunc_page(relro_page);
|
||||
obj->relro_size = round_page(relro_size);
|
||||
|
||||
return obj;
|
||||
munmap(hdr, PAGE_SIZE);
|
||||
return (obj);
|
||||
|
||||
error1:
|
||||
munmap(mapbase, mapsize);
|
||||
error:
|
||||
munmap(hdr, PAGE_SIZE);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static Elf_Ehdr *
|
||||
get_elf_header (int fd, const char *path)
|
||||
get_elf_header(int fd, const char *path)
|
||||
{
|
||||
static union {
|
||||
Elf_Ehdr hdr;
|
||||
char buf[PAGE_SIZE];
|
||||
} u;
|
||||
ssize_t nbytes;
|
||||
Elf_Ehdr *hdr;
|
||||
|
||||
if ((nbytes = pread(fd, u.buf, PAGE_SIZE, 0)) == -1) {
|
||||
_rtld_error("%s: read error: %s", path, rtld_strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
hdr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ,
|
||||
fd, 0);
|
||||
if (hdr == (Elf_Ehdr *)MAP_FAILED) {
|
||||
_rtld_error("%s: read error: %s", path, rtld_strerror(errno));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Make sure the file is valid */
|
||||
if (nbytes < (ssize_t)sizeof(Elf_Ehdr) || !IS_ELF(u.hdr)) {
|
||||
_rtld_error("%s: invalid file format", path);
|
||||
return NULL;
|
||||
}
|
||||
if (u.hdr.e_ident[EI_CLASS] != ELF_TARG_CLASS
|
||||
|| u.hdr.e_ident[EI_DATA] != ELF_TARG_DATA) {
|
||||
_rtld_error("%s: unsupported file layout", path);
|
||||
return NULL;
|
||||
}
|
||||
if (u.hdr.e_ident[EI_VERSION] != EV_CURRENT
|
||||
|| u.hdr.e_version != EV_CURRENT) {
|
||||
_rtld_error("%s: unsupported file version", path);
|
||||
return NULL;
|
||||
}
|
||||
if (u.hdr.e_type != ET_EXEC && u.hdr.e_type != ET_DYN) {
|
||||
_rtld_error("%s: unsupported file type", path);
|
||||
return NULL;
|
||||
}
|
||||
if (u.hdr.e_machine != ELF_TARG_MACH) {
|
||||
_rtld_error("%s: unsupported machine", path);
|
||||
return NULL;
|
||||
}
|
||||
/* Make sure the file is valid */
|
||||
if (!IS_ELF(*hdr)) {
|
||||
_rtld_error("%s: invalid file format", path);
|
||||
goto error;
|
||||
}
|
||||
if (hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS ||
|
||||
hdr->e_ident[EI_DATA] != ELF_TARG_DATA) {
|
||||
_rtld_error("%s: unsupported file layout", path);
|
||||
goto error;
|
||||
}
|
||||
if (hdr->e_ident[EI_VERSION] != EV_CURRENT ||
|
||||
hdr->e_version != EV_CURRENT) {
|
||||
_rtld_error("%s: unsupported file version", path);
|
||||
goto error;
|
||||
}
|
||||
if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) {
|
||||
_rtld_error("%s: unsupported file type", path);
|
||||
goto error;
|
||||
}
|
||||
if (hdr->e_machine != ELF_TARG_MACH) {
|
||||
_rtld_error("%s: unsupported machine", path);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* We rely on the program header being in the first page. This is
|
||||
* not strictly required by the ABI specification, but it seems to
|
||||
* always true in practice. And, it simplifies things considerably.
|
||||
*/
|
||||
if (u.hdr.e_phentsize != sizeof(Elf_Phdr)) {
|
||||
_rtld_error(
|
||||
"%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path);
|
||||
return NULL;
|
||||
}
|
||||
if (u.hdr.e_phoff + u.hdr.e_phnum * sizeof(Elf_Phdr) > (size_t)nbytes) {
|
||||
_rtld_error("%s: program header too large", path);
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* We rely on the program header being in the first page. This is
|
||||
* not strictly required by the ABI specification, but it seems to
|
||||
* always true in practice. And, it simplifies things considerably.
|
||||
*/
|
||||
if (hdr->e_phentsize != sizeof(Elf_Phdr)) {
|
||||
_rtld_error(
|
||||
"%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path);
|
||||
goto error;
|
||||
}
|
||||
if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) >
|
||||
(size_t)PAGE_SIZE) {
|
||||
_rtld_error("%s: program header too large", path);
|
||||
goto error;
|
||||
}
|
||||
return (hdr);
|
||||
|
||||
return (&u.hdr);
|
||||
error:
|
||||
munmap(hdr, PAGE_SIZE);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -64,10 +64,6 @@ int yp_errno = YP_TRUE;
|
||||
extern int yp_passwd( char * );
|
||||
#endif
|
||||
|
||||
#ifdef KERBEROS
|
||||
#include "krb.h"
|
||||
#endif
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
static void usage(void);
|
||||
@ -81,26 +77,12 @@ main(argc, argv)
|
||||
{
|
||||
int ch;
|
||||
char *uname;
|
||||
#ifdef KERBEROS
|
||||
char *iflag = 0, *rflag = 0, *uflag = 0;
|
||||
char *k;
|
||||
#endif
|
||||
|
||||
#ifdef YP
|
||||
#ifdef KERBEROS
|
||||
char realm[REALM_SZ];
|
||||
#define OPTIONS "d:h:lysfoi:r:u:"
|
||||
#else
|
||||
#define OPTIONS "d:h:lysfo"
|
||||
#endif
|
||||
#else
|
||||
#ifdef KERBEROS
|
||||
char realm[REALM_SZ];
|
||||
#define OPTIONS "li:r:u:"
|
||||
#else
|
||||
#define OPTIONS "l"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef YP
|
||||
int res = 0;
|
||||
@ -113,17 +95,6 @@ main(argc, argv)
|
||||
case 'l': /* change local password file */
|
||||
use_local_passwd = 1;
|
||||
break;
|
||||
#ifdef KERBEROS
|
||||
case 'i':
|
||||
iflag = optarg;
|
||||
break;
|
||||
case 'r':
|
||||
rflag = optarg;
|
||||
break;
|
||||
case 'u':
|
||||
uflag = optarg;
|
||||
break;
|
||||
#endif /* KERBEROS */
|
||||
#ifdef YP
|
||||
case 'y': /* Change NIS password */
|
||||
__use_yp = 1;
|
||||
@ -182,46 +153,29 @@ main(argc, argv)
|
||||
/*
|
||||
* If NIS is turned on in the password database, use it, else punt.
|
||||
*/
|
||||
#ifdef KERBEROS
|
||||
if (__use_yp || (iflag == NULL && rflag == NULL && uflag == NULL)) {
|
||||
#endif
|
||||
res = use_yp(uname, 0, 0);
|
||||
if (res == USER_YP_ONLY) {
|
||||
if (!use_local_passwd) {
|
||||
exit(yp_passwd(uname));
|
||||
} else {
|
||||
res = use_yp(uname, 0, 0);
|
||||
if (res == USER_YP_ONLY) {
|
||||
if (!use_local_passwd) {
|
||||
exit(yp_passwd(uname));
|
||||
} else {
|
||||
/*
|
||||
* Reject -l flag if NIS is turned on and the user
|
||||
* doesn't exist in the local password database.
|
||||
*/
|
||||
errx(1, "unknown local user: %s", uname);
|
||||
}
|
||||
} else if (res == USER_LOCAL_ONLY) {
|
||||
/*
|
||||
* Reject -y flag if user only exists locally.
|
||||
*/
|
||||
if (__use_yp)
|
||||
errx(1, "unknown NIS user: %s", uname);
|
||||
} else if (res == USER_YP_AND_LOCAL) {
|
||||
if (!use_local_passwd && (yp_in_pw_file || __use_yp))
|
||||
exit(yp_passwd(uname));
|
||||
errx(1, "unknown local user: %s", uname);
|
||||
}
|
||||
#ifdef KERBEROS
|
||||
} else if (res == USER_LOCAL_ONLY) {
|
||||
/*
|
||||
* Reject -y flag if user only exists locally.
|
||||
*/
|
||||
if (__use_yp)
|
||||
errx(1, "unknown NIS user: %s", uname);
|
||||
} else if (res == USER_YP_AND_LOCAL) {
|
||||
if (!use_local_passwd && (yp_in_pw_file || __use_yp))
|
||||
exit(yp_passwd(uname));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!use_local_passwd) {
|
||||
#ifdef KERBEROS
|
||||
k = auth_getval("auth_list");
|
||||
if (k && strstr(k, "kerberos"))
|
||||
if(krb_get_lrealm(realm, 0) == KSUCCESS) {
|
||||
setuid(getuid());
|
||||
fprintf(stderr, "realm %s\n", realm);
|
||||
exit(krb_passwd(argv[0], iflag, rflag, uflag));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
exit(local_passwd(uname));
|
||||
}
|
||||
|
||||
@ -230,21 +184,10 @@ usage()
|
||||
{
|
||||
|
||||
#ifdef YP
|
||||
#ifdef KERBEROS
|
||||
fprintf(stderr, "%s\n%s\n",
|
||||
"usage: passwd [-l] [-i instance] [-r realm] [-u fullname]",
|
||||
" passwd [-l] [-y] [-o] [-d domain [-h host]] [user]");
|
||||
#else
|
||||
(void)fprintf(stderr,
|
||||
"usage: passwd [-l] [-y] [-o] [-d domain [-h host]] [user]\n");
|
||||
#endif
|
||||
#else
|
||||
#ifdef KERBEROS
|
||||
fprintf(stderr,
|
||||
"usage: passwd [-l] [-i instance] [-r realm] [-u fullname] [user]\n");
|
||||
#else
|
||||
(void)fprintf(stderr, "usage: passwd user\n");
|
||||
#endif
|
||||
(void)fprintf(stderr, "usage: passwd [-l] user\n");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user