[Bug 1108518] Re: lightdm should not rename() .xsession-errors, as it may be a symlink
I took a stab at this in the noted branch. my glib is terrible and It looks like we need to do this twice in session-child.c? ** Branch linked: lp:~antarus/lightdm/bug1108518 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1108518 Title: lightdm should not rename() .xsession-errors, as it may be a symlink To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1108518/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1108518] Re: lightdm should not rename() .xsession-errors, as it may be a symlink
My point isn't so much that there is a race, or a sec vuln or something. My point is that on my systems: $HOME may be on NFS. $HOME/.xsession-errors is a symlink to /usr/local/home/$USER/.xsession-errors $HOME/.xsession-errors.old is a symlink to /usr/local/home/$USER/.xsession-errors.old The obvious think is to just call readlink on logfile to canonicalize the filename. The readlink manpage specifies a way to do this 'sort of' safely. lstat(path) # to get the size of the symlink dest. allocate string of correct size. readlink(path) Check that the path we got from readlink was size bytes. Now obviously the link can be replaced (at readlink()) time, but readlink would return EINVAL then. Once we have the 'canonical' name we can call rename on that. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1108518 Title: lightdm should not rename() .xsession-errors, as it may be a symlink To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1108518/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1108518] Re: lightdm should not rename() .xsession-errors, as it may be a symlink
Is there an atomic way of doing this? Otherwise the file could be replaced with a symlink between the lstat and the copy. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1108518 Title: lightdm should not rename() .xsession-errors, as it may be a symlink To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1108518/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1108518] Re: lightdm should not rename() .xsession-errors, as it may be a symlink
Thank you for your bug report, the people working on lightdm are pretty busy with other projects as well, having a patch up for review would be very welcome if you want to work on one ;-) Note that the best to submit one for review is through a merge request, you can do one following those steps: bzr branch lp:lightdm cd lightdm bzr commit bzr push lp:~/lightdm/xsession-errors-symlink-fix bzr lp-open then select "submit for review" on the page and file the description Thanks in advance! ** Changed in: lightdm (Ubuntu) Importance: Undecided => Low ** Changed in: lightdm (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1108518 Title: lightdm should not rename() .xsession-errors, as it may be a symlink To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1108518/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs