[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sockets



hi,

> > i am a non-root user on a debian 2.2 system and i cant write a c program
to
> > open sockets.
> >
> > i am a non-root user on a solaris system and i am able to write c
programs
> > that open sockets.
> >
> > is there a switch/setting somewhere on a debian system to change this?
or is
> > root the only user allowed to create sockets on a debian system?
>
> Anyone can create sockets, although not in the range of ports less than
> 1024 (this should not be different on Solaris).  The problem is probably
> with the program.  Can you send an example of the code that causes the
> problem, and maybe someone can find it :}

well the problem is with an igmp c program i have, the strace shows:

socket(PF_INET, SOCK_RAW, IPPROTO_IGMP) = -1 EPERM (Operation not permitted)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40014000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "Could not allocate socket.\n", 27Could not allocate socket.
) = 27
munmap(0x40014000, 4096)                = 0
_exit(1)                                = ?

so im assuming a "raw socket" is a udp socket? and that you need root
priviledges for udp sockets? (simalar to why you cant run nmap udp scans
unless you're root).

am i on the right track?

Regards,

Marc-Adrian Napoli
Network Admin
Connect Infobahn Australia
+61 2 9212 0387




Reply to: