GNOME Bugzilla – Bug 340865
bad display of 'Octal Permissions'
Last modified: 2007-09-03 13:08:04 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/43273 "I use Dapper beta 2 (live) up to date [French] In Nautilus, octal permissions column displays a bad contents. For directory I have for example : 1200755 1601777 For a file : 200644 Last three numbers are ok. '1' appears only for a directory. ... Same behaviour for me. ... > Thanks for your bug. Could you describe what else you would expect? ... In breezy/hoary I had 755, 777, 644. 7 --> rwx 6 --> rw-- 5 --> r-x 4 --> r-- etc. I don't understand the meaning of 1200, 1601 and 200. ... According to the Desktop User Guide in Nautilus Preferences/List Columns Preferences: "Octal Permissions: Choose this option to display the permissions of the item in octal notation, for example 764." I think it would be more « user friendly » to only show the first four octal digits (I don't know if we can speak about user-friendliness when it comes to octal digits though ^^). Moreover it would follow what's done with "Permisions" column. ... http://librarian.launchpad.net/2515137/octal_perms.diff A temporary fix I used for my own Nautilus."
*** Bug 342012 has been marked as a duplicate of this bug. ***
Created attachment 65626 [details] [review] Simple patch from ubuntu
Removing gnome-love as there already was a patch.
The patch also strips setuid, setgid and sticky bits. Needs some work to improve.
I've changed the last line above to have 4 0 padded values: return g_strdup_printf ("%04o", permissions); And comenting all the bitwise operators. I have been playing with the permissions tab and I have found what I think it is the final cause of the problem. If you unset all owner permissions, the octal representation is correct, but when you mark any of them, then the strange 600 appears prepended. I've no idea what going on with it, but I'd like to progress fixing this. I reasign this bug to myself.
*** Bug 341996 has been marked as a duplicate of this bug. ***
Comment on attachment 65626 [details] [review] Simple patch from ubuntu >Index: libnautilus-private/nautilus-file.c >=================================================================== >RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v >retrieving revision 1.387 >diff -u -p -r1.387 nautilus-file.c >--- libnautilus-private/nautilus-file.c 27 Apr 2006 14:00:58 -0000 1.387 >+++ libnautilus-private/nautilus-file.c 17 May 2006 00:46:17 -0000 >@@ -4157,7 +4157,13 @@ nautilus_file_get_octal_permissions_as_s > return NULL; > } > >- permissions = file->details->info->permissions; >+ permissions = file->details->info->permissions & >+ ( GNOME_VFS_PERM_USER_ALL >+ | GNOME_VFS_PERM_GROUP_ALL >+ | GNOME_VFS_PERM_OTHER_ALL >+ | GNOME_VFS_PERM_SUID >+ | GNOME_VFS_PERM_SGID >+ | GNOME_VFS_PERM_STICKY); > return g_strdup_printf ("%04o", permissions); > } >
The comment preserves sticky bit. OK to commit?
why did you close that bug? reopening ...
*** Bug 347047 has been marked as a duplicate of this bug. ***
Sebastien, the new nautilus permissions tab does not show octal permissions. This bug is obsolete.
Javier: The "list columns" view does indeed have octal permissions as an option. Why do you say the bug is obsolete?