@@ -20,9 +20,11 @@ import (
20
20
type argContainer struct {
21
21
debug , init , zerokey , fusedebug , openssl , passwd , fg , version ,
22
22
plaintextnames , quiet , nosyslog , wpanic ,
23
- longnames , allow_other , ro , reverse , aessiv , nonempty , raw64 ,
23
+ longnames , allow_other , reverse , aessiv , nonempty , raw64 ,
24
24
noprealloc , speed , hkdf , serialize_reads , forcedecode , hh , info ,
25
25
sharedstorage , devrandom , fsck bool
26
+ // Mount options with opposites
27
+ dev , nodev , suid , nosuid , exec , noexec , rw , ro bool
26
28
masterkey , mountpoint , cipherdir , cpuprofile , extpass ,
27
29
memprofile , ko , passfile , ctlsock , fsname , force_owner , trace string
28
30
// Configuration file name override
@@ -121,7 +123,6 @@ func parseCliOpts() (args argContainer) {
121
123
flagSet .BoolVar (& args .longnames , "longnames" , true , "Store names longer than 176 bytes in extra files" )
122
124
flagSet .BoolVar (& args .allow_other , "allow_other" , false , "Allow other users to access the filesystem. " +
123
125
"Only works if user_allow_other is set in /etc/fuse.conf." )
124
- flagSet .BoolVar (& args .ro , "ro" , false , "Mount the filesystem read-only" )
125
126
flagSet .BoolVar (& args .reverse , "reverse" , false , "Reverse mode" )
126
127
flagSet .BoolVar (& args .aessiv , "aessiv" , false , "AES-SIV encryption" )
127
128
flagSet .BoolVar (& args .nonempty , "nonempty" , false , "Allow mounting over non-empty directories" )
@@ -137,6 +138,17 @@ func parseCliOpts() (args argContainer) {
137
138
flagSet .BoolVar (& args .sharedstorage , "sharedstorage" , false , "Make concurrent access to a shared CIPHERDIR safer" )
138
139
flagSet .BoolVar (& args .devrandom , "devrandom" , false , "Use /dev/random for generating master key" )
139
140
flagSet .BoolVar (& args .fsck , "fsck" , false , "Run a filesystem check on CIPHERDIR" )
141
+
142
+ // Mount options with opposites
143
+ flagSet .BoolVar (& args .dev , "dev" , false , "Allow device files" )
144
+ flagSet .BoolVar (& args .nodev , "nodev" , false , "Deny device files" )
145
+ flagSet .BoolVar (& args .suid , "suid" , false , "Allow suid binaries" )
146
+ flagSet .BoolVar (& args .nosuid , "nosuid" , false , "Deny suid binaries" )
147
+ flagSet .BoolVar (& args .exec , "exec" , false , "Allow executables" )
148
+ flagSet .BoolVar (& args .noexec , "noexec" , false , "Deny executables" )
149
+ flagSet .BoolVar (& args .rw , "rw" , false , "Mount the filesystem read-write" )
150
+ flagSet .BoolVar (& args .ro , "ro" , false , "Mount the filesystem read-only" )
151
+
140
152
flagSet .StringVar (& args .masterkey , "masterkey" , "" , "Mount with explicit master key" )
141
153
flagSet .StringVar (& args .cpuprofile , "cpuprofile" , "" , "Write cpu profile to specified file" )
142
154
flagSet .StringVar (& args .memprofile , "memprofile" , "" , "Write memory profile to specified file" )
@@ -152,12 +164,6 @@ func parseCliOpts() (args argContainer) {
152
164
"successful mount - used internally for daemonization" )
153
165
flagSet .IntVar (& args .scryptn , "scryptn" , configfile .ScryptDefaultLogN , "scrypt cost parameter logN. Possible values: 10-28. " +
154
166
"A lower value speeds up mounting and reduces its memory needs, but makes the password susceptible to brute-force attacks" )
155
- // Ignored otions
156
- var dummyBool bool
157
- ignoreText := "(ignored for compatibility)"
158
- flagSet .BoolVar (& dummyBool , "rw" , false , ignoreText )
159
- flagSet .BoolVar (& dummyBool , "nosuid" , false , ignoreText )
160
- flagSet .BoolVar (& dummyBool , "nodev" , false , ignoreText )
161
167
var dummyString string
162
168
flagSet .StringVar (& dummyString , "o" , "" , "For compatibility with mount(1), options can be also passed as a comma-separated list to -o on the end." )
163
169
// Actual parsing
0 commit comments