Bug 476129 - openvpn should use standard useradd scriptlet
Summary: openvpn should use standard useradd scriptlet
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: openvpn
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Steven Pritchard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-12 02:22 UTC by Kevin Fenzi
Modified: 2009-01-25 05:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-25 05:51:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kevin Fenzi 2008-12-12 02:22:38 UTC
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
fi

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

Installed:
  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: 
http://fedoraproject.org/wiki/Packaging/UsersAndGroups
which does handle this case right.

Comment 1 Steven Pritchard 2008-12-12 02:55:43 UTC
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.)

http://koji.fedoraproject.org/koji/taskinfo?taskID=994220

Let me know how it goes, please.

Comment 2 Kevin Fenzi 2008-12-12 03:01:41 UTC
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 05:51:55 UTC
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.