From: "J. Bruce Fields" <bfields@fieldses.org>
To: "Lever, Charles" <Charles.Lever@netapp.com>
Cc: neilb@suse.de, Olaf Kirch <okir@suse.de>, nfs@lists.sourceforge.net
Subject: Re: NLM GRANT callback using AUTH_NULL is rejected
Date: Thu, 17 Nov 2005 11:27:45 -0500 [thread overview]
Message-ID: <20051117162745.GD2337@fieldses.org> (raw)
In-Reply-To: <044B81DE141D7443BCE91E8F44B3C1E2013327B7@exsvl02.hq.netapp.com>
On Thu, Nov 17, 2005 at 08:20:48AM -0800, Lever, Charles wrote:
> was it the judgement of the community that no IP address checking for
> AUTH_NULL callbacks is better than having at least *some* sanity
> checking? seems reasonable to me to register the IP address of the file
> server so that not just any joe IP address can grant locks.
My memory of the details is hazy now, but I seem to recall that lockd
does check that somewhere.
> obtw, did you happen to have a test to see if GRANTED callbacks were
> being accepted after your patch is applied? that will save me the
> trouble of working up a test myself.
All I did was run the following on two different machines, and verify
that one got the lock the instant I ^C'd the other.
--b.
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <err.h>
int main(int argc, char *argv[])
{
char buf[4096];
struct flock fl;
int fd, ret;
if (argc != 2)
errx(1, "usage: %s file_to_lock", argv[0]);
fd = open(argv[1], O_RDWR|O_CREAT, 0666);
if (fd == -1)
err(1, "open");
/* Exclusive lock on whole file: */
fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET;
fl.l_start = 0;
fl.l_len = 0;
ret = fcntl(fd, F_SETLKW, &fl);
if (ret == -1)
err(1, "fcntl(fd, F_SETLKWD, fl)");
printf("got lock; waiting\n");
select(0, NULL, NULL, NULL, NULL);
exit(0);
}
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2005-11-17 16:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 16:20 NLM GRANT callback using AUTH_NULL is rejected Lever, Charles
2005-11-17 16:27 ` J. Bruce Fields [this message]
2005-11-17 16:56 ` Trond Myklebust
2005-11-17 19:11 ` Steve Dickson
-- strict thread matches above, loose matches on Subject: below --
2005-11-17 15:38 Lever, Charles
2005-11-17 16:05 ` J. Bruce Fields
2005-11-17 16:05 ` Olaf Kirch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051117162745.GD2337@fieldses.org \
--to=bfields@fieldses.org \
--cc=Charles.Lever@netapp.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
--cc=okir@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox