:: Re: [DNG] Printing -- now a permiss…
Top Page
Delete this message
Reply to this message
Author: Hendrik Boom
Date:  
To: dng
Subject: Re: [DNG] Printing -- now a permissions problem
On Mon, Oct 19, 2015 at 05:47:57PM +0100, Rainer Weikusat wrote:
> Hendrik Boom <hendrik@???> writes:
> > On Mon, Oct 19, 2015 at 05:21:06PM +0100, Rainer Weikusat wrote:
>
> [...]
>
> >> You could try running the lpr command via strace -f which ought to
> >> provide more information about the 'permission denied' error.
>
> [...]
>
> > Now for strace:
> >
> > root@notlookedfor:/home/hendrik# strace -f / /usr/bin/lpr -h -PHL3170CDW Documents/math/Librationism=1407.3877v3.ps
> > execve("/", ["/", "/usr/bin/lpr", "-h", "-PHL3170CDW", "Documents/math/Librationism=1407"...], [/* 37 vars */]) = -1 EACCES (Permission denied)
> > write(2, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
> > ) = 32
> > exit_group(1)                           = ?
> > +++ exited with 1 +++
> > root@notlookedfor:/home/hendrik# 

>
> Executing your root directory, as in
>
> strace -f /
>
> while passing the command you wanted to execute as arguments to it
> obviously won't work :-).


NO, that wouldn't. But the manual page seems to indicate that the /
goes between the strace options and the command, with a few other
options after the "/" and before the command.

Evidently I misunderstood:

SYNOPSIS
       strace  [-CdffhikqrtttTvVxxy]  [-In] [-bexecve] [-eexpr]...  [-acolumn]
       [-ofile]  [-sstrsize]  [-Ppath]...  -ppid...  /  [-D]  [-Evar[=val]]...
       [-uusername] command [args]


Doing it again without the "/":

