-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net-snmp-create-v3-user: fix directory variable references #394
Conversation
@@ -134,8 +134,12 @@ if test ! -d "$outfile"; then | |||
touch "$outfile" | |||
fi | |||
echo "$line" >> "$outfile" | |||
# Avoid that configure complains that this script ignores @datarootdir@ | |||
echo "@datarootdir@" >/dev/null | |||
prefix="@prefix@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default this is /usr/local
.
# Avoid that configure complains that this script ignores @datarootdir@ | ||
echo "@datarootdir@" >/dev/null | ||
prefix="@prefix@" | ||
datarootdir="@datarootdir@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default this is ${prefix}/share
.
# Avoid that shellcheck complains about unused variables. | ||
# The data directory (@datadir@) may contain references | ||
# to these variables. | ||
: "${prefix}" "${datarootdir}" | ||
outfile="@datadir@/snmp/snmpd.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default this is ${datarootdir}/snmp/snmpd.conf
.
How about replacing the patch in this pull request with the patch below?
|
Unfortunately that is not enough.
That is correct, but then
After expansion, this will be
while Additionally, it is possible to pass
for instance. So in the end, you cannot really leave anything away from my patch. You can of course implement it a bit differently if you wish.
|
How about the patch below? I prefer using
|
Looks good to me. |
With the default configure directories, the net-snmp-create-v3-user tries to write to
${datarootdir}/snmp/snmpd.conf
without settingdatarootdir
thus in essence it tries to write to/snmp/snmpd.conf
which usually does not exist.This patch fixes the problem by setting
datarootdir
andprefix
(the defaultdatarootdir
is${prefix}/share
thusprefix
must be set too).