Remove requirement to use user root
in snap package config files.
This commit is contained in:
parent
0e16a248f2
commit
7ca3a24686
@ -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…
Reference in New Issue
Block a user