Author Topic: [ solved ] Permissions problem, root can not move file  (Read 931 times)

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8596
  • Aurum nostrum non est aurum vulgi.
Re: Permissions problem, root can not move file
« Reply #15 on: February 11, 2012, 06:52:01 AM »
I also have no problem moving the created glk files. There must be something specific that you've changed preventing your root from completing the actions.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6391
  • I'm going South
Re: Permissions problem, root can not move file
« Reply #16 on: February 11, 2012, 07:20:28 AM »
I also have no problem moving the created glk files. There must be something specific that you've changed preventing your root from completing the actions.


I think Just18 came up with a solution here:

http://www.pclinuxos.com/forum/index.php/topic,102520.msg874186.html#msg874186
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2444
  • Any Bugs in site?
Re: Permissions problem, root can not move file
« Reply #17 on: February 11, 2012, 04:08:25 PM »
This was a mystery to me, but what Just18 explained in the link that Bald-Brick gave in the post above, quite simple, in a drag/drop situation both locations must be in root mode. I never questioned that root could not drop into any normal user GUI.

My exercise below, in a root konsole I moved the file without any problem from /root/ to <user>, showed me that root could move a file to almost anywhere unquestioned   ;D.  

I will let it rest here, very happy that my experience is not likely to be result of my tinkering with the system. I believe this also explains these odd situations where I used work arounds when GUI did not seem to work, to me it seems those occasions always occur when my concentration is slipping.   If it was not for the fact I could repeat the problem on liveCDs of original ISOs my conclusion would have been, I have done something wrong again somewhere.    :D
Quote

[gert@localhost:~] $su
Password:

[root@localhost gert]# su -
[root@localhost ~]# touch permissions.txt
[root@localhost ~]# mv permissions.txt   /home/gert/Desktop/
[root@localhost ~]# ls -l  /home/gert/Desktop/pe*
-rw-r--r-- 1 root root 0 Feb 12 09:43 /home/gert/Desktop/permissions.txt
[root@localhost ~]#


I will mark the topic solved.
« Last Edit: February 11, 2012, 04:16:49 PM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: [ solved ] Permissions problem, root can not move file
« Reply #18 on: February 11, 2012, 04:32:29 PM »
Quote
[gert@localhost:~] $su
Password:

[root@localhost gert]# su -
[root@localhost ~]# touch permissions.txt
[root@localhost ~]# mv permissions.txt   /home/gert/Desktop/
[root@localhost ~]# ls -l  /home/gert/Desktop/pe*
-rw-r--r-- 1 root root 0 Feb 12 09:43 /home/gert/Desktop/permissions.txt
[root@localhost ~]#

/home/gert/Desktop/permissions.txt
I would have expected difficulty deleting that file as user 'gert' ....  but it seems it can be deleted by gert although the owner and group are root and others only have read access .......

I am tired now so not thinking straight  :D   probably shouldn't have posted this - making an ass of myself again ;D


MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6391
  • I'm going South
Re: [ solved ] Permissions problem, root can not move file
« Reply #19 on: February 11, 2012, 04:42:21 PM »
making an ass of myself again ;D

We don't mind -- so long as you solve our problems.  ;D
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: [ solved ] Permissions problem, root can not move file
« Reply #20 on: February 11, 2012, 04:44:39 PM »
Quote
[gert@localhost:~] $su
Password:

[root@localhost gert]# su -
[root@localhost ~]# touch permissions.txt
[root@localhost ~]# mv permissions.txt   /home/gert/Desktop/
[root@localhost ~]# ls -l  /home/gert/Desktop/pe*
-rw-r--r-- 1 root root 0 Feb 12 09:43 /home/gert/Desktop/permissions.txt
[root@localhost ~]#

/home/gert/Desktop/permissions.txt
I would have expected difficulty deleting that file as user 'gert' ....  but it seems it can be deleted by gert although the owner and group are root and others only have read access .......

I am tired now so not thinking straight  :D   probably shouldn't have posted this - making an ass of myself again ;D


When you "move" a file ... you really "rewrite" the original directory and the destination directory, not the file itself, the permissions in the game are those related to the source and destination directories.  ;)

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: [ solved ] Permissions problem, root can not move file
« Reply #21 on: February 11, 2012, 04:53:37 PM »
Quote
[gert@localhost:~] $su
Password:

[root@localhost gert]# su -
[root@localhost ~]# touch permissions.txt
[root@localhost ~]# mv permissions.txt   /home/gert/Desktop/
[root@localhost ~]# ls -l  /home/gert/Desktop/pe*
-rw-r--r-- 1 root root 0 Feb 12 09:43 /home/gert/Desktop/permissions.txt
[root@localhost ~]#

/home/gert/Desktop/permissions.txt
I would have expected difficulty deleting that file as user 'gert' ....  but it seems it can be deleted by gert although the owner and group are root and others only have read access .......

I am tired now so not thinking straight  :D   probably shouldn't have posted this - making an ass of myself again ;D


When you "move" a file ... you really "rewrite" the original directory and the destination directory, not the file itself, the permissions in the game are those related to the source and destination directories.  ;)

OK ....  it is the directory permissions that governs whether the file can be deleted or not and not the files ownership/permissions  ...  Zzzzzzz
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: [ solved ] Permissions problem, root can not move file
« Reply #22 on: February 11, 2012, 04:56:48 PM »
making an ass of myself again ;D

We don't mind -- so long as you solve our problems.  ;D

;D  ;D

the way my memory is going these days, there will be little of that  ;)

:D :D
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2444
  • Any Bugs in site?
Re: [ solved ] Permissions problem, root can not move file
« Reply #23 on: February 11, 2012, 07:40:47 PM »
AS

Amazing the education continues for me  ;D  I was thinking like Just18 but let us see in detail.


Quote
[gert@localhost ~]$ su
Password:
[root@localhost gert]#
[root@localhost gert]# su -

Now in root@~  or /root and the following quote shows that root has rwx = read,write,execute permission here, root group has only r--=read only permission and 'others' ---=nothing

Quote
[root@localhost ~]# ls -l /  <--- only want /root
.......
drwxr-x---  32 root root    4096 Feb 12 12:49 root/
......
[root@localhost ~]#

Create a file and check permissions on that, shows that root has rw-=read,write permission (not executable)
Quote
[root@localhost ~]# touch afile.glk
[root@localhost ~]# ls -l a*
......
-rw-r--r-- 1 root root 0 Feb 12 12:49 afile.glk
......
[root@localhost ~]#

As root move the file to to /home/gert/Desktop and check permissions of the Desktop directory, and the finding is:
User 'gert' has rwx to this directory (not a surprise, it is after all 'gert' domaine)

Quote
[root@localhost ~]# mv afile.glk /home/gert/Desktop/
[root@localhost ~]#

[root@localhost ~]# ls -l /home/gert  <--- only want to see /Desktop
.....
drwxr--r--  2 gert gert   4096 Feb 12 12:55 Desktop/
.....
[root@localhost ~]#

Checking the file permissions, shows that root rw-=read,write (not excutable), the file has been moved and permission not changed. The file management of the Desktop is under control of 'gert' not root but root still controls acces to the file.  root group r--=read only and others=r-- read only as well so as user I can read the content.

Quote
[root@localhost ~]# ls -l /home/gert/Desktop/afile.glk
-rw-r--r-- 1 root root 0 Feb 12 12:49 /home/gert/Desktop/afile.glk
[root@localhost ~]#

In root konsole I opened the file on the user-Desktop and added some text, as the keen eyed would note that I created empty files, not quite good enough for this check. :D

In a user-konsole I opened the file using nano and edited and then tried to save the content

Quote
[gert@localhost ~]$ nano /home/gert/Desktop/afile.glk
[gert@localhost ~]$

Quote

[ Error writing /home/gert/Desktop/afile.glk: Permission denied ]


What happens if I use root-Konq to investigate this file now.

The file opens in kwrite as normal and I can edit content but when trying to save following message right at last step.

Quote

The document could not be saved, as it was not possible to write to /home/gert/Desktop/afile.glk.

Check that you have write access to this file or that enough disk space is available.



And the user 'gert' can delete this file for example via user-Konq  :) 
« Last Edit: February 11, 2012, 07:45:22 PM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen