Bug 17196 - 6_s1: No newline at end of file /etc/sysconfig/userdrake
Summary: 6_s1: No newline at end of file /etc/sysconfig/userdrake
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Low enhancement
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords: Junior_job
Depends on:
Blocks:
 
Reported: 2015-11-21 20:45 CET by Bit Twister
Modified: 2016-08-28 12:55 CEST (History)
3 users (show)

See Also:
Source RPM: userdrake-2.10-4.mga6.src.rpm
CVE:
Status comment:


Attachments

Description Bit Twister 2015-11-21 20:45:11 CET
Description of problem:
 No newline at end of file /etc/sysconfig/userdrake

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. cat  /etc/sysconfig/userdrake


# dif /etc/sysconfig/userdrake.rpmnew /etc/sysconfig/userdrake
1,5c1
< #Configuration file for userdrake2
< #Copyright (c) 2003 MandrakeSoft SA.  all rights reserved
< 
< #Filter out sytem users by default
< FILTER=true
\ No newline at end of file
---
> FILTER=false


Reproducible: 

Steps to Reproduce:
David Walser 2015-11-24 15:35:13 CET

CC: (none) => anaselli, thierry.vignaud

Comment 1 Angelo Naselli 2015-11-24 16:33:26 CET
Which is the problem here?
Comment 2 Rémi Verschelde 2015-11-24 16:45:10 CET
I guess just the cosmetic issue that there is no newline as the end of /etc/sysconfig/userdrake, while that's a convention for unix text files.

Severity: normal => enhancement

Comment 3 Bit Twister 2015-11-24 17:43:28 CET
(In reply to Angelo Naselli from comment #1)
> Which is the problem here?

Looking at the above resulting diff command we see
     < FILTER=true
     \ No newline at end of file
indicating there is no newline (Enter key) character at the end of the
     FILTER=true
line.

It may look like a "cosmetic issue" to Rémi Verschelde but I have seen problems in the past where the missing newline prevented the line from being read by the application.  :(
Comment 4 Rémi Verschelde 2015-11-24 18:06:10 CET
(In reply to Bit Twister from comment #3)
> 
> It may look like a "cosmetic issue" to Rémi Verschelde but I have seen
> problems in the past where the missing newline prevented the line from being
> read by the application.  :(

But in 2015 I'd say that this would be a parsing bug in the said application :) Won't hurt to add the missing newline though.
Comment 5 Angelo Naselli 2015-11-24 18:30:42 CET
@Remi which application? because reporter used diff :)

Maybe rpmdrake... that uses diff as well, certainly userdrake does not complain for that, since it just takes its configuration file without checking if .rpmnew
exists... am i wrong?
Comment 6 Bit Twister 2015-11-24 19:09:14 CET
(In reply to Angelo Naselli from comment #5)
> @Remi which application? because reporter used diff :)
> 
> Maybe rpmdrake... that uses diff as well, 

If it checks diff return status code, then yes.


$ diff e f
1c1
< _var=junk
---
> _var=junk
\ No newline at end of file

$ echo $?
1
Comment 7 Angelo Naselli 2015-11-24 19:15:22 CET
well rpmdrake does it:

my @diff = map { ensure_utf8($_); $_ } `/usr/bin/diff -u '$file' '$rpmnew'`;

but rpmnew dialog is not always shown iirc.

This bug complains aganist userdrake though....
Comment 8 Bit Twister 2015-11-24 19:27:26 CET
(In reply to Angelo Naselli from comment #7)
> well rpmdrake does it:
> 
> my @diff = map { ensure_utf8($_); $_ } `/usr/bin/diff -u '$file' '$rpmnew'`;
> 
> but rpmnew dialog is not always shown iirc.
> 
> This bug complains aganist userdrake though....

Not a rpmdrake problem. diff is reporting contents do not match, which is correct.
Comment 9 Frank Griffin 2015-11-24 19:46:13 CET
As rpmnew files are text, possibly we should be using the --ignore-all-space option of diff ?

CC: (none) => ftg

Comment 10 Bit Twister 2015-11-24 19:57:03 CET
(In reply to Frank Griffin from comment #9)
> As rpmnew files are text, possibly we should be using the --ignore-all-space
> option of diff ?

Are there some files that are "space" sensitive? I have no clue if indented lines seen in .xml files are sensitive to indention or not.

Just add the newline to /etc/sysconfig/userdrake and we are done with getting a rpmnew file if a user toggles the filter back to true.  :)
Comment 11 Frank Griffin 2015-11-24 20:45:04 CET
(In reply to Bit Twister from comment #10)
> (In reply to Frank Griffin from comment #9)
> > As rpmnew files are text, possibly we should be using the --ignore-all-space
> > option of diff ?
> 
> Are there some files that are "space" sensitive? I have no clue if indented
> lines seen in .xml files are sensitive to indention or not.

XML files are absolutely not whitespace-sensitive.  The only config files I can think of that are would be if someone inserted space around the x=y assignments in a shell script, but that would fail in any case.  Assuming that the rpmnew file actually works in testing, I can't see the downside to using this.  In any case, there are more restrictive options to diff, like --ignore-trailing-space, which would match this case more exactly.

> 
> Just add the newline to /etc/sysconfig/userdrake and we are done with
> getting a rpmnew file if a user toggles the filter back to true.  :)

Well, until the next file without a trailing newline comes along (I'm assuming some upstream editor must be saving them that way) :-)
Comment 12 Samuel Verschelde 2015-11-25 10:42:44 CET
Spaces matter in YAML files.
Comment 13 Samuel Verschelde 2015-12-07 13:28:38 CET
Assigning to packagers collectively since userdrake has no registered maintainer in our database.

Keywords: (none) => Junior_job
Priority: Normal => Low
Assignee: bugsquad => pkg-bugs

Bit Twister 2016-07-06 20:49:51 CEST

Summary: mga6: No newline at end of file /etc/sysconfig/userdrake => 6_s1: No newline at end of file /etc/sysconfig/userdrake

Samuel Verschelde 2016-08-27 16:39:47 CEST

Assignee: pkg-bugs => mageiatools

Comment 14 Mageia Robot 2016-08-28 10:44:19 CEST
commit a756a164501a20d17b676a7e87209f780a7d01b2
Author: Angelo Naselli <anaselli@...>
Date:   Sun Aug 28 10:42:40 2016 +0200

    Added newline into configuration file, mga#17196
---
 Commit Link:
   http://gitweb.mageia.org/software/userdrake/commit/?id=a756a164501a20d17b676a7e87209f780a7d01b2
Comment 15 Bit Twister 2016-08-28 12:13:54 CEST
works for me.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 16 Angelo Naselli 2016-08-28 12:55:36 CEST
Well maybe, before closing it, we should package userdrake first :) (I cannot do that now, hope someone else)

Note You need to log in before you can comment on or make changes to this bug.