FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-17-2012, 02:02 AM
T o n g
 
Default zpipe.c: the zlib example

Hi,

I believe that zpipe.c used to be working.
But it is still working now?

I get it compiled OK,

gcc -g -lz -o zpipe zpipe.c

but wasn't able to run it:

$ ./zpipe
bash: ./zpipe: Permission denied

I get the same result even I put an output immediately after main:

/* compress or decompress from stdin to stdout */
int main(int argc, char **argv)
{
fputs("zpipe 1
", stderr);

Anyone has any idea how to fix it?

Thanks

PS. Enclosed is the strace log:

$ strace ./zpipe
execve("./zpipe", ["./zpipe"], [/* 130 vars */]) = -1 EACCES (Permission
denied)
dup(2) = 3
fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|
O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7f77cf048000
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied
", 32strace: exec: Permission
denied
) = 32
close(3) = 0
munmap(0x7f77cf048000, 4096) = 0
exit_group(1) = ?

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jk0urn$f6m$1@dough.gmane.org">http://lists.debian.org/jk0urn$f6m$1@dough.gmane.org
 
Old 03-17-2012, 10:28 AM
Mark Neidorff
 
Default zpipe.c: the zlib example

On Friday 16 March 2012 11:02:15 pm T o n g wrote:
> Hi,
>
> I believe that zpipe.c used to be working.
> But it is still working now?
>
> I get it compiled OK,
>
> gcc -g -lz -o zpipe zpipe.c
>
> but wasn't able to run it:
>
> $ ./zpipe
> bash: ./zpipe: Permission denied
>

Are the permissions of the file correct?

$chmod 755 zpipe


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201203170728.04520.mark@neidorff.com">http://lists.debian.org/201203170728.04520.mark@neidorff.com
 
Old 03-17-2012, 12:43 PM
Lorenzo Beretta
 
Default zpipe.c: the zlib example

Il 17/03/2012 04:10, T o n g ha scritto:

Hi,

I believe that zpipe.c used to be working.
But it is still working now?

I get it compiled OK,

gcc -g -lz -o zpipe zpipe.c

but wasn't able to run it:

$ ./zpipe
bash: ./zpipe: Permission denied

I get the same result even I put an output immediately after main:

/* compress or decompress from stdin to stdout */
int main(int argc, char **argv)
{
fputs("zpipe 1
", stderr);

Anyone has any idea how to fix it?

Thanks

PS. Enclosed is the strace log:

$ strace ./zpipe
execve("./zpipe", ["./zpipe"], [/* 130 vars */]) = -1 EACCES (Permission
denied)
dup(2) = 3
fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|
O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7f77cf048000
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied
", 32strace: exec: Permission
denied
) = 32
close(3) = 0
munmap(0x7f77cf048000, 4096) = 0
exit_group(1) = ?

Most likely your filesystem is mounted with noexec, try moving the
binary somewhere else.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4f64950e$0$1383$4fafbaef@reader2.news.tin.it">http ://lists.debian.org/4f64950e$0$1383$4fafbaef@reader2.news.tin.it
 

Thread Tools




All times are GMT. The time now is 06:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org