Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Mar 2001 13:44:25 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Jordan DeLong <fracture@allusion.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Security problems with access(2)? 
Message-ID:  <200103312144.f2VLiP301397@mass.dis.org>
In-Reply-To: Your message of "Sun, 01 Apr 2001 14:33:48 PDT." <20010401143348.A74357@cx420564-b.tucson1.az.home.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> in a project I'm currently working on I use the access(2) call when
> going through a path for plugins to load.  For each : delim on the path
> it does an access(2) to see if there is a file there, and then it
> uses dlopen(3) to open the file as a share object, and responds
> appropriatly to any errors it may recieve from the dlopen(3)
> call.
> 
> I'd like to offer this as an example of a reasonable, and noninsecure
> usage of access (please correct me if I'm wrong).  I'm not worried about
> if the file is created after the access call: I'm just using the
> access call to avoid having to do a dlopen() on every : delim
> in the path.
> 
> Thoughts?

If you're going to dlopen(3) it anyway, calling access(2) is just a waste of 
time.  This is the most benign misuse of access(2), it's certainly not a 
"reasonable" example however.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103312144.f2VLiP301397>