#278849 sysutils: unix2dos doesn't work in non-writable directories

Package:
tofrodos
Source:
tofrodos
Description:
Converts DOS <-> Unix text files, alias tofromdos
Submitter:
Andrew Moise
Date:
2013-10-29 09:51:04 UTC
Severity:
minor
#278849#5
Date:
2004-10-29 18:05:43 UTC
From:
To:
  unix2dos doesn't work in directories that aren't writable by the
current user, even if the file I'm attempting to modify is writable by
the current user.  For example:

[moise@pogo ~]$ cd /tmp
[moise@pogo /tmp]$ sudo mkdir foo
[moise@pogo /tmp]$ cd foo
[moise@pogo /tmp/foo]$ sudo touch nothing
[moise@pogo /tmp/foo]$ sudo chown moise nothing
[moise@pogo /tmp/foo]$ unix2dos nothing
unix2dos: Unable to open file ./CIO6gf.
[moise@pogo /tmp/foo]$

#278849#12
Date:
2005-11-23 23:14:58 UTC
From:
To:
# Downgrading severity as it is easy to work around this bug.
severity 278849 minor
thanks control@b.d.o BCC'd

Hello Andrew,

I have just taken over maintenance of the sysutils package and now try
to resolve some rather dated issues...

Unfortunately this is true. unix2dos first tries to write all
converted data into a newly created temporary file, which duly fails
when the user doesn't have write permission to that dir and thus isn't
allowed to create any new files.

However, the user could still convert the corresponding file in a dir
they have full access to and then overwrite the file in the original
dir with the newly generated converted file.

Nonetheless this behavior could be improved, so this will be further
worked on. The new unix2dos as present in the sysutils_2.0.0-1 I've
just uploaded to Sid / unstable at least gives a finer grained
warning message already... :)

HTH,
Flo

#278849#15
Date:
2005-11-23 23:14:58 UTC
From:
To:
# Downgrading severity as it is easy to work around this bug.
severity 278849 minor
thanks control@b.d.o BCC'd

Hello Andrew,

I have just taken over maintenance of the sysutils package and now try
to resolve some rather dated issues...

Unfortunately this is true. unix2dos first tries to write all
converted data into a newly created temporary file, which duly fails
when the user doesn't have write permission to that dir and thus isn't
allowed to create any new files.

However, the user could still convert the corresponding file in a dir
they have full access to and then overwrite the file in the original
dir with the newly generated converted file.

Nonetheless this behavior could be improved, so this will be further
worked on. The new unix2dos as present in the sysutils_2.0.0-1 I've
just uploaded to Sid / unstable at least gives a finer grained
warning message already... :)

HTH,
Flo

#278849#22
Date:
2013-10-29 09:48:32 UTC
From:
To:
I have forwarded this bug report via private email to Christopher Heng,
the upstream developer of tofrodos. He agreed with me that this is
indeed a minor issue and easy to work around. However he is aware of the
problem now.