@@ -1483,7 +1483,7 @@ get_callback(zfs_handle_t *zhp, void *data)
1483
1483
char buf [ZFS_MAXPROPLEN ];
1484
1484
char rbuf [ZFS_MAXPROPLEN ];
1485
1485
zprop_source_t sourcetype ;
1486
- char source [ZFS_MAXNAMELEN ];
1486
+ char source [ZFS_MAX_DATASET_NAME_LEN ];
1487
1487
zprop_get_cbdata_t * cbp = data ;
1488
1488
nvlist_t * user_props = zfs_get_user_props (zhp );
1489
1489
zprop_list_t * pl = cbp -> cb_proplist ;
@@ -1963,7 +1963,7 @@ typedef struct upgrade_cbdata {
1963
1963
uint64_t cb_version ;
1964
1964
boolean_t cb_newer ;
1965
1965
boolean_t cb_foundone ;
1966
- char cb_lastfs [ZFS_MAXNAMELEN ];
1966
+ char cb_lastfs [ZFS_MAX_DATASET_NAME_LEN ];
1967
1967
} upgrade_cbdata_t ;
1968
1968
1969
1969
static int
@@ -2412,7 +2412,7 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
2412
2412
if (domain != NULL && domain [0 ] != '\0' ) {
2413
2413
#ifdef HAVE_IDMAP
2414
2414
/* SMB */
2415
- char sid [ZFS_MAXNAMELEN + 32 ];
2415
+ char sid [MAXNAMELEN + 32 ];
2416
2416
uid_t id ;
2417
2417
uint64_t classes ;
2418
2418
int err ;
@@ -2546,7 +2546,7 @@ print_us_node(boolean_t scripted, boolean_t parsable, int *fields, int types,
2546
2546
size_t * width , us_node_t * node )
2547
2547
{
2548
2548
nvlist_t * nvl = node -> usn_nvl ;
2549
- char valstr [ZFS_MAXNAMELEN ];
2549
+ char valstr [MAXNAMELEN ];
2550
2550
boolean_t first = B_TRUE ;
2551
2551
int cfield = 0 ;
2552
2552
int field ;
@@ -3417,7 +3417,7 @@ zfs_do_rollback(int argc, char **argv)
3417
3417
boolean_t force = B_FALSE ;
3418
3418
rollback_cbdata_t cb = { 0 };
3419
3419
zfs_handle_t * zhp , * snap ;
3420
- char parentname [ZFS_MAXNAMELEN ];
3420
+ char parentname [ZFS_MAX_DATASET_NAME_LEN ];
3421
3421
char * delim ;
3422
3422
3423
3423
/* check options */
@@ -3818,7 +3818,7 @@ zfs_do_send(int argc, char **argv)
3818
3818
*/
3819
3819
if (strchr (argv [0 ], '@' ) == NULL ||
3820
3820
(fromname && strchr (fromname , '#' ) != NULL )) {
3821
- char frombuf [ZFS_MAXNAMELEN ];
3821
+ char frombuf [ZFS_MAX_DATASET_NAME_LEN ];
3822
3822
enum lzc_send_flags lzc_flags = 0 ;
3823
3823
3824
3824
if (flags .replicate || flags .doall || flags .props ||
@@ -3870,7 +3870,7 @@ zfs_do_send(int argc, char **argv)
3870
3870
* case if they specify the origin.
3871
3871
*/
3872
3872
if (fromname && (cp = strchr (fromname , '@' )) != NULL ) {
3873
- char origin [ZFS_MAXNAMELEN ];
3873
+ char origin [ZFS_MAX_DATASET_NAME_LEN ];
3874
3874
zprop_source_t src ;
3875
3875
3876
3876
(void ) zfs_prop_get (zhp , ZFS_PROP_ORIGIN ,
@@ -4004,7 +4004,7 @@ zfs_do_receive(int argc, char **argv)
4004
4004
usage (B_FALSE );
4005
4005
}
4006
4006
4007
- char namebuf [ZFS_MAXNAMELEN ];
4007
+ char namebuf [ZFS_MAX_DATASET_NAME_LEN ];
4008
4008
(void ) snprintf (namebuf , sizeof (namebuf ),
4009
4009
"%s/%%recv" , argv [0 ]);
4010
4010
@@ -4860,7 +4860,7 @@ store_allow_perm(zfs_deleg_who_type_t type, boolean_t local, boolean_t descend,
4860
4860
{
4861
4861
int i ;
4862
4862
char ld [2 ] = { '\0' , '\0' };
4863
- char who_buf [ZFS_MAXNAMELEN + 32 ];
4863
+ char who_buf [MAXNAMELEN + 32 ];
4864
4864
char base_type = ZFS_DELEG_WHO_UNKNOWN ;
4865
4865
char set_type = ZFS_DELEG_WHO_UNKNOWN ;
4866
4866
nvlist_t * base_nvl = NULL ;
@@ -5224,7 +5224,7 @@ static void
5224
5224
print_fs_perms (fs_perm_set_t * fspset )
5225
5225
{
5226
5226
fs_perm_node_t * node = NULL ;
5227
- char buf [ZFS_MAXNAMELEN + 32 ];
5227
+ char buf [MAXNAMELEN + 32 ];
5228
5228
const char * dsname = buf ;
5229
5229
5230
5230
for (node = uu_list_first (fspset -> fsps_list ); node != NULL ;
@@ -5233,7 +5233,7 @@ print_fs_perms(fs_perm_set_t *fspset)
5233
5233
uu_avl_t * uge_avl = node -> fspn_fsperm .fsp_uge_avl ;
5234
5234
int left = 0 ;
5235
5235
5236
- (void ) snprintf (buf , ZFS_MAXNAMELEN + 32 ,
5236
+ (void ) snprintf (buf , sizeof ( buf ) ,
5237
5237
gettext ("---- Permissions on %s " ),
5238
5238
node -> fspn_fsperm .fsp_name );
5239
5239
(void ) printf ("%s" , dsname );
@@ -5430,7 +5430,7 @@ zfs_do_hold_rele_impl(int argc, char **argv, boolean_t holding)
5430
5430
5431
5431
for (i = 0 ; i < argc ; ++ i ) {
5432
5432
zfs_handle_t * zhp ;
5433
- char parent [ZFS_MAXNAMELEN ];
5433
+ char parent [ZFS_MAX_DATASET_NAME_LEN ];
5434
5434
const char * delim ;
5435
5435
char * path = argv [i ];
5436
5436
@@ -5558,7 +5558,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
5558
5558
nvlist_t * nvl = NULL ;
5559
5559
nvpair_t * nvp = NULL ;
5560
5560
const char * zname = zfs_get_name (zhp );
5561
- size_t znamelen = strnlen (zname , ZFS_MAXNAMELEN );
5561
+ size_t znamelen = strlen (zname );
5562
5562
5563
5563
if (cbp -> cb_recursive ) {
5564
5564
const char * snapname ;
@@ -5579,7 +5579,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
5579
5579
5580
5580
while ((nvp = nvlist_next_nvpair (nvl , nvp )) != NULL ) {
5581
5581
const char * tag = nvpair_name (nvp );
5582
- size_t taglen = strnlen (tag , MAXNAMELEN );
5582
+ size_t taglen = strlen (tag );
5583
5583
if (taglen > cbp -> cb_max_taglen )
5584
5584
cbp -> cb_max_taglen = taglen ;
5585
5585
}
@@ -6695,7 +6695,7 @@ zfs_do_diff(int argc, char **argv)
6695
6695
static int
6696
6696
zfs_do_bookmark (int argc , char * * argv )
6697
6697
{
6698
- char snapname [ZFS_MAXNAMELEN ];
6698
+ char snapname [ZFS_MAX_DATASET_NAME_LEN ];
6699
6699
zfs_handle_t * zhp ;
6700
6700
nvlist_t * nvl ;
6701
6701
int ret = 0 ;
0 commit comments