Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Package registering should be done only by root
Marin Atanasov Nikolov committed 15 years ago
commit 6c805f9fac79c9f9827420f4a58fef7265ce9281
parent a1cadbc6e67c6886266a424398926eef499ed9c9
1 file changed +7 -0
modified pkg/register.c
@@ -1,10 +1,12 @@
#include <sys/stat.h>
+
#include <sys/types.h>
#include <sys/param.h>

#include <err.h>
#include <stdio.h>
#include <pkg.h>
#include <string.h>
+
#include <sysexits.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -61,6 +63,11 @@ exec_register(int argc, char **argv)
	int retcode = 0;
	int ret = 0;

+
	if (geteuid() != 0) {
+
		warnx("registering packages can only be done as root");
+
		return (EX_NOPERM);
+
	}
+

	pkg_new(&pkg);
	while ((ch = getopt(argc, argv, "vHc:d:f:p:P:m:o:C:n:M:s:a:r:w:O:")) != -1) {
		switch (ch) {