From c4996396c689d5d53a46ec7230fbb31cd97dbac9 Mon Sep 17 00:00:00 2001
From: Kamila Souckova <kamila@ksp.sk>
Date: Tue, 22 Nov 2016 18:21:03 +0100
Subject: [PATCH] __user type: fix for FreeBSD

---
 cdist/conf/type/__user/gencode-remote | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cdist/conf/type/__user/gencode-remote b/cdist/conf/type/__user/gencode-remote
index 463fbe49..223d4d46 100755
--- a/cdist/conf/type/__user/gencode-remote
+++ b/cdist/conf/type/__user/gencode-remote
@@ -104,7 +104,7 @@ if [ "$state" = "present" ]; then
        if [ $# -gt 0 ]; then
           echo mod >> "$__messages_out"
           if [ "$os" = "freebsd" ]; then
-             echo pw usermod "$@" "$name"
+             echo pw usermod "$@" -n "$name"
           else
              echo usermod "$@" "$name"
           fi
@@ -125,7 +125,7 @@ if [ "$state" = "present" ]; then
         done
 
        if [ "$os" = "freebsd" ]; then
-          echo pw useradd "$@" "$name"
+          echo pw useradd "$@" -n "$name"
        else
           echo useradd "$@" "$name"
        fi