#951: libreport can't open /etc/system-release
-----------------------+------------------------------
 Reporter:  jfilak     |       Owner:  crash-catcher@…
     Type:  defect     |      Status:  new
 Priority:  critical   |   Milestone:
Component:  libreport  |     Version:
 Keywords:             |  Blocked By:
 Blocking:             |
-----------------------+------------------------------
 ''/var/log/message''
 {{{
 Jan 17 17:18:52 f18-x8664 abrt[30090]: Can't open file '/etc/system-
 release': Too many levels of symbolic links
 Jan 17 17:18:52 f18-x8664 abrt[30090]: Can't open file '/etc/redhat-
 release': Too many levels of symbolic links
 Jan 17 17:19:17 f18-x8664 abrt[30090]: Saved core dump of pid 30053
 (/usr/libexec/gnome-shell-calendar-server) to
 /var/tmp/abrt/ccpp-2013-01-17-17:18:51-30053 (36159488 bytes)
 }}}

 ''File system''
 {{{
 [root@f18-x8664 ~]# ls -al /etc/system-release
 lrwxrwxrwx. 1 root root 14 Jan  2 13:02 /etc/system-release -> fedora-
 release
 }}}

 ''libreport/src/lib/dump_dir.c:709''
 {{{
 static char *load_text_file(const char *path, unsigned flags)
 {
     int fd = open(path, O_RDONLY | O_NOFOLLOW);
     if (fd == -1)
     {
         if (!(flags & DD_FAIL_QUIETLY_ENOENT))
             perror_msg("Can't open file '%s'", path);
         return (flags & DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE ? NULL :
 xstrdup(""));
     }
 ...
 }}}

 ''libreport/src/lib/dump_dir.c:554''
 {{{
     if (!release)
     {
         release = load_text_file("/etc/system-release",
                 DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE);
         if (!release)
             release = load_text_file("/etc/redhat-release", /*flags:*/ 0);
         dd_save_text(dd, FILENAME_OS_RELEASE, release);
         if (chroot_dir)
         {
             free(release);
             char *chrooted_name = concat_path_file(chroot_dir, "/etc
 /system-release");
             release = load_text_file(chrooted_name, /*flags:*/ 0);
             free(chrooted_name);
             if (release[0])
                 dd_save_text(dd, FILENAME_OS_RELEASE_IN_ROOTDIR, release);
         }
     }
 }}}

 Cause by commit:
 {{{
 commit 3bbf961b1884dd32654dd39b360dd78ef294b10a
 Author: Jiri Moskovcak <[email protected]>
 Date:   Tue Jan 15 16:07:13 2013 +0100

     never follow symlinks rhbz#887866

     - use lchown instead chown and O_NOFOLLOW where we use open
 }}}

-- 
Ticket URL: <https://fedorahosted.org/abrt/ticket/951>
Automatic Bug Reporting Tool - ABRT <http://fedorahoted.org/abrt/>
Automatic bug reporting tool

Reply via email to