initial checkin
[util-vserver.git] / util-vserver / src / secure-mount.c
index a7abd19..080898f 100644 (file)
@@ -49,6 +49,7 @@
 #include <ctype.h>
 #include <sys/wait.h>
 #include <libgen.h>
+#include <signal.h>
 
 #define MNTPOINT       "/etc"
 
@@ -267,6 +268,14 @@ writeStrX(int fd, char const *str)
   return writeX(fd, str, strlen(str));
 }
 
+static inline char const *
+getType(struct MountInfo const *mnt)
+{
+  if (mnt->type==0)                         return "none";
+  else if (strncmp(mnt->type, "ext", 3)==0) return "ufs";
+  else                                      return mnt->type;
+}
+
 static int
 updateMtab(struct MountInfo const *mnt, struct Options const *opt)
 {
@@ -301,7 +310,7 @@ updateMtab(struct MountInfo const *mnt, struct Options const *opt)
       writeStrX(fd, " ")==-1 ||
       writeStrX(fd, mnt->dst)==-1 ||
       writeStrX(fd, " ")==-1 ||
-      writeStrX(fd, mnt->type ? mnt->type : "none")==-1 ||
+      writeStrX(fd, getType(mnt))==-1 ||
       writeStrX(fd, " ")==-1 ||
       writeStrX(fd, mnt->data ? mnt->data : "defaults")==-1 ||
       writeStrX(fd, " 0 0\n")==-1) {
@@ -594,6 +603,8 @@ int main(int argc, char *argv[])
     return EXIT_FAILURE;
   }
 
+  signal(SIGCHLD, SIG_DFL);
+
   while (1) {
     int                c = getopt_long(argc, argv, "ht:nao:", CMDLINE_OPTIONS, 0);
     if (c==-1) break;