root@notlookedfor:/home/hendrik# strace -f /usr/bin/lpr -h -PHL3170CDW 
Documents/math/Librationism=1407.3877v3.ps
execve("/usr/bin/lpr", ["/usr/bin/lpr", "-h", "-PHL3170CDW", 
"Documents/math/Librationism=1407"...], [/* 37 vars */]) = 0
brk(0)                                  = 0x92ca000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb77ae000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=91113, ...}) = 0
mmap2(NULL, 91113, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7797000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/i386-linux-gnu/i686/cmov/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\233\1\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1738492, ...}) = 0
mmap2(NULL, 1743484, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb75ed000
mmap2(0xb7791000, 12288, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0xb7791000
mmap2(0xb7794000, 10876, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7794000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb75ec000
set_thread_area({entry_number:-1, base_addr:0xb75ec940, limit:1048575, 
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, 
seg_not_present:0, useable:1}) = 0 (entry_number:6)
mprotect(0xb7791000, 8192, PROT_READ)   = 0
mprotect(0xb77d2000, 4096, PROT_READ)   = 0
munmap(0xb7797000, 91113)               = 0
brk(0)                                  = 0x92ca000
brk(0x92eb000)                          = 0x92eb000
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = 
-1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = 
-1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=529, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb77ad000
read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 529
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb77ad000, 4096)                = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=91113, ...}) = 0
mmap2(NULL, 91113, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7797000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_compat.so.2", 
O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\16\0\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30560, ...}) = 0
mmap2(NULL, 33356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) 
= 0xb75e3000
mmap2(0xb75ea000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0xb75ea000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/i386-linux-gnu/i686/cmov/libnsl.so.1", O_RDONLY|O_CLOEXEC) = 
3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\3201\0\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=92036, ...}) = 0
mmap2(NULL, 100328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb75ca000
mmap2(0xb75df000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0xb75df000
mmap2(0xb75e1000, 6120, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb75e1000
close(3)                                = 0
mprotect(0xb75df000, 4096, PROT_READ)   = 0
mprotect(0xb75ea000, 4096, PROT_READ)   = 0
munmap(0xb7797000, 91113)               = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=91113, ...}) = 0
mmap2(NULL, 91113, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7797000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_nis.so.2", 
O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\31\0\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=42668, ...}) = 0
mmap2(NULL, 45632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) 
= 0xb75be000
mmap2(0xb75c8000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0xb75c8000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_files.so.2", 
O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\32\0\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=46812, ...}) = 0
mmap2(NULL, 50132, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) 
= 0xb75b1000
mmap2(0xb75bc000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa000) = 0xb75bc000
close(3)                                = 0
mprotect(0xb75bc000, 4096, PROT_READ)   = 0
mprotect(0xb75c8000, 4096, PROT_READ)   = 0
munmap(0xb7797000, 91113)               = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2252, ...}) = 0
mmap2(NULL, 2252, PROT_READ, MAP_SHARED, 3, 0) = 0xb77ad000
_llseek(3, 2252, [2252], SEEK_SET)      = 0
munmap(0xb77ad000, 2252)                = 0
close(3)                                = 0
getuid32()                              = 0
getgid32()                              = 0
setresgid32(0, 0, 7)                    = 0
setresuid32(0, 0, 7)                    = 0
rt_sigaction(SIGHUP, {SIG_IGN, [HUP], SA_RESTART}, {SIG_DFL, [], 0}, 8) 
= 0
rt_sigaction(SIGHUP, {0x804a5e0, [HUP], SA_RESTART}, {SIG_IGN, [HUP], 
SA_RESTART}, 8) = 0
rt_sigaction(SIGINT, {SIG_IGN, [INT], SA_RESTART}, {SIG_DFL, [], 0}, 8) 
= 0
rt_sigaction(SIGINT, {0x804a5e0, [INT], SA_RESTART}, {SIG_IGN, [INT], 
SA_RESTART}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN, [QUIT], SA_RESTART}, {SIG_DFL, [], 0}, 
8) = 0
rt_sigaction(SIGQUIT, {0x804a5e0, [QUIT], SA_RESTART}, {SIG_IGN, [QUIT], 
SA_RESTART}, 8) = 0
rt_sigaction(SIGTERM, {SIG_IGN, [TERM], SA_RESTART}, {SIG_DFL, [], 0}, 
8) = 0
rt_sigaction(SIGTERM, {0x804a5e0, [TERM], SA_RESTART}, {SIG_IGN, [TERM], 
SA_RESTART}, 8) = 0
uname({sys="Linux", node="notlookedfor", ...}) = 0
open("/etc/printcap", O_RDONLY)         = 3
read(3, "HL3170CDW:\\\n        :mx=0:\\\n    "..., 8192) = 177
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2252, ...}) = 0
mmap2(NULL, 2252, PROT_READ, MAP_SHARED, 3, 0) = 0xb77ad000
_llseek(3, 2252, [2252], SEEK_SET)      = 0
munmap(0xb77ad000, 2252)                = 0
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2252, ...}) = 0
mmap2(NULL, 2252, PROT_READ, MAP_SHARED, 3, 0) = 0xb77ad000
_llseek(3, 2252, [2252], SEEK_SET)      = 0
munmap(0xb77ad000, 2252)                = 0
close(3)                                = 0
setresuid32(-1, 7, -1)                  = 0
setresgid32(-1, 7, -1)                  = 0
open("/var/spool/lpd/hl3170cdw/.seq", 
O_RDWR|O_CREAT|O_NONBLOCK|O_NOFOLLOW, 0661) = -1 EACCES (Permission 
denied)
write(2, "lpr: ", 5lpr: )                    = 5
write(2, "cannot open /var/spool/lpd/hl317"..., 41cannot open 
/var/spool/lpd/hl3170cdw/.seq) = 41
write(2, ": ", 2: )                       = 2
write(2, "Permission denied\n", 18Permission denied
)     = 18
exit_group(1)                           = ?
+++ exited with 1 +++
root@notlookedfor:/home/hendrik# 



> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng