Remove requirement to use `user root` in snap package config files.

pull/1600/head
Roger A. Light 7 years ago
parent fee71d6df1
commit 41c93565d5

@ -3,6 +3,7 @@
Broker:
- Elevate log level to warning for situation when socket limit is hit.
- Remove requirement to use `user root` in snap package config files.
1.5.2 - 20180919

@ -94,6 +94,12 @@ int drop_privileges(struct mosquitto__config *config, bool temporary)
char err[256];
int rc;
const char *snap = getenv("SNAP_NAME");
if(snap && !strcmp(snap, "mosquitto")){
/* Don't attempt to drop privileges if running as a snap */
return MOSQ_ERR_SUCCESS;
}
if(geteuid() == 0){
if(config->user && strcmp(config->user, "root")){
pwd = getpwnam(config->user);

Loading…
Cancel
Save