Bug 94392 - KFloppy uses device-nodes, which don't exist on most udev-installations
Summary: KFloppy uses device-nodes, which don't exist on most udev-installations
Status: RESOLVED WORKSFORME
Alias: None
Product: kfloppy
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Bernd Wuebben
URL:
Keywords:
: 144568 146046 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-04 14:13 UTC by Roman Kreisel
Modified: 2023-01-07 05:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KFloppy devicename-table patch (1.35 KB, patch)
2004-12-04 14:17 UTC, Roman Kreisel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kreisel 2004-12-04 14:13:56 UTC
Version:           3.3.1 (using KDE 3.3.1,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-2)
OS:                Linux (i686) release 2.6.9-1-686

On udev, there often is no "/dev/fd0h1440" (this is just an example, other device-nodes used by kfloppy often don't exist as well).

Mandrake already patched its version of kfloppy (http://www.mandrakesoft.com/security/advisories?name=MDKA-2004:047), but IMHO the patch should also be included "upstream", since more and more installations use udev.

I re-created the diff-file (against 3.3.1) and attached it.
Comment 1 Roman Kreisel 2004-12-04 14:17:20 UTC
Created attachment 8533 [details]
KFloppy devicename-table patch
Comment 2 Nicolas Goutte 2004-12-15 20:13:44 UTC
(Note: bug #94147 is supposed to change exactly the same code.)
Comment 3 Nicolas Goutte 2004-12-15 20:42:03 UTC
Even after thinking a little, I do not like the patch too much.

The main problem is that we let the user select the format but then (with the patch) we would drop that information and let fdformat and Linux choose.

So perhaps we need an entry that the user can choose for having directly /dev/fd0 and /dev/fd1. That would be propably easy to add and would not create fallbacks that invalidate the user's choice.

As for udev, itself, I do not know much about it. Does it really does not have any way to select a particular format? (even devfs as a way, see bug #94147)

Have a nice day!
Comment 4 Nicolas Goutte 2004-12-15 21:45:55 UTC
CVS commit by goutte: 

Allow the user to be able to select an "Auto-Detect" mode, to let fdformat
choose in what file format the floppy disk should be formatted (only Linux).

This is also a work-around for bug #94392
CCBUG:94392


  M +6 -1      floppy.cpp   1.81
  M +4 -0      format.cpp   1.18


--- kdeutils/kfloppy/floppy.cpp  #1.80:1.81
@@ -84,4 +84,5 @@ FloppyData::FloppyData(QWidget * parent,
         g1->addWidget( densityComboBox, 1, 1, AlignLeft );
 
+        densityComboBox->insertItem( i18n( "Auto-Detect" ) );
         densityComboBox->insertItem(i18n("3.5\" 1.44MB"));
         densityComboBox->insertItem(i18n("3.5\" 720KB"));
@@ -323,5 +324,9 @@ bool FloppyData::findDevice()
       blocks = 360;
       }
-
+#if defined(ANY_LINUX)
+    else { // For Linux, anything else is Auto
+        blocks = 0;
+    }
+#endif
 
   return true;

--- kdeutils/kfloppy/format.cpp  #1.17:1.18
@@ -174,4 +174,6 @@ const char *fd1D720[]={ "/dev/fd0u720", 
 const char *fd1h1200[]={ "/dev/fd1h1200", 0L };
 const char *fd1h360[]={ "/dev/fd1h360", 0L };
+const char *fd0auto[] = { "/dev/fd0", 0L };
+const char *fd1auto[] = { "/dev/fd1", 0L };
 #endif
 
@@ -206,4 +208,6 @@ fdinfo fdtable[] =
         { fd0h360,  0,  360, 40, 0 },
         { fd1h360,  1,  360, 40, 0 },
+        { fd0auto,  0,    0, 80, 0 },
+        { fd1auto,  1,    0, 80, 0 },
 #endif
 


Comment 5 Edward Shornock 2005-09-22 09:49:18 UTC
With kde 3.4.2 on Debian unstable, I receive the error 'Unexpected density number 0' with Udev and selecting the 'Auto-Detect' option. Using a "forward ported" patch like the Mandrake included one, I can format fine.
Comment 6 Carsten Lohrke 2007-01-02 18:23:31 UTC
According to http://forums.gentoo.org/viewtopic-t-413039.html this is still an issue with KDE 3.5.5 and if I read the the fdformat man page right, KFloppy should use setfdprm, instead relying on the legacy symlinks.
Comment 7 Lubos Lunak 2007-06-01 11:58:40 UTC
*** Bug 144568 has been marked as a duplicate of this bug. ***
Comment 8 Lubos Lunak 2007-06-01 11:59:00 UTC
*** Bug 146046 has been marked as a duplicate of this bug. ***
Comment 9 Lubos Lunak 2007-06-01 13:48:01 UTC
SVN commit 670410 by lunakl:

Check all available densities instead of a hardcoded list. This fixes autodetect.
CCBUG: 94392



 M  +9 -3      format.cpp  


--- trunk/KDE/kdeutils/kfloppy/format.cpp #670409:670410
@@ -270,14 +270,20 @@
 		emit status(i18n("Unexpected drive number %1.", drive),-1);
 		return false;
 	}
-	if (!( /* (2880==de)  || */ (1440==density) || (720==density) ||
-		(1200==density) || (360==density)))
+
+	fdinfo *deviceinfo = fdtable;
+	for ( ; deviceinfo && (deviceinfo->devices) ; deviceinfo++)
 	{
+		if (deviceinfo->blocks != density)
+			continue;
+        }
+	if (!deviceinfo)
+	{
 		emit status(i18n("Unexpected density number %1.", density),-1);
 		return false;
 	}
 
-	fdinfo *deviceinfo = fdtable;
+	deviceinfo = fdtable;
 	for ( ; deviceinfo && (deviceinfo->devices) ; deviceinfo++)
 	{
 		if (deviceinfo->blocks != density)
Comment 10 Lubos Lunak 2007-06-01 13:52:28 UTC
SVN commit 670413 by lunakl:

Default to density autodetect.
CCBUG: 94392



 M  +4 -0      floppy.cpp  


--- branches/KDE/3.5/kdeutils/kfloppy/floppy.cpp #670412:670413
@@ -702,7 +702,11 @@
 	labelnameconfig = config->readEntry( "Label", i18n("Volume label, maximal 11 characters", "KDE Floppy") );
 	quickformatconfig = config->readNumEntry("QuickFormat",0);
 	driveconfig = config->readEntry( "FloppyDrive", i18n("Primary") );
+#if defined(ANY_LINUX)
+	densityconfig = config->readEntry( "Density", i18n( "Auto-Detect" ) );
+#else
 	densityconfig = config->readEntry( "Density", i18n("3.5\" 1.44MB") );
+#endif
 	filesystemconfig = config->readEntry( "Filesystem", i18n("DOS") );
 
 }
Comment 11 Lubos Lunak 2007-06-01 13:54:08 UTC
Autodetect now should work and is the default. Leaving still open because of comment #6.
Comment 12 Andrew Crouthamel 2018-11-02 04:18:19 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 13 Andrew Crouthamel 2018-11-16 02:45:48 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 14 Justin Zobel 2022-12-08 00:00:26 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 15 Bug Janitor Service 2022-12-23 05:20:29 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Bug Janitor Service 2023-01-07 05:23:02 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!