chiark / gitweb /
extract-profile: Add manpage.
[distorted-keys] / userv / claim-dir.in
index d5f14db3e50114efe8b3ccc4ad70206d593418cb..ef8349e456026b0a78afb5ee438228648f8f24ec 100644 (file)
@@ -18,7 +18,7 @@ if ( glob service claim-dir
          1) filsys=$1 ;;                                               \
          *) echo >&2 \"usage: $quis FILSYS\"; exit 1 ;;                \
        esac;                                                           \
          1) filsys=$1 ;;                                               \
          *) echo >&2 \"usage: $quis FILSYS\"; exit 1 ;;                \
        esac;                                                           \
-       foundp=nil;                                                     \
+       foundp=nil; mode=700;                                           \
        while read fs dir opts; do                                      \
          case \"$fs\" in                                               \
            \\#* | \"\") continue ;;                                    \
        while read fs dir opts; do                                      \
          case \"$fs\" in                                               \
            \\#* | \"\") continue ;;                                    \
@@ -63,6 +63,9 @@ if ( glob service claim-dir
                  ;;                                                    \
              esac                                                      \
              ;;                                                        \
                  ;;                                                    \
              esac                                                      \
              ;;                                                        \
+           mode=*)                                                     \
+             mode=$arg                                                 \
+             ;;                                                        \
            mount=*)                                                    \
              if ! mountpoint -q \"$dir\"; then $arg \"$dir\"; fi       \
              ;;                                                        \
            mount=*)                                                    \
              if ! mountpoint -q \"$dir\"; then $arg \"$dir\"; fi       \
              ;;                                                        \
@@ -76,7 +79,7 @@ if ( glob service claim-dir
        set _ $USERV_GROUP; group=$2;                                   \
        cd \"$dir\";                                                    \
        if [ ! -d \"$user\" ]; then                                     \
        set _ $USERV_GROUP; group=$2;                                   \
        cd \"$dir\";                                                    \
        if [ ! -d \"$user\" ]; then                                     \
-         mkdir -m700 \"$user\";                                        \
+         mkdir -m$mode \"$user\";                                      \
          chown \"$user:$group\" \"$user\";                             \
        fi;                                                             \
        echo \"$dir/$USERV_USER\"                                       \
          chown \"$user:$group\" \"$user\";                             \
        fi;                                                             \
        echo \"$dir/$USERV_USER\"                                       \