Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
networkd fails to set transient hostname #4646
Comments
martinpitt
added
hostname
network
labels
Nov 10, 2016
|
i figure adding the "systemd-network" user to the default PK file should be relatively easy. At least for folks who grok PK policy well, which I don't ;-) |
|
Confirming that this works if you set |
martinpitt
self-assigned this
Nov 18, 2016
added a commit
to martinpitt/systemd
that referenced
this issue
Nov 18, 2016
|
martinpitt/systemd@a3ccebc fixes this with both the pkla-based and JS rules based polkit. I think we should just ship both, as (1) they don't really get into each other's way, (2) there is no sensible build-time detection for it, and (3) the user may upgrade polkit at runtime. I will write a test case for this before I post a PR. |
|
Agreed. |
martinpitt commentedNov 10, 2016
Submission type
systemd version the issue has been seen with
Used distribution
While investigating issue #4504 and what would break when networkd starts before D-Bus, I noticed that the only reason why networkd currently runs after
dbus.serviceis setting a transient hostname received through DHCP. But this doesn't actually seem to work: When DHCP does send a hostname, networkd saysPresumably because networkd drops its privileges to user
systemd-networkand the polkit policy of hostnamed only allows root to change the host name.FTR, I reproduced this in QEMU with
-net nic,model=virtio -net user,hostname=fizzywhich will send a hostname along with DHCP.Fixing this should go along with actually testing this in
test/networkd-test.py, as this is quite a subtle problem that isn't obvious when reviewing PRs for privilege reduction.