From 0966ba1ebb5ca9feb60eb41316a9abc5d242ffe8 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Fri, 18 Feb 2022 17:49:50 +0100 Subject: ref-manual: classes: provide command with ready-to-use password mkpasswd output requires to be escaped before being used as password in a Bitbake variable. It was explicitly stated after the command, but to be sure it's not missed, let's give the printf command which does escape the string for us. Cc: Quentin Schulz (From yocto-docs rev: 13064e7bea18e999d4a294e298a7980a4dcbe69e) Signed-off-by: Quentin Schulz Reviewed-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/ref-manual/classes.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index bf39d5e4cc..03dd375776 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -574,12 +574,11 @@ Here is an example that uses this class in an image recipe:: " Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns -passwords. First on host, create the password hash:: +passwords. First on host, create the (escaped) password hash:: - mkpasswd -m sha256crypt tester01 + printf "%q" $(mkpasswd -m sha256crypt tester01) -The resulting hash is set to a variable and used in ``useradd`` command parameters. -Remember to escape the character ``$``:: +The resulting hash is set to a variable and used in ``useradd`` command parameters:: inherit extrausers PASSWD = "\$X\$ABC123\$A-Long-Hash" -- cgit v1.2.3-54-g00ecf