2015-12-17 20:56:48 +03:00
/*
* Copyright ( c ) 1991 , 1992 Paul Kranenburg < pk @ cs . few . eur . nl >
* Copyright ( c ) 1993 Branko Lankester < branko @ hacktic . nl >
* Copyright ( c ) 1993 - 1996 Rick Sladkey < jrs @ world . std . com >
* Copyright ( c ) 1996 - 1999 Wichert Akkerman < wichert @ cistron . nl >
* Copyright ( c ) 2005 Roland McGrath < roland @ redhat . com >
* Copyright ( c ) 2007 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2018-06-14 14:00:00 +03:00
* Copyright ( c ) 2014 - 2018 The strace developers .
2015-12-17 20:56:48 +03:00
* All rights reserved .
*
2018-12-10 03:00:00 +03:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2015-12-17 20:56:48 +03:00
*/
2014-12-04 00:12:07 +03:00
# include "defs.h"
2015-06-16 03:31:45 +03:00
# define MS_MGC_VAL 0xc0ed0000 /* old magic mount flag number */
# define MS_MGC_MSK 0xffff0000 /* old magic mount flag mask */
2014-12-04 00:12:07 +03:00
# include "xlat/mount_flags.h"
2015-04-07 04:36:50 +03:00
SYS_FUNC ( mount )
2014-12-04 00:12:07 +03:00
{
2015-07-20 02:00:35 +03:00
bool ignore_type = false ;
bool ignore_data = false ;
bool old_magic = false ;
2016-12-26 13:26:03 +03:00
kernel_ulong_t flags = tcp - > u_arg [ 3 ] ;
2015-07-20 02:00:35 +03:00
/* Discard magic */
if ( ( flags & MS_MGC_MSK ) = = MS_MGC_VAL ) {
flags & = ~ MS_MGC_MSK ;
old_magic = true ;
2014-12-04 00:12:07 +03:00
}
2015-07-20 02:00:35 +03:00
if ( flags & MS_REMOUNT )
ignore_type = true ;
else if ( flags & ( MS_BIND | MS_MOVE | MS_SHARED
| MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE ) )
ignore_type = ignore_data = true ;
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprints ( " , " ) ;
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
tprints ( " , " ) ;
if ( ignore_type )
printaddr ( tcp - > u_arg [ 2 ] ) ;
else
2016-12-20 19:43:26 +03:00
printstr ( tcp , tcp - > u_arg [ 2 ] ) ;
2015-07-20 02:00:35 +03:00
tprints ( " , " ) ;
if ( old_magic ) {
2018-03-10 07:38:39 +03:00
print_xlat ( MS_MGC_VAL ) ;
2015-07-20 02:00:35 +03:00
if ( flags )
tprints ( " | " ) ;
}
if ( flags | | ! old_magic )
2016-12-25 01:58:16 +03:00
printflags64 ( mount_flags , flags , " MS_??? " ) ;
2015-07-20 02:00:35 +03:00
tprints ( " , " ) ;
if ( ignore_data )
printaddr ( tcp - > u_arg [ 4 ] ) ;
else
2016-12-20 19:43:26 +03:00
printstr ( tcp , tcp - > u_arg [ 4 ] ) ;
2015-07-20 02:00:35 +03:00
return RVAL_DECODED ;
2014-12-04 00:12:07 +03:00
}