From fcb250efba23ae522c4c8cb03c47dd40edcf9603 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 26 Jul 2006 10:46:55 +0200 Subject: [RELEASE] flxutils-0.1.4.2 --- remount/Makefile | 12 ++++++++++++ remount/remountr | Bin 0 -> 436 bytes remount/remountr.c | 25 +++++++++++++++++++++++++ remount/remountw | 1 + 4 files changed, 38 insertions(+) create mode 100644 remount/Makefile create mode 100755 remount/remountr create mode 100644 remount/remountr.c create mode 120000 remount/remountw (limited to 'remount') diff --git a/remount/Makefile b/remount/Makefile new file mode 100644 index 0000000..718de45 --- /dev/null +++ b/remount/Makefile @@ -0,0 +1,12 @@ +OBJS=remountr remountw +include ../include/rules.make +CFLAGS+=-fomit-frame-pointer + +remountw : remountr + ln -s $^ $@ + +%: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< + strip -R .comment -R .note $@ + objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true + sstrip $@ diff --git a/remount/remountr b/remount/remountr new file mode 100755 index 0000000..eee0129 Binary files /dev/null and b/remount/remountr differ diff --git a/remount/remountr.c b/remount/remountr.c new file mode 100644 index 0000000..f45c39a --- /dev/null +++ b/remount/remountr.c @@ -0,0 +1,25 @@ +#include + +const char mount_str[] = "/bin/mount"; +const char remount_str[] = "remount"; +const char slash_str[] = "/"; +const char ro_str[] = "-ro"; +const char wo_str[] = "-wo"; + +int main (int argc, char **argv) { + char *flag, *mntpnt; + + if (argv[0][strlen(argv[0])-1] == 'w') + flag = wo_str; + else + flag = ro_str; + + setreuid(0, 0); + if (argc > 1) + mntpnt = argv[1]; + else + mntpnt = slash_str; + + return execl(mount_str, mount_str, flag, remount_str, mntpnt, NULL); +} + diff --git a/remount/remountw b/remount/remountw new file mode 120000 index 0000000..5bc7a05 --- /dev/null +++ b/remount/remountw @@ -0,0 +1 @@ +remountr \ No newline at end of file -- cgit v1.2.3