From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA04731; Tue, 14 Jan 2003 00:12:47 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA05028 for ; Tue, 14 Jan 2003 00:12:46 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0DNCkr25698 for ; Tue, 14 Jan 2003 00:12:46 +0100 (MET) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id h0DNCi280648 ; Tue, 14 Jan 2003 00:12:44 +0100 (CET) Received: from (george@localhost) by clipper.ens.fr (8.12.3/jb-1.1) Date: Tue, 14 Jan 2003 00:12:43 +0100 From: Nicolas George To: caml-list@inria.fr Cc: tom hawkins Subject: Re: [Caml-list] Setting unix socket options. Message-ID: <20030113231243.GA22200@clipper.ens.fr> References: <20030113225141.23405.qmail@web20010.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <20030113225141.23405.qmail@web20010.mail.yahoo.com> User-Agent: Mutt/1.4 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le quartidi 24 niv=F4se, an CCXI, tom hawkins a =E9crit=A0: > I just started playing with sockets through Ocaml, but I'm=20 > having difficultly setting options on a socket. > I can get the options just fine (getsockopt), but > when I try to set an option I get "permission denied". >=20 > What am I doing wrong? You are doing wrong that you are trying to set an option that obviously requires superuser privileges. If you are using Linux, by exemple, you can see in the source code: case SO_DEBUG: =20 if(val && !capable(CAP_NET_ADMIN)) { ret =3D -EACCES; } else sk->debug=3Dvalbool; break; and the manpage says: SO_DEBUG Enable socket debugging. Only allowed for processes with = the CAP_NET_ADMIN capability or an effective user id of 0. In fact, _you_ are not doing anything wrong: the Linux kernel is wrong, because the Single Unix Specification does not mention EACCES as a permitted exit value for setsockopt, nor the fact that SO_DEBUG should be restricted. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE+I0frsGPZlzblTJMRAoyBAKC34xXICzNssSDZxxXPJiMiKA57pgCfQlwX WY4oFRNVE6C6wImfMSZXDJ4= =QzuZ -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners