@@ -222,13 +222,13 @@ func NewApp() (app *cli.App) {
222222
223223 cli.StringFlag {
224224 Name : "multipart-age" ,
225- Usage : "Multipart uploads older than this value will be deleted on start (default: 48 hours) " ,
225+ Usage : "Multipart uploads older than this value will be deleted on start" ,
226226 Value : "48h" ,
227227 },
228228
229229 cli.IntFlag {
230230 Name : "multipart-copy-threshold" ,
231- Usage : "Threshold for switching from single-part to multipart object copy in MB. Maximum for AWS S3 is 5 GB (default: 128 MB) " ,
231+ Usage : "Threshold for switching from single-part to multipart object copy in MB. Maximum for AWS S3 is 5 GB" ,
232232 Value : 128 ,
233233 },
234234
@@ -280,27 +280,27 @@ func NewApp() (app *cli.App) {
280280 cli.IntFlag {
281281 Name : "max-flushers" ,
282282 Value : 16 ,
283- Usage : "How much parallel requests should be used for flushing changes to server (default: 16) " ,
283+ Usage : "How much parallel requests should be used for flushing changes to server" ,
284284 },
285285
286286 cli.IntFlag {
287287 Name : "max-parallel-parts" ,
288288 Value : 8 ,
289289 Usage : "How much parallel requests out of the total number can be used for large part uploads." +
290- " Large parts take more bandwidth so they usually require less parallelism (default: 8) " ,
290+ " Large parts take more bandwidth so they usually require less parallelism" ,
291291 },
292292
293293 cli.IntFlag {
294294 Name : "max-parallel-copy" ,
295295 Value : 16 ,
296296 Usage : "How much parallel unmodified part copy requests should be used." +
297- " This limit is separate from max-flushers (default: 16) " ,
297+ " This limit is separate from max-flushers" ,
298298 },
299299
300300 cli.IntFlag {
301301 Name : "read-ahead" ,
302302 Value : 5 * 1024 ,
303- Usage : "How much data in KB should be pre-loaded with every read by default (default: 5 MB) " ,
303+ Usage : "How much data in KB should be pre-loaded with every read by default" ,
304304 },
305305
306306 cli.IntFlag {
@@ -312,45 +312,45 @@ func NewApp() (app *cli.App) {
312312 cli.IntFlag {
313313 Name : "small-read-cutoff" ,
314314 Value : 128 ,
315- Usage : "Maximum average size of last reads in KB to trigger \" small\" readahead (default: 128 KB) " ,
315+ Usage : "Maximum average size of last reads in KB to trigger \" small\" readahead" ,
316316 },
317317
318318 cli.IntFlag {
319319 Name : "read-ahead-small" ,
320320 Value : 128 ,
321- Usage : "Smaller readahead size in KB to be used when small random reads are detected (default: 128 KB) " ,
321+ Usage : "Smaller readahead size in KB to be used when small random reads are detected" ,
322322 },
323323
324324 cli.IntFlag {
325325 Name : "large-read-cutoff" ,
326326 Value : 20 * 1024 ,
327- Usage : "Amount of linear read in KB after which the \" large\" readahead should be triggered (default: 20 MB) " ,
327+ Usage : "Amount of linear read in KB after which the \" large\" readahead should be triggered" ,
328328 },
329329
330330 cli.IntFlag {
331331 Name : "read-ahead-large" ,
332332 Value : 100 * 1024 ,
333- Usage : "Larger readahead size in KB to be used when long linear reads are detected (default: 100 MB) " ,
333+ Usage : "Larger readahead size in KB to be used when long linear reads are detected" ,
334334 },
335335
336336 cli.IntFlag {
337337 Name : "read-ahead-parallel" ,
338338 Value : 20 * 1024 ,
339- Usage : "Larger readahead will be triggered in parallel chunks of this size in KB (default: 20 MB) " ,
339+ Usage : "Larger readahead will be triggered in parallel chunks of this size in KB" ,
340340 },
341341
342342 cli.IntFlag {
343343 Name : "read-merge" ,
344344 Value : 512 ,
345345 Usage : "Two HTTP requests required to satisfy a read will be merged into one" +
346- " if they're at most this number of KB away (default: 512) " ,
346+ " if they're at most this number of KB away" ,
347347 },
348348
349349 cli.IntFlag {
350350 Name : "single-part" ,
351351 Value : 5 ,
352352 Usage : "Maximum size of an object in MB to upload it as a single part." +
353- " Can't be less than 5 MB (default: 5 MB) " ,
353+ " Can't be less than 5 MB" ,
354354 },
355355
356356 cli.StringFlag {
@@ -366,18 +366,72 @@ func NewApp() (app *cli.App) {
366366 Value : 0 ,
367367 Usage : "If non-zero, allow to compose larger parts up to this number of megabytes" +
368368 " in size from existing unchanged parts when doing server-side part copy." +
369- " Must be left at 0 for Yandex S3 (default: 0) " ,
369+ " Must be left at 0 for Yandex S3" ,
370370 },
371371
372372 cli.BoolFlag {
373373 Name : "ignore-fsync" ,
374374 Usage : "Do not wait until changes are persisted to the server on fsync() call (default: off)" ,
375375 },
376376
377+ cli.BoolFlag {
378+ Name : "enable-perms" ,
379+ Usage : "Enable permissions, user and group ID." +
380+ " Only works correctly if your S3 returns UserMetadata in listings (default: off)" ,
381+ },
382+
383+ cli.BoolFlag {
384+ Name : "enable-specials" ,
385+ Usage : "Enable special file support (sockets, devices, named pipes)." +
386+ " Only works correctly if your S3 returns UserMetadata in listings (default: on for Yandex, off for others)" ,
387+ },
388+
389+ cli.BoolFlag {
390+ Name : "no-specials" ,
391+ Usage : "Disable special file support (sockets, devices, named pipes)." ,
392+ },
393+
394+ cli.BoolFlag {
395+ Name : "enable-mtime" ,
396+ Usage : "Enable modification time preservation." +
397+ " Only works correctly if your S3 returns UserMetadata in listings (default: off)" ,
398+ },
399+
400+ cli.StringFlag {
401+ Name : "uid-attr" ,
402+ Value : "uid" ,
403+ Usage : "User ID metadata attribute name" ,
404+ },
405+
406+ cli.StringFlag {
407+ Name : "gid-attr" ,
408+ Value : "gid" ,
409+ Usage : "Group ID metadata attribute name" ,
410+ },
411+
412+ cli.StringFlag {
413+ Name : "mode-attr" ,
414+ Value : "mode" ,
415+ Usage : "File mode (permissions & special file flags) metadata attribute name" ,
416+ },
417+
418+ cli.StringFlag {
419+ Name : "rdev-attr" ,
420+ Value : "rdev" ,
421+ Usage : "Block/character device number metadata attribute name" ,
422+ },
423+
424+ cli.StringFlag {
425+ Name : "mtime-attr" ,
426+ Value : "mtime" ,
427+ Usage : "File modification time (UNIX time) metadata attribute name" ,
428+ },
429+
377430 cli.StringFlag {
378431 Name : "symlink-attr" ,
379432 Value : "--symlink-target" ,
380- Usage : "Symbolic link target metadata attribute (default: --symlink-target)" ,
433+ Usage : "Symbolic link target metadata attribute name." +
434+ " Only works correctly if your S3 returns UserMetadata in listings" ,
381435 },
382436
383437 cli.DurationFlag {
@@ -617,6 +671,14 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
617671 SinglePartMB : uint64 (singlePart ),
618672 MaxMergeCopyMB : uint64 (c .Int ("max-merge-copy" )),
619673 IgnoreFsync : c .Bool ("ignore-fsync" ),
674+ EnablePerms : c .Bool ("enable-perms" ),
675+ EnableSpecials : c .Bool ("enable-specials" ),
676+ EnableMtime : c .Bool ("enable-mtime" ),
677+ UidAttr : c .String ("uid-attr" ),
678+ GidAttr : c .String ("gid-attr" ),
679+ FileModeAttr : c .String ("mode-attr" ),
680+ RdevAttr : c .String ("rdev-attr" ),
681+ MtimeAttr : c .String ("mtime-attr" ),
620682 SymlinkAttr : c .String ("symlink-attr" ),
621683 CachePopularThreshold : int64 (c .Int ("cache-popular-threshold" )),
622684 CacheMaxHits : int64 (c .Int ("cache-max-hits" )),
@@ -662,8 +724,12 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
662724 config .IAMHeader = c .String ("iam-header" )
663725 config .MultipartAge = c .Duration ("multipart-age" )
664726 listType := c .String ("list-type" )
727+ isYandex := strings .Index (flags .Endpoint , "yandex" ) != - 1
728+ if isYandex && ! c .IsSet ("no-specials" ) {
729+ flags .EnableSpecials = true
730+ }
665731 if listType == "" {
666- if idx := strings . Index ( flags . Endpoint , "yandex" ); idx != - 1 {
732+ if isYandex {
667733 listType = "ext-v1"
668734 } else {
669735 listType = "1"
@@ -680,6 +746,10 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
680746 }
681747 }
682748
749+ if c .IsSet ("no-specials" ) {
750+ flags .EnableSpecials = false
751+ }
752+
683753 // Handle the repeated "-o" flag.
684754 for _ , o := range c .StringSlice ("o" ) {
685755 parseOptions (flags .MountOptions , o )
0 commit comments