Jump to content

Emby rpm: Issue with posttrans scriptlets


Q-Droid

Recommended Posts

Q-Droid

I upgraded to 4.5.2 on CentOS today and noticed some things about the rpm update.

emby-server-rpm_4.5.2.0_x86_64.rpm

Lines are from posttrans scriptlet.

1 - getent passwd emby > /dev/null 2>&1 && usermod -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby:emby   <--- emby:emby is not a user and threw an error

2 - getent passwd emby > /dev/null 2>&1 || useradd -r -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby && passwd -l emby > /dev/null && chown emby:emby -R /var/lib/emby

Line #1 should be changed to user emby instead of user:group emby:emby. The way both lines are written the emby user will always be modified by #1 and even if the emby user does exist line #2 will always lock the emby user password and recursively reset ownership of the emby home directory. The actions would overwrite changes previously made to the emby account and home by the system owner. I can live with it if this is by design to cut down on problems and requests for support.

@Happy2Play please move this and my response to a new topic. Thanks.

Link to comment
Share on other sites

Hi, thanks for the feedback. I've passed this on to our build developer to jump in here and respond.

Link to comment
Share on other sites

alucryd

The group is created one line above that, and unless getent works differently on CentOS, the first line should work perfectly fine. You're right about the second one however, didn't catch that operator precedence doesn't apply here, and the whole group after `||` should be surrounded with parentheses. Thanks for the report!

Link to comment
Share on other sites

Q-Droid
4 hours ago, alucryd said:

The group is created one line above that, and unless getent works differently on CentOS, the first line should work perfectly fine. You're right about the second one however, didn't catch that operator precedence doesn't apply here, and the whole group after `||` should be surrounded with parentheses. Thanks for the report!

Usermod on EL7 doesn't like it, perhaps EL8 accepts user:group. Previous releases (4.4.x) of the rpm only had user name specified for the usermod command.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...