%sysusers_create_compat doesn't expand correctly

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
bash, perl
Domain
build-system

Research direction

The bad output comes from %sysusers_create_compat expanding a shell-escape %(...) that calls /usr/lib/debbuild/sysusers.generate-pre.sh on frr-sysusers.conf. Start by finding where debbuild's Perl code handles macro and shell-escape expansion, then compare it with the working rpm output shown in the issue. Done means the preinst script contains the generated getent/useradd stanzas instead of the raw macro text.

Written by the indexing model from the issue text.

Description

bug

When attempting to adapt frr, I've encountered an issue with %sysusers_create_compat.

When using the macro with debbuild, the result generated for preinst script is:

\
%(/usr/lib/debbuild/sysusers.generate-pre.sh /home/abuild/debbuild/SOURCES/frr-sysusers.conf)

When using RPM, the macro generates the correct script stanzas:


# generated from frr-sysusers.conf
getent group 'frrvty' >/dev/null || groupadd -r 'frrvty'
getent group 'frr' >/dev/null || groupadd -r 'frr'
getent passwd 'frr' >/dev/null || \
    useradd -r -g 'frr' -d '/var/run/frr' -s '/sbin/nologin' -c 'FRRouting routing suite' 'frr'
getent group 'frrvty' >/dev/null || groupadd -r 'frrvty'
getent passwd 'frr' >/dev/null || \
    useradd -r -g 'frrvty' -d '/' -s '/sbin/nologin' -c '' 'frr'

This is clearly a parsing bug with nested macros.

Dominant language
Perl
Stars
66
Forks
26
Avg merge
26m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from debbuild/debbuild

All issues in debbuild/debbuild

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.