After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 340865 - bad display of 'Octal Permissions'
bad display of 'Octal Permissions'
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
2.14.x
Other Linux
: Normal minor
: ---
Assigned To: Javier F. Serrador
Nautilus Maintainers
: 341996 342012 347047 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-06 22:42 UTC by Sebastien Bacher
Modified: 2007-09-03 13:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Simple patch from ubuntu (795 bytes, patch)
2006-05-17 00:48 UTC, Javier F. Serrador
none Details | Review

Description Sebastien Bacher 2006-05-06 22:42:40 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."
Comment 1 Fabio Bonelli 2006-05-16 22:48:34 UTC
*** Bug 342012 has been marked as a duplicate of this bug. ***
Comment 2 Javier F. Serrador 2006-05-17 00:48:13 UTC
Created attachment 65626 [details] [review]
Simple patch from ubuntu
Comment 3 Olav Vitters 2006-05-17 05:25:42 UTC
Removing gnome-love as there already was a patch.
Comment 4 Javier F. Serrador 2006-05-17 16:38:56 UTC
The patch also strips setuid, setgid and sticky bits. Needs some work to improve.
Comment 5 Javier F. Serrador 2006-05-17 19:59:46 UTC
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.
Comment 6 Javier F. Serrador 2006-05-17 21:36:22 UTC
*** Bug 341996 has been marked as a duplicate of this bug. ***
Comment 7 Javier F. Serrador 2006-05-17 21:37:55 UTC
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);
> }
>
Comment 8 Javier F. Serrador 2006-05-17 21:41:12 UTC
The comment preserves sticky bit.

OK to commit?
Comment 9 Sebastien Bacher 2006-07-08 18:27:22 UTC
why did you close that bug? reopening ...
Comment 10 Fabio Bonelli 2006-07-10 00:31:30 UTC
*** Bug 347047 has been marked as a duplicate of this bug. ***
Comment 11 Javier F. Serrador 2006-10-03 14:11:18 UTC
Sebastien, the new nautilus permissions tab does not show octal permissions. This bug is obsolete.
Comment 12 Tim McCormack 2007-09-03 13:08:04 UTC
Javier: The "list columns" view does indeed have octal permissions as an option. Why do you say the bug is obsolete?