Title: Change Linux-User password via gdc Post by: Stefan S. on July 06, 2022, 03:38:03 pm Hello,
has anyone an idea to change the Linux-User Password via a GDC-Application? The user should not use a Terminal-Application to enter passwd. We are looking for a little Script which can be created and executed within the Application. Any idea? Thanks Stefan. Title: Re: Change Linux-User password via gdc Post by: Daniele A. on July 06, 2022, 04:27:36 pm Hi Stefan
the following snippet works for me ! let wk_log_changepwd = g_tmpdir clipped,g_separator, "changepasswd_", g_s_pid using "<<<<<<<<<<<&", ".log" let wk_cmd = 'echo -e "',ri.password_old clipped,'\n', ri.password_new clipped,'\n', ri.password_cnf clipped,'" | passwd &>',wk_log_changepwd run wk_cmd returning wk_exit_code bye Title: Re: Change Linux-User password via gdc Post by: Reuben B. on July 07, 2022, 12:28:19 am An area you can explore is to utilise GDC Connection Strings in your GDC Shortcut settings. See step 10 here http://4js.com/online_documentation/fjs-gdc-manual-html/#gdc-topics/t_gdc_applications_shortcuts_creating_direct.html. The technique is to add extra entries for the text you expect to appear when you are required to change your password, and have the GDC respond by prompting for the new password and sending it. I can't recall if it was a technique that was eventually used in production, or if it fell into the thats interesting but it does not do quite what we need it to do category. The GDC Connection strings were designed to manage the connection, and this is going beyond their initial design criteria hence the hesitation.
Title: Re: Change Linux-User password via gdc Post by: Stefan S. on July 07, 2022, 08:58:43 am Hi,
thanks. I tired the command with "echo -e".... this is working fine. the Result of the command I write in a file to show the user a message, if passwd raises an error.... Code
Title: Re: Change Linux-User password via gdc Post by: Roland W. on July 07, 2022, 09:21:06 am Hi folks,
wouldn't it be better to use the openPipe() function instead of calling "run" as in this example? https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassChannel_example_2.html (https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassChannel_example_2.html) Kind regards Roland Title: Re: Change Linux-User password via gdc Post by: Stefan S. on July 07, 2022, 11:17:21 am Hi Roland,
I tried the channel.openpipe before. But in the output Files I missed either the "success" part, or the "faild" part (not sure which one) Stefan |