lost permissions after zypper patch

I just ran a zypper patch on my openSUSE 12.4 KDE 4.10 desktop. Immediately following, in my pictures directory, I lost my user privileges to enter every sub-directory. So I changed to root and ran a chown -R george:users on that directory, to try and fix it, and when looking at the ls listing for that directory, this is what comes up after the change:


george@tribaltrekker:~/Pictures> ls -l | grep drw
drw-r--r--   2 george users      4096 Sep  8  2011 airplanetemp
drw-r--r--   4 george users      4096 Jan 13  2012 aliciaslideshow
drw-r--r--   6 george users      4096 Sep  2  2012 ChronPicDisk
drw-r--r--   2 george users      4096 Jan 24  2012 Copper
drw-r--r--   2 george users      4096 Jun 24 07:09 CulturalPoints
drw-r--r--   3 george users      4096 Aug 27  2011 family pics
drw-r--r--  15 george users      4096 Sep  8  2012 FamMovPicsPalali
drw-r--r--   2 george users      4096 Jan 13  2012 Fish Videos
drw-r--r--   2 george users      4096 Mar 18  2012 HagiaSophia
drw-r--r--   2 george users      4096 Oct 10  2011 Hause house
drw-r--r--   3 george users      4096 Sep  2  2012 My Scans
drw-r--r--   2 george users      4096 Sep  2  2012 New folder
drw-r--r--   2 george users      4096 Aug 28  2011 OlsonPalawan
drw-r--r--   2 george users     16384 Jun 24  2012 palawano
drw-r--r--   2 george users    135168 Jun 24 07:05 Palawano All
drw-r--r--   4 george users      4096 Sep  2  2012 Picasa
drw-r--r--   4 george users      4096 Jan 13  2012 prayer cards
drw-r--r--   7 george users      4096 Sep 23  2006 SarNAbbyPics
drw-r--r-- 214 george users     16384 Sep 14 10:59 SavedPictures
drw-r--r--   2 george users      4096 Jun 19 14:00 signs
drw-r--r--   2 george users      4096 May 14  2012 smplayer_screenshots
drw-r--r--   2 george users      4096 Jan 15  2013 techpics
drw-r--r--   2 george users     20480 Jun 24 07:08 ToTablet
drw-r--r--   3 george users     12288 Sep 20 09:30 WallPaperPhotos
drw-r--r--   2 george users      4096 Nov  1  2011 Webcam

So even though it says that I am the owner and should be able to enter any of these subdirectories, I cannot - it always says “permission denied.” I also double-checked yast to make sure there are not 2 owners named “george”, and there is only one. I also ran “whoami” to make sure that I am the one trying to get in, and it is only me here, george.

This only seems to be a problem for the pictures directory sub-directories, as all my other directories and sub-directories in my home folder I still have access to. I tried to log out, and also when that didn’t fix it, I tried to reboot. Nothing doing - it still will not let me enter those sub-directories.

I was able, however, to enter those sub-directories as root, and I am able to see the files without a problem. I am able to open them from the command line using gimp and view the pictures. So it is not as though the directory was erased in some strange way.

You can see also here below that my ownership and permissions are correct for the directory in question:


george@tribaltrekker:~> ls -l Pictures
lrwxrwxrwx 1 george users 27 Apr  8 12:17 Pictures -> /georgedata/george/Pictures
george@tribaltrekker:~> ls -l /georgedata/george/ | grep Pictures
drwxr-xr-x  27 george users      4096 Sep 14 11:02 Pictures

Here is the list of patches that I ran today just before the problems started happening from my zypper history. I have not done anything else unusual.


