summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2018-12-19 17:39:46 +0000
committerJohn Levon <john.levon@joyent.com>2019-02-25 16:26:52 +0000
commitb63d0986fbd0638ed6abf1248f1a297c5d9a4f91 (patch)
tree9bf4be6df1e44e9e2c935e076e2b78b907aef95d
parent5085a9e0a8c766d5e9b74954833264533f617614 (diff)
downloadillumos-joyent-b63d0986fbd0638ed6abf1248f1a297c5d9a4f91.tar.gz
10151 mv_xattrs() checks for a NULL array name
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/lib/libcmdutils/common/process_xattrs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/src/lib/libcmdutils/common/process_xattrs.c b/usr/src/lib/libcmdutils/common/process_xattrs.c
index 50b1de58d6..802981053c 100644
--- a/usr/src/lib/libcmdutils/common/process_xattrs.c
+++ b/usr/src/lib/libcmdutils/common/process_xattrs.c
@@ -23,6 +23,7 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright (c) 2019, Joyent, Inc.
*/
#include "libcmdutils.h"
@@ -70,7 +71,7 @@ get_attrdirs(int indfd, int outdfd, char *attrfile, int *sfd, int *tfd)
/*
* mv_xattrs - Copies the content of the extended attribute files. Then
- * moves the extended system attributes from the input attribute files
+ * moves the extended system attributes from the input attribute files
* to the target attribute files. Moves the extended system attributes
* from source to the target file. This function returns 0 on success
* and nonzero on error.
@@ -162,8 +163,7 @@ mv_xattrs(char *cmd, char *infile, char *outfile, int sattr, int silent)
* Gets non default extended system attributes from
* source to copy to target.
*/
- if (dp->d_name != NULL)
- res = sysattr_list(cmd, sattrfd, dp->d_name);
+ res = sysattr_list(cmd, sattrfd, dp->d_name);
if (res != NULL &&
get_attrdirs(indfd, outdfd, dp->d_name, &asfd,