added package and linux deps #1
+3
-1
@@ -1,2 +1,4 @@
|
|||||||
bin
|
bin
|
||||||
.vscode
|
.vscode
|
||||||
|
sudo.pkg
|
||||||
|
sudo.pkg.gz
|
||||||
@@ -12,9 +12,17 @@ build:
|
|||||||
mkdir bin; \
|
mkdir bin; \
|
||||||
fi
|
fi
|
||||||
$(CC) -o $(TARGET) $(SOURCES) $(CFLAGS)
|
$(CC) -o $(TARGET) $(SOURCES) $(CFLAGS)
|
||||||
sudo chown -v root:staff $(TARGET)
|
chown -v 0:0 $(TARGET)
|
||||||
sudo chmod 4755 $(TARGET)
|
chmod 4755 $(TARGET)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -v $(TARGET)
|
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
@@ -2,8 +2,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
// #include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <grp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void die(char *argv0, char *obj, char *msg) {
|
void die(char *argv0, char *obj, char *msg) {
|
||||||
if (msg == NULL) msg = strerror(errno);
|
if (msg == NULL) msg = strerror(errno);
|
||||||
|
|||||||
Reference in New Issue
Block a user