tribaltrekker:/var/log/zypp # cat history | grep 09-24
2013-09-24 14:19:01|install|flash-player|11.2.202.310-2.36.1|x86_64||non-OSS update|d1d86698110d5a9ccd2a19dfe1814d08fb3d5688|
2013-09-24 14:19:01|install|flash-player-kde4|11.2.202.310-2.36.1|x86_64||non-OSS update|fb344e978090c0ccfe1b1b8d4a37dc5cddec9349|
2013-09-24 14:19:02|install|libnm-util2|0.9.6.4-5.16.1|x86_64||repo-update|adfb3c089f446703772f6b74c0cffba7f0f4b096|
2013-09-24 14:19:02|install|libpython2_7-1_0|2.7.3-10.8.1|x86_64||repo-update|dc2be68dfe185c2d22012ae3544f600a1d75531e|
2013-09-24 14:19:02|install|libnm-glib4|0.9.6.4-5.16.1|x86_64||repo-update|a3015340d41dbae7dca4058693db7d09d3537a35|
2013-09-24 14:19:03|install|libnm-glib-vpn1|0.9.6.4-5.16.1|x86_64||repo-update|27e04b2de53c3c7eb897db40ea3f1705311a8a02|
2013-09-24 14:19:07|install|python-base|2.7.3-10.8.1|x86_64||repo-update|e814d6e7fcfe12f6c0db62dcc4e8fadb9232e8d7|
2013-09-24 14:19:09|install|NetworkManager|0.9.6.4-5.16.1|x86_64||repo-update|c59f184b9d6a245a36d244f322143215aa8f9048|
2013-09-24 14:19:10|install|python-xml|2.7.3-10.8.1|x86_64||repo-update|16e137fa7c91bf3588c1644a2778af64c7fb73ff|
2013-09-24 14:19:10|install|python-tk|2.7.3-10.8.1|x86_64||repo-update|7bccd3580161d798aa82cf8e68b09e80ba5b0177|
2013-09-24 14:19:13|install|python-devel|2.7.3-10.8.1|x86_64||repo-update|065f0b704f5f0b03a2c81346cf388430a83025fe|
2013-09-24 14:19:14|install|python|2.7.3-10.8.1|x86_64||repo-update|28aef5c2be27936255d1451bfbc9a3618e80e4c9|

I don’t know which of these caused the problem - might it be the flash player update?

In any case, how do I go back/revert so that I can continue to have access to my pictures?

Also, I checked bugzilla and couldn’t find an equivalent bug. But I am hesitant to file a bug report unless I know which package caused the permissions problem.

Thanks in advance,


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

