Please sync nano 2.0.9-2 from Debian unstable [was: Breaks config files by adding hard line breaks]

Bug #39866 reported by Tero Karvinen on 2006-04-17
24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nano (Debian)
Fix Released
Undecided
Unassigned
nano (Ubuntu)
Medium
Jordi Mallach
Nominated for Jaunty by Anders Kaseorg

Bug Description

Nano breaks config files by adding hard line breaks. Using nano with sudo should automatically turn on --nowrap, like in other systems.

To reproduce
1) sudo nano foo
2) type a long line
The line is broken to multiple lines. The linebreaks are stored as real linebreaks in the file.

Broken lines confuse very easily. For example, tftpd and dhcpd don't print any error messages to screen when they refuse to start because of broken lines. Fedora makes nano use --nowrap automatically when run as root.

Suggestion: enable --nowrap when nano is run with sudo.

Jordi Mallach (jordi) wrote :

Does this bug happen if you run nano after "sudo su -" ?
nano should not wrap if it detects it's being run by root. Sudo might be confusing it though.

Changed in nano:
assignee: nobody → jordi
status: Unconfirmed → Needs Info

It does not seem to be reproducible on the computer I am using now. I wonder if it is somehow related to the "long wait on start while looking at permission error" bug. I make the test when I am at a computer that has that problem. All tests done on Breezy: some Breezys show this problem, some don't.

C. Cooke (ccooke) wrote :

Just verified it here. nano called from sudoedit is definitely not safe on Dapper.

Jordi Mallach (jordi) wrote :

Ok, so it seems nano can't detect, for some reason, that it's running as root when invoked via "sudoedit".

$ sudo nano foo
works as expected
$ sudoedit foo
doesn't

Does anyone have information on how sudoedit is different to sudo?

Steven (stebalien) on 2008-02-11
Changed in nano:
status: Incomplete → Confirmed
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 alpha?

Changed in nano:
status: Confirmed → Incomplete
Anders Kaseorg (andersk) wrote :

This is still a bug in 8.10 and 9.04 alpha.

Changed in nano:
status: Incomplete → Confirmed
Anders Kaseorg (andersk) wrote :

The problem is that sudoedit invokes nano as a normal user, rather than as root. So it is not good enough for nano to disable wrapping only when running as root. That was kind of a braindead distinction anyway, because there are plenty of files you might want to edit as a normal user that are just as likely to be corrupted by nano’s automatic insertion of newlines. nano should be configured with --disable-wrapping or “set nowrap” by default.

Changed in nano:
status: Unknown → New
Anders Kaseorg (andersk) wrote :

This has now been fixed in Debian in nano 2.0.9-2.

Please sync nano 2.0.9-2 from Debian unstable into Jaunty. A debdiff is attached for reference. Full changelog:

nano (2.0.9-2) unstable; urgency=low

  * The "Yo me pago mis trajes" release.
  * Upload to unstable.
  * Bump Standards-Version to 3.8.1 (no changes required).
  * Point to versioned licences in the copyright file.
  * Update to debhelper v7 (from v4!), update Build-Depends accordingly.
  * Use dh_prep instead of dh_clean -k.
  * Add patch 01_manpage_hyphens.patch to correct a few unescaped
    hyphens, as pointed out by lintian.
  * As we're modifying the manpages, we need to temporarily build-dep
    on groff.
  * Enable nowrap in the default configuration. Although we use the
    --disable-wrapping-as-root compile option, it isn't enough for many
    reasons, as described by Anders Kaseorg in #513443. Users wishing to
    revert this can edit the global config, or use "unset nowrap" in
    their personal nanorc. Closes: #253298, #513443, and Ubuntu bugs
    #39866 and #261495.

 -- Jordi Mallach <email address hidden> Fri, 27 Mar 2009 11:04:20 +0100

summary: - Breaks config files by adding hard line breaks
+ Please sync nano 2.0.9-2 from Debian unstable [was: Breaks config files
+ by adding hard line breaks]
Martin Pitt (pitti) wrote :

[Updating] nano (2.0.9-1 [Ubuntu] < 2.0.9-2 [Debian])
 * Trying to add nano...
  - <nano_2.0.9-2.dsc: downloading from http://ftp.debian.org/debian/>
  - <nano_2.0.9.orig.tar.gz: already in distro - downloading from librarian>
  - <nano_2.0.9-2.diff.gz: downloading from http://ftp.debian.org/debian/>
I: nano [main] -> nano_2.0.9-1 [main].
I: nano [main] -> nano-tiny_2.0.9-1 [universe].
I: nano [main] -> nano-udeb_2.0.9-1 [main].

Changed in nano (Ubuntu):
status: Confirmed → Fix Released
Artur Rona (ari-tczew) wrote :

 nano (2.0.9-2) unstable; urgency=low

   * The "Yo me pago mis trajes" release.
   * Upload to unstable.
   * Bump Standards-Version to 3.8.1 (no changes required).
   * Point to versioned licences in the copyright file.
   * Update to debhelper v7 (from v4!), update Build-Depends accordingly.
   * Use dh_prep instead of dh_clean -k.
   * Add patch 01_manpage_hyphens.patch to correct a few unescaped
     hyphens, as pointed out by lintian.
   * As we're modifying the manpages, we need to temporarily build-dep
     on groff.
   * Enable nowrap in the default configuration. Although we use the
     --disable-wrapping-as-root compile option, it isn't enough for many
     reasons, as described by Anders Kaseorg in #513443. Users wishing to
     revert this can edit the global config, or use "unset nowrap" in
     their personal nanorc. Closes: #253298, #513443, and Ubuntu bugs
     #39866 and #261495.

 -- Jordi Mallach <email address hidden> Fri, 27 Mar 2009 11:04:20 +0100

Changed in nano (Debian):
importance: Unknown → Undecided
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.