Bug 476129 - openvpn should use standard useradd scriptlet
openvpn should use standard useradd scriptlet
Product: Fedora
Classification: Fedora
Component: openvpn (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Steven Pritchard
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-12-11 21:22 EST by Kevin Fenzi
Modified: 2009-01-25 00:51 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-25 00:51:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kevin Fenzi 2008-12-11 21:22:38 EST
The openvpn package currently has: 

preinstall scriptlet (using /bin/sh):
if ! id openvpn > /dev/null 2>&1 ; then
    /usr/sbin/useradd -r -s /sbin/nologin -c OpenVPN -d /etc/openvpn openvpn

However, this doesn't work right if there is already an openvpn user/group setup. Instead you get this: 

Is this ok [y/N]: y
Downloading Packages:
(1/2): lzo-2.03-1.fc10.x86_64.rpm                                  |  62 kB     00:00     
(2/2): openvpn-2.1-0.28.rc9.fc10.x86_64.rpm                        | 364 kB     00:00     
Total                                                     1.1 MB/s | 426 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : lzo                                                                1/2 
useradd: group openvpn exists - if you want to add this user to that group, use -g.
error: %pre(openvpn-2.1-0.28.rc9.fc10.x86_64) scriptlet failed, exit status 9
error:   install: %pre scriptlet failed (2), skipping openvpn-2.1-0.28.rc9.fc10

  openvpn.x86_64 0:2.1-0.28.rc9.fc10  

And because the scriptlet failed, it's not really installed: 

# rpm -q openvpn
package openvpn is not installed

I suggest you convert to using the standard for adding users: 
which does handle this case right.
Comment 1 Steven Pritchard 2008-12-11 21:55:43 EST
Actually, that would only fail if there is an openvpn group, but no openvpn user.  How the heck did that happen?  :-)

You're right though, it's a bug.  Please try -0.30.rc15 when it hits rawhide, or grab it from koji.  (Assuming it builds OK, of course.)


Let me know how it goes, please.
Comment 2 Kevin Fenzi 2008-12-11 22:01:41 EST
Yeah, totally my fault on the group... I am migrating a machine and was copying things and installing things. /etc/group was moved over, but not /etc/passwd entries yet. ;( 

Your commit looks fine to me, feel free to close this now if you like. ;) 

thanks for the super quick response.
Comment 3 Kevin Fenzi 2009-01-25 00:51:55 EST
This was fixed a while ago. Closing now. ;)

Note You need to log in before you can comment on or make changes to this bug.