[ofa-general] Re: [PATCH] suppress RLIMIT warning for root user
Michael S. Tsirkin
mst at dev.mellanox.co.il
Tue May 29 20:39:45 PDT 2007
> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCH] suppress RLIMIT warning for root user
>
> makes sense but:
>
> > - if (rlim.rlim_cur <= 32768)
> > - fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
> > - " This will severely limit memory registrations.\n",
> > - rlim.rlim_cur);
> > + if (rlim.rlim_cur > 32768)
> > + return;
> > +
> > + if (!getuid())
> > + return;
>
> I think it would be more natural to check the UID before getting the
> rlimit. And shouldn't this be geteuid() to handle processes that have
> dropped their privileges?
Agree on both points.
--
MST
More information about the general
mailing list