aboutsummaryrefslogtreecommitdiff
path: root/nis/nis_add.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_add.c')
-rw-r--r--nis/nis_add.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nis/nis_add.c b/nis/nis_add.c
index e358ea4..9baf4e8 100644
--- a/nis/nis_add.c
+++ b/nis/nis_add.c
@@ -40,8 +40,9 @@ nis_add (const_nis_name name, const nis_object *obj)
req.ns_object.ns_object_val = nis_clone_object (obj, NULL);
p1 = req.ns_object.ns_object_val[0].zo_name;
- req.ns_object.ns_object_val[0].zo_name =
- nis_leaf_of_r (name, buf1, sizeof (buf1));
+ if (p1 == NULL || strlen (p1) == 0)
+ req.ns_object.ns_object_val[0].zo_name =
+ nis_leaf_of_r (name, buf1, sizeof (buf1));
p2 = req.ns_object.ns_object_val[0].zo_owner;
if (p2 == NULL || strlen (p2) == 0)