Merge pull request 'added package and linux deps' (#1) from linux-package into main

Reviewed-on: https://gitea.home.com:3000/TolaMironcenko/sudo/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
wt
2024-12-28 06:09:24 +03:00
3 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -1,2 +1,4 @@
bin
.vscode
.vscode
sudo.pkg
sudo.pkg.gz
+10 -2
View File
@@ -12,9 +12,17 @@ build:
mkdir bin; \
fi
$(CC) -o $(TARGET) $(SOURCES) $(CFLAGS)
sudo chown -v root:staff $(TARGET)
sudo chmod 4755 $(TARGET)
chown -v 0:0 $(TARGET)
chmod 4755 $(TARGET)
clean:
rm -v $(TARGET)
package:
mkdir -pv sudo.pkg/usr/bin
cp -v $(TARGET) sudo.pkg/usr/bin/sudo
echo "/usr/bin/sudo" > sudo.pkg/list
printf "#!/bin/sh\nchown -v 0:0 /usr/bin/sudo\nchmod 4755 /usr/bin/sudo" > sudo.pkg/post_install
chmod +x sudo.pkg/post_install
tar -czvf sudo.pkg.gz sudo.pkg
+4 -1
View File
@@ -2,8 +2,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// #include <sys/types.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef __linux__
#include <grp.h>
#endif
void die(char *argv0, char *obj, char *msg) {
if (msg == NULL) msg = strerror(errno);