Public bug reported:

Using libpam-script 1.1.9-1 from bionic/universe.

I've set up pam to use pam_script in common-session:

session optional pam_script.so dir=/etc/pam-script

And used the example pam-script file from /usr/share/doc/libpam-
script/examples/pam_script.gz

At the top of the file, it uses "#! /bin/sh". ("/bin/sh" links to
"/bin/dash"). When I attempt to test something with pamtester:

pamtester -v login root open_session

I get:

/etc/pam-script/pam_script_ses_open: 32: /etc/pam-
script/pam_script_ses_open: Bad substitution


Line 32 is:

world_write_bit=${stat_output:8:1}

bash supports the ${parameter:offset:length}, whilst dash does not.

Possible fix is to do something similar to determining the user/group
and:

world_write_bit=`echo $stat_output | /usr/bin/cut -c 9`

** Affects: libpam-script (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1777895

Title:
  Example pam-script does not work with dash

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libpam-script/+bug/1777895/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to