Get rid of sudo / running as root
This commit is contained in:
parent
7636dd1b10
commit
b388168318
10
Makefile
10
Makefile
|
@ -45,6 +45,16 @@ install: $(BINS) $(LIBEXECS)
|
||||||
mkdir -p $(DESTDIR)$(LIBEXECDIR)
|
mkdir -p $(DESTDIR)$(LIBEXECDIR)
|
||||||
install $(BINS) $(DESTDIR)$(BINDIR)
|
install $(BINS) $(DESTDIR)$(BINDIR)
|
||||||
install $(LIBEXECS) $(DESTDIR)$(LIBEXECDIR)
|
install $(LIBEXECS) $(DESTDIR)$(LIBEXECDIR)
|
||||||
|
@echo
|
||||||
|
@echo '--------------------------------------------------------------------------------'
|
||||||
|
@echo 'To finish the installation, set the CAP_NET_RAW on $(LIBEXECDIR)/ethermess-backend with'
|
||||||
|
@echo
|
||||||
|
@echo ' # setcap CAP_NET_RAW=ep $(LIBEXECDIR)/ethermess-backend'
|
||||||
|
@echo
|
||||||
|
@echo 'ethermess-backend needs to be able to create a raw ethernet packet socket, which'
|
||||||
|
@echo 'is a privileged operation. CAP_NET_RAW allows it to be done without root'
|
||||||
|
@echo 'privileges.'
|
||||||
|
@echo '--------------------------------------------------------------------------------'
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
cd $(DESTDIR)$(BINDIR) && rm $(BINS)
|
cd $(DESTDIR)$(BINDIR) && rm $(BINS)
|
||||||
|
|
|
@ -516,9 +516,13 @@ def eventloop(proc):
|
||||||
def main():
|
def main():
|
||||||
global own_nick, own_status
|
global own_nick, own_status
|
||||||
|
|
||||||
|
if len(sys.argv) != 3:
|
||||||
|
print("Usage: %s interface nick" % sys.argv[0], file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
_, interface, own_nick = sys.argv
|
_, interface, own_nick = sys.argv
|
||||||
|
|
||||||
proc = subprocess.Popen(['sudo', libexec_dir + '/ethermess-backend', interface], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = sys.stderr, bufsize = 0)
|
proc = subprocess.Popen([libexec_dir + '/ethermess-backend', interface], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = sys.stderr, bufsize = 0)
|
||||||
|
|
||||||
# Tell the backend the status and nick
|
# Tell the backend the status and nick
|
||||||
own_status = statuses.available
|
own_status = statuses.available
|
||||||
|
|
Loading…
Reference in New Issue