Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144463687
D50627.id156623.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50627.id156623.diff
View Options
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -39,34 +39,38 @@
*
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-#include <sys/time.h>
+#include <sys/param.h>
+#include <sys/linker.h>
+#include <sys/module.h>
#include <sys/resource.h>
-#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
#include <sys/un.h>
+#include <sys/wait.h>
+
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
#ifdef PORTMAP
#include <netinet/in.h>
#endif
#include <arpa/inet.h>
+
#include <assert.h>
+#include <err.h>
+#include <errno.h>
#include <fcntl.h>
+#include <netconfig.h>
#include <netdb.h>
+#include <pwd.h>
#include <stdbool.h>
#include <stdio.h>
-#include <netconfig.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <err.h>
-#include <pwd.h>
#include <string.h>
-#include <errno.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "rpcbind.h"
/* Global variables */
@@ -148,12 +152,15 @@
update_bound_sa();
+ /* Ensure krpc is loaded */
+ if (modfind("krpc") < 0 && kldload("krpc") < 0)
+ err(1, "krpc");
+
/* Check that another rpcbind isn't already running. */
- if ((rpcbindlockfd = (open(RPCBINDDLOCK,
- O_RDONLY|O_CREAT, 0444))) == -1)
+ if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0)
err(1, "%s", RPCBINDDLOCK);
- if(flock(rpcbindlockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK)
+ if (flock(rpcbindlockfd, LOCK_EX|LOCK_NB) != 0 && errno == EWOULDBLOCK)
errx(1, "another rpcbind is already running. Aborting");
getrlimit(RLIMIT_NOFILE, &rl);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 2:09 PM (8 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28546191
Default Alt Text
D50627.id156623.diff (1 KB)
Attached To
Mode
D50627: rpcbind: Ensure krpc is present.
Attached
Detach File
Event Timeline
Log In to Comment