Bug 27146

Summary: /etc/profile.d/debuginfod.csh breaks csh startup
Product: elfutils Reporter: Martin Liska <martin.liska>
Component: debuginfodAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: elfutils-devel, fche, mark
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Martin Liska 2021-01-04 06:57:13 UTC
As reported here:
https://bugzilla.suse.com/show_bug.cgi?id=1180306

```
It introduces the file "/etc/profile.d/debuginfod.csh" which produces an error during shell initialization, so that startup scripts are not properly run.

Workaround: chmod +t /etc/profile.d/debuginfod.csh

This makes sure that the file is not used in csh startup.

Current content of file:
 ----

setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS "
 ----

Suggested alternative content for file:
 ----

if ( $?DEBUGINFOD_URLS ) then
    setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS "
endif
 ----

This change avoids evaluating an undefined variable.
```
Comment 1 Mark Wielaard 2021-01-04 08:00:41 UTC
Has this been resolved by:

commit 911ac29b9eed3c66bba60eda6af8e5de62607e5c
Author: Dmitry V. Levin <ldv@altlinux.org>
Date:   Wed Nov 4 08:00:00 2020 +0000

    config: do not define DEBUGINFOD_URLS environment variable unnecessarily
    
    Before this change, when elfutils was configured without
    --enable-debuginfod-urls, the installed profile.d/debuginfod.sh and
    profile.d/debuginfod.csh scripts used to define the DEBUGINFOD_URLS
    environment variable as an non-empty string containing spaces, making
    all libdebuginfod users do extra work.
    
    Change these scripts to avoid defining the DEBUGINFOD_URLS environment
    variable unless configured using --enable-debuginfod-urls.
    
    Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Comment 2 Martin Liska 2021-01-04 12:01:49 UTC
All right, thank you for the pointer.