Don’t know what caused it, but my bet is that you want to change back to the proper permissions, i.e. 755 for folders, 644 for files. Here’s how you do that (since you already chowned your homedir you can execute the commands as a user, no need for root permissions:

to change all the directories to 755:

    find /home/george -type d -exec chmod 755 {} \;


to change all the files to 644:

    find /home/george -type f -exec chmod 644 {} \;


On 09/24/2013 04:16 PM, Knurpht wrote:
>
> Don’t know what caused it, but my bet is that you want to change back to
> the proper permissions, i.e. 755 for folders, 644 for files. Here’s how
> you do that (since you already chowned your homedir you can execute the
> commands as a user, no need for root permissions:
>
> to change all the directories to 755:
>
>
>
> Code:
> --------------------
> find /home/george -type d -exec chmod 755 {} ;
>
>
> --------------------

Running this only on the Pictures directory, here is the result:


george@tribaltrekker:~> find ./Pictures -type d -exec chmod 755 {} \;
george@tribaltrekker:~> cd Pictures/
george@tribaltrekker:~/Pictures> ls -l | grep dr
drw-r--r--   2 george users      4096 Sep  8  2011 airplanetemp
drw-r--r--   4 george users      4096 Jan 13  2012 aliciaslideshow
drw-r--r--   6 george users      4096 Sep  2  2012 ChronPicDisk
drw-r--r--   2 george users      4096 Jan 24  2012 Copper
drw-r--r--   2 george users      4096 Jun 24 07:09 CulturalPoints
drw-r--r--   3 george users      4096 Aug 27  2011 family pics
drw-r--r--  15 george users      4096 Sep  8  2012 FamMovPicsPalali
drw-r--r--   2 george users      4096 Jan 13  2012 Fish Videos
drw-r--r--   2 george users      4096 Mar 18  2012 HagiaSophia
drw-r--r--   2 george users      4096 Oct 10  2011 Hause house
drw-r--r--   3 george users      4096 Sep  2  2012 My Scans
drw-r--r--   2 george users      4096 Sep  2  2012 New folder
drw-r--r--   2 george users      4096 Aug 28  2011 OlsonPalawan
drw-r--r--   2 george users     16384 Jun 24  2012 palawano
drw-r--r--   2 george users    135168 Jun 24 07:05 Palawano All
drw-r--r--   4 george users      4096 Sep  2  2012 Picasa
drw-r--r--   4 george users      4096 Jan 13  2012 prayer cards
drw-r--r--   7 george users      4096 Sep 23  2006 SarNAbbyPics
drw-r--r-- 214 george users     16384 Sep 14 10:59 SavedPictures
drw-r--r--   2 george users      4096 Jun 19 14:00 signs
drw-r--r--   2 george users      4096 May 14  2012 smplayer_screenshots
drw-r--r--   2 george users      4096 Jan 15  2013 techpics
drw-r--r--   2 george users     20480 Jun 24 07:08 ToTablet
drw-r--r--   3 george users     12288 Sep 20 09:30 WallPaperPhotos
drw-r--r--   2 george users      4096 Nov  1  2011 Webcam

So you see they are all the owner “george”

to change all the files to 644:

Code:

    find /home/george -type f -exec chmod 644 {} \;

So now I enter the Pictures directory, and I run the following, with
this result:


george@tribaltrekker:~/Pictures> find . -type f -exec chmod 644 {} \;
..
..
..
chmod: cannot access ‘./ToTablet/DSCN1117.jpg’: Permission denied
chmod: cannot access ‘./ToTablet/DSCN0369.JPG’: Permission denied
chmod: cannot access ‘./ToTablet/P1010017.JPG’: Permission denied
chmod: cannot access ‘./ToTablet/IMG_4585.jpg’: Permission denied
chmod: cannot access ‘./ToTablet/DSCN1446.JPG’: Permission denied
chmod: cannot access ‘./ToTablet/2011-12-01_12-12-50.jpg’: Permission denied
..
..
..

And there are thousands of those “permission denied” notices, because no
matter how many times or ways I try and execute the command “chmod” or
“chown”, it simply does not change the owner, or the permissions, or both.

The complicating factor is that my system indicates that the ownerships
and permissions are changed and that I SHOULD have access, but I don’t.

If I look at every single one of those files that have “permission
denied” above, you can see here what my system indicates are the true
ownerships and permissions. I had to go in as root to show this, and I
only picked specifically the same files as above to make it clear:


tribaltrekker:/home/george/Pictures/ToTablet # ls -l DSCN1117.jpg
DSCN0369.JPG P1010017.JPG IMG_4585.jpg DSCN1446.JPG 2011-12-01_12-12-50.jpg
-rw-r--r-- 1 george users 237676 Dec 13  2012 2011-12-01_12-12-50.jpg
-rw-r--r-- 1 george users 308940 Dec 13  2012 DSCN0369.JPG
-rw-r--r-- 1 george users 489576 Dec 13  2012 DSCN1117.jpg
-rw-r--r-- 1 george users 117309 Dec 13  2012 DSCN1446.JPG
-rw-r--r-- 1 george users 412861 Dec 13  2012 IMG_4585.jpg
-rw-r--r-- 1 george users 287727 Dec 13  2012 P1010017.JPG

There it is. It says I have the privilege of entering the directory and
viewing those files, but I can only enter and view those files as root,
and if I try and change the ownership and permissions, even as root, it
doesn’t change anything.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

That’s because you did not change the perms of ~/Pictures itself. Please also show output of

ls -ld /home/george

and

ls -ld /home/george/Pictures

On 09/24/2013 05:06 PM, Knurpht wrote:
>
> That’s because you did not change the perms of ~/Pictures itself. Please
> also show output of
>
> Code:
> --------------------
> ls -ld /home/george
> --------------------
> and
>
> Code:
> --------------------
> ls -ld /home/george/Pictures
> --------------------
>
>


tribaltrekker:/home/george # ls -ld /home/george
drwxr-xr-x 70 george users 4096 Sep 24 16:46 /home/george
tribaltrekker:/home/george # ls -ld /home/george/Pictures
lrwxrwxrwx 1 george users 27 Apr  8 12:17 /home/george/Pictures ->
/georgedata/george/Pictures
tribaltrekker:/home/george # ls -ld /georgedata/george/Pictures
drwxr-xr-x 27 george users 4096 Sep 14 11:02 /georgedata/george/Pictures

Either I am blind and am not seeing something that is totally obvious,
or there is something very wrong.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

OK, we’re getting somewhere. I see now that ~/Pictures is a symlink. Now please show the output of


ls -ld /georgedata && ls -ld /georgedata/george && ld -ld /georgedata/george/Pictures
cat /etc/fstab | grep georgedata

On 09/24/2013 06:16 PM, Knurpht wrote:
>
>
> Code:
> --------------------
>
> ls -ld /georgedata && ls -ld /georgedata/george && ld -ld /georgedata/george/Pictures
> cat /etc/fstab | grep georgedata
>
> --------------------
>
>


george@tribaltrekker:~>  ls -ld /georgedata && ls -ld /georgedata/george
&& ls -ld /georgedata/george/Pictures
drwxr-xr-x 5 root root 4096 Jun 25 09:13 /georgedata
drwxr-xr-x 109 george users 4096 Apr 19 16:38 /georgedata/george
drwxr-xr-x 27 george users 4096 Sep 14 11:02 /georgedata/george/Pictures
george@tribaltrekker:~> cat /etc/fstab | grep georgedata
LABEL=home           /georgedata                ext4
acl,user_xattr        1 2
#LABEL=nhome123cfg    /georgedata               ext4
acl,user_xattr        1 2

Funny thing is, none of these configurations changed. The only thing
that I did differently was the zypper patch, and after that is when I
noticed I did not have any access to the Pictures sub-directories.

If something happened before I did zypper patch, I don’t know what it
could have been.

Why pictures, I wonder? the zypper patch had some updates to glib, flash
player, and python. The only thing that had access to the pictures was
that I had as my KDE desktop a slideshow from the
/Pictures/WallPaperPhotos directory, and a KDE photo widget that
randomly selected pictures for display, changing every few minutes, from
all the sub-directories in /Pictures/.

It seems that my system thinks that these sub-directories are root owner
and root permissions, but the display from ls shows them to be george:user.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

On 09/24/2013 06:29 PM, grglsn wrote:
> On 09/24/2013 06:16 PM, Knurpht wrote:
>>
>>
>> Code:
>> --------------------
>>
>> ls -ld /georgedata && ls -ld /georgedata/george && ld -ld /georgedata/george/Pictures
>> cat /etc/fstab | grep georgedata
>>
>> --------------------
>>
>>
>


> george@tribaltrekker:~>  ls -ld /georgedata && ls -ld /georgedata/george
> && ls -ld /georgedata/george/Pictures
> drwxr-xr-x 5 root root 4096 Jun 25 09:13 /georgedata
> drwxr-xr-x 109 george users 4096 Apr 19 16:38 /georgedata/george
> drwxr-xr-x 27 george users 4096 Sep 14 11:02 /georgedata/george/Pictures
> george@tribaltrekker:~> cat /etc/fstab | grep georgedata
> LABEL=home           /georgedata                ext4
> acl,user_xattr        1 2
> #LABEL=nhome123cfg    /georgedata               ext4
> acl,user_xattr        1 2
> 

>
> Funny thing is, none of these configurations changed. The only thing
> that I did differently was the zypper patch, and after that is when I
> noticed I did not have any access to the Pictures sub-directories.
>
> If something happened before I did zypper patch, I don’t know what it
> could have been.
>
> Why pictures, I wonder? the zypper patch had some updates to glib, flash
> player, and python. The only thing that had access to the pictures was
> that I had as my KDE desktop a slideshow from the
> /Pictures/WallPaperPhotos directory, and a KDE photo widget that
> randomly selected pictures for display, changing every few minutes, from
> all the sub-directories in /Pictures/.
>
> It seems that my system thinks that these sub-directories are root owner
> and root permissions, but the display from ls shows them to be george:user.
>

I just tried one more thing, and it also did not work. I created a new
user, “test”. Then as root, I recursively changed the ownership of one
one of the directories,
~/Pictures/airplanetemp
to ownership of test:users.

Then I logged out as george, and logged in as test. I went to that
directory and tried to enter it (using the “cd” command), and I got the
same thing: Permission denied.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

The one thing I can think of at this moment, is to do a

chown george:users /georgedata/* -R

BTW. My extra partitions have “defaults” as fstab option, please also post output of

mount

AFAIK the options “acl” and “user_xattr” are now default for ext4, so it should make no difference if they are specified or not.

And according to the OP’s last directory listing, there are no ACL’s there anyway that could cause this (they would show up as ‘+’ in ls’s output).

Did you set the ‘x’ flag for that directory (“chmod +x ~/Pictures/airplanetemp”, maybe as root if needed)?
That’s needed for entering the directory and those ‘x’ flags were not set in the last listing you posted.

Have you tried to enter the directory as root?
If you get “Permission denied” then as well, this is most likely caused by an inconsistent filesystem.
You should run fsck in that case.

On 09/24/2013 07:06 PM, wolfi323 wrote:

> Did you set the ‘x’ flag for that directory (“chmod +x
> ~/Pictures/airplanetemp”, maybe as root if needed)?
> That’s needed for entering the directory and those ‘x’ flags were not
> set in the last listing you posted.
>
That was it! It was the ‘x’ flag. I set the ‘x’ flag on everything, and
now I can enter the directories and look at all the pictures again.
Everything is fixed now. Thanks!!

What exactly is the ‘x’ flag? And how could you tell if it was set or
not? Because to me it looked like everything was correct for being able
to enter the directories.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

On 09/24/2013 07:30 PM, golson765 wrote:
> On 09/24/2013 07:06 PM, wolfi323 wrote:
>
>> Did you set the ‘x’ flag for that directory (“chmod +x
>> ~/Pictures/airplanetemp”, maybe as root if needed)?
>> That’s needed for entering the directory and those ‘x’ flags were not
>> set in the last listing you posted.
>>
> That was it! It was the ‘x’ flag. I set the ‘x’ flag on everything, and
> now I can enter the directories and look at all the pictures again.
> Everything is fixed now. Thanks!!
>
> What exactly is the ‘x’ flag? And how could you tell if it was set or
> not? Because to me it looked like everything was correct for being able
> to enter the directories.
>
>
>
Ok, after looking it up on the man chmod page, I think I can put
together what happened. Right after I did my zypper patch, a picture
came up in my picture frame widget, totally unrelated to the zypper
patch. It was only coincidental with the zypper patch.

That one picture happened to be one that had a set of messed up
ownership and permissions, so I went to modify it, and noticed a few
other pictures in that directory had the same thing (they were in the
vboxusers group instead of the users group). So I decided to ‘fix’ all
of my thousands of pictures at once by recursively executing some chmod
and chown commands on my whole /home/george/Pictures directory.

What I didn’t realize was that the ‘x’ bit (rwx) is necessary to be able
to look into the directories. I thought that the ‘r’ bit was the only
bit that was necessary. So when I looked at my permissions for all those
directories, they all said drw-r–r–, and I assumed that I should be
able to look into the directories because of that. But apparently, that
is not the case. It has to be drwxr-xr-x with the ‘r’ and the ‘x’ there
in order to look into the directories (is that right?). I guess it is
different if it is a file. I had always just assumed that ‘x’ meant
‘execute’, which didn’t really apply in the case of a directory. I guess
it pays to read the man pages.

So when I changed the permissions to drw-r–r-- (chmod 644) for all my
directories, I was actually taking away my own ability to look into
those directories. Wow, never saw that coming.

So, thanks guys for your help - always something new to learn!


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

On 09/24/2013 07:30 AM, golson765 pecked at the keyboard and wrote:
> On 09/24/2013 07:06 PM, wolfi323 wrote:
>
>> Did you set the ‘x’ flag for that directory (“chmod +x
>> ~/Pictures/airplanetemp”, maybe as root if needed)?
>> That’s needed for entering the directory and those ‘x’ flags were not
>> set in the last listing you posted.
>>
> That was it! It was the ‘x’ flag. I set the ‘x’ flag on everything,
> and now I can enter the directories and look at all the pictures
> again. Everything is fixed now. Thanks!!
>
> What exactly is the ‘x’ flag? And how could you tell if it was set or
> not? Because to me it looked like everything was correct for being
> able to enter the directories.
>
>
>

Directories need the execute bit set in order for you to search them.



man 1 chmod


will provide more information.

Ken

‘r’ is sufficient to read the entries of a directory, but to access an entry and do anything with it (including “stat”, i.e. get information about the entry) you need the ‘x’ permission.
Well, “executing” a directory means entering it. They didn’t want to add another (different) flag for that I guess…

wolfi323 wrote:
> Well, “executing” a directory means entering it. They didn’t want to add
> another (different) flag for that I guess…

That’s right. The convention was invented in the days when a bit was
worth something :slight_smile:

You could buy a whole meal for two bits …

On 2013-09-25 13:35, Dave Howorth wrote:
> wolfi323 wrote:
>> Well, “executing” a directory means entering it. They didn’t want to add
>> another (different) flag for that I guess…
>
> That’s right. The convention was invented in the days when a bit was
> worth something :slight_smile:

Well, I think they used 8 flags, ie, a byte. One more flag, and it would
be two bytes.

But that is wrong, because “ls -l” lists 10 flags. That’s two bytes.

I can think of the sticky bits, that’s two more bits. 4 more missing…

>
> You could buy a whole meal for two bits …

:slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Carlos E. R. wrote:
> On 2013-09-25 13:35, Dave Howorth wrote:
>> wolfi323 wrote:
>>> Well, “executing” a directory means entering it. They didn’t want to add
>>> another (different) flag for that I guess…
>> That’s right. The convention was invented in the days when a bit was
>> worth something :slight_smile:
>
> Well, I think they used 8 flags, ie, a byte. One more flag, and it would
> be two bytes.

Bytes did exist then, but they weren’t very common outside of IBM
mainframes. More interesting is that the PDP-7 and PDP-11 used octal
(rather than hex) so groups of three flags are perhaps significant.

On 09/25/2013 07:35 AM, Dave Howorth pecked at the keyboard and wrote:
> wolfi323 wrote:
>> Well, “executing” a directory means entering it. They didn’t want to add
>> another (different) flag for that I guess…
> That’s right. The convention was invented in the days when a bit was
> worth something :slight_smile:
>
> You could buy a whole meal for two bits …

And get change as well.

:slight_smile:

Ken