Re: Permissions for root user

2015-03-26 Thread Christoph Pleger
Hello,

 What I do not understand here, is why the NFS server does not allow the
operation, though it does if the directory is exported read-write (I
tested that).

 Exported with rw,no_root_squash? And root user on NFS client could not
create a file? Hmm, that is strange. I will check in a few days.

Probably I did not describe detailed enough. Root can create a file in a
directory where he does not have 'official' write permissions if the NFS
server exports read-write and the client does not use aufs. Root cannot
create in such a directory if the NFS server exports read-only and the
client uses aufs.

Now, I found another strange thing with aufs:

root@nfs_client:/var/lib/nfs# ls -al
total 12
drwxr-xr-x  4 systemd-network nogroup   60 Mar 26 09:45 .
drwxr-xr-x 32 rootroot 120 Mar 26 09:36 ..
drwxr-xr-x  2 statd   nogroup 4096 Feb 28  2009 sm
drwxr-xr-x  2 statd   nogroup 4096 Feb 28  2009 sm.bak
-rw-r--r--  1 rootroot   5 Mar 26 09:36 state
root@nfs_client:/var/lib/nfs# touch file
touch: cannot touch 'file': Operation not supported
root@nfs_client:/var/lib/nfs# echo  state
root@nfs_client:/var/lib/nfs# touch file
root@nfs_client:/var/lib/nfs# ls -al
root@tombom:/var/lib/nfs# ls -al
total 12
drwxr-xr-x  4 systemd-network nogroup   80 Mar 26 09:47 .
drwxr-xr-x 32 rootroot 120 Mar 26 09:36 ..
-rw-r--r--  1 rootroot   0 Mar 26 09:47 file
drwxr-xr-x  2 statd   nogroup 4096 Feb 28  2009 sm
drwxr-xr-x  2 statd   nogroup 4096 Feb 28  2009 sm.bak
-rw-r--r--  1 rootroot   5 Mar 26 09:36 state

That is, after writing something to an already existing file, the
'Operation not supported' problem suddenly disappears.

Regards
  Christoph




--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/


Re: Permissions for root user

2015-03-26 Thread Christoph Pleger
Hello,

 I will try by myself in a few days, but I'd ask you to identify the
 systemcall which returned the error. open(2) or other? Please try
   # strace -o /tmp/s touch file
 and post /tmp/s.

I attached the resulting file.

 And is your NFS server Debian's 3.16.7-ckt7-1 too?

I am using a user-space NFS-Server, unfs3. This is because the server runs
in a semi-virtualized machine where nfs kernel server does not work.

Regards
  Christoph
execve(/usr/bin/touch, [touch, file], [/* 23 vars */]) = 0
brk(0)  = 0x1729000
access(/etc/ld.so.nohwcap, F_OK)  = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fb3f7f85000
access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or directory)
open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=17856, ...}) = 0
mmap(NULL, 17856, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb3f7f8
close(3)= 0
access(/etc/ld.so.nohwcap, F_OK)  = -1 ENOENT (No such file or directory)
open(/lib/x86_64-linux-gnu/libc.so.6, O_RDONLY|O_CLOEXEC) = 3
read(3, \177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0P\34\2\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1729984, ...}) = 0
mmap(NULL, 3836448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fb3f79be000
mprotect(0x7fb3f7b5d000, 2097152, PROT_NONE) = 0
mmap(0x7fb3f7d5d000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19f000) = 0x7fb3f7d5d000
mmap(0x7fb3f7d63000, 14880, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb3f7d63000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fb3f7f7f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fb3f7f7e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fb3f7f7d000
arch_prctl(ARCH_SET_FS, 0x7fb3f7f7e700) = 0
mprotect(0x7fb3f7d5d000, 16384, PROT_READ) = 0
mprotect(0x60d000, 4096, PROT_READ) = 0
mprotect(0x7fb3f7f87000, 4096, PROT_READ) = 0
munmap(0x7fb3f7f8, 17856)   = 0
open(/usr/lib/locale/locale-archive, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3847568, ...}) = 0
mmap(NULL, 3847568, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb3f7612000
close(3)= 0
brk(0)  = 0x1729000
brk(0x174a000)  = 0x174a000
open(file, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EOPNOTSUPP 
(Operation not supported)
utimensat(AT_FDCWD, file, NULL, 0)= -1 ENOENT (No such file or directory)
open(/usr/share/locale/locale.alias, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2492, ...}) = 0
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fb3f7f75000
read(3, # Locale name alias data base.\n#..., 32768) = 2492
read(3, , 32768)  = 0
close(3)= 0
munmap(0x7fb3f7f75000, 32768)   = 0
open(/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo, O_RDONLY) = -1 ENOENT 
(No such file or directory)
open(/usr/share/locale/en/LC_MESSAGES/coreutils.mo, O_RDONLY) = -1 ENOENT (No 
such file or directory)
open(/usr/lib/charset.alias, O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file 
or directory)
write(2, touch: , 7touch: )  = 7
write(2, cannot touch 'file', 19cannot touch 'file') = 19
open(/usr/share/locale/en_US/LC_MESSAGES/libc.mo, O_RDONLY) = -1 ENOENT (No 
such file or directory)
open(/usr/share/locale/en/LC_MESSAGES/libc.mo, O_RDONLY) = -1 ENOENT (No such 
file or directory)
write(2, : Operation not supported, 25: Operation not supported) = 25
write(2, \n, 1
)   = 1
close(1)= 0
close(2)= 0
exit_group(1)   = ?
+++ exited with 1 +++--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/