fix(feuille.c): use {u,g}id_t instead of int for uid and gid

This commit is contained in:
Tom MTT. 2022-11-29 14:31:29 +01:00
parent 9f9a25237a
commit de702c9b58
2 changed files with 5 additions and 4 deletions

View file

@ -1,5 +1,5 @@
# feuille version # feuille version
VERSION = 1.19.2 VERSION = 1.19.3
# paths (customize them to fit your system) # paths (customize them to fit your system)
PREFIX = /usr/local PREFIX = /usr/local
@ -18,8 +18,8 @@ LIBS = -L/usr/lib -lc
CC = cc CC = cc
# debug build # debug build
CFLAGS = -g -std=c99 -Wall -Wextra -Wpedantic -Wno-sign-compare -DVERSION=\"$(VERSION)\" -DDEBUG $(INCS) CFLAGS = -g -std=c99 -Wall -Wextra -Wpedantic -Wno-sign-compare -ggdb -Wall -Wextra -pedantic -fsanitize=address -fno-omit-frame-pointer -DVERSION=\"$(VERSION)\" -DDEBUG $(INCS)
LDFLAGS = -g $(LIBS) LDFLAGS = -g $(LIBS) -g -std=c99 -Wall -Wextra -Wpedantic -Wno-sign-compare -ggdb -Wall -Wextra -pedantic -fsanitize=address -fno-omit-frame-pointer -DVERSION=\"$(VERSION)\" -DDEBUG $(INCS)
# release build # release build
CFLAGS$(DEBUG) = -std=c99 -Wall -Wextra -Wno-sign-compare -DVERSION=\"$(VERSION)\" -O3 $(INCS) CFLAGS$(DEBUG) = -std=c99 -Wall -Wextra -Wno-sign-compare -DVERSION=\"$(VERSION)\" -O3 $(INCS)

View file

@ -326,7 +326,8 @@ int main(int argc, char *argv[])
chdir(path); chdir(path);
/* user checks */ /* user checks */
int uid = 0, gid = 0; uid_t uid = 0;
gid_t gid = 0;
if (getuid() == 0) { if (getuid() == 0) {
if (strlen(settings.user) == 0) if (strlen(settings.user) == 0)
settings.user = "nobody"; settings.user = "nobody";