]> granicus.if.org Git - strace/commitdiff
Enhance quotactl decoding
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 26 Oct 2012 23:43:13 +0000 (23:43 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 26 Oct 2012 23:43:13 +0000 (23:43 +0000)
* quota.c (sys_quotactl): Decode 2nd syscall argument using printpath.
* pathtrace.c (pathtrace_match): Add quotactl support.
* linux/*/syscallent.h: Add TF flag to quotactl entry.

22 files changed:
linux/aarch64/syscallent.h
linux/alpha/syscallent.h
linux/arm/syscallent.h
linux/avr32/syscallent.h
linux/bfin/syscallent.h
linux/hppa/syscallent.h
linux/i386/syscallent.h
linux/ia64/syscallent.h
linux/m68k/syscallent.h
linux/microblaze/syscallent.h
linux/mips/syscallent.h
linux/powerpc/syscallent.h
linux/s390/syscallent.h
linux/s390x/syscallent.h
linux/sh/syscallent.h
linux/sh64/syscallent.h
linux/sparc/syscallent.h
linux/tile/syscallent.h
linux/x32/syscallent.h
linux/x86_64/syscallent.h
pathtrace.c
quota.c

index eeda429bbd1d2c1f67797f82dc31a448654fee1d..b712c9fb78612d519884ef7e1afafd8adf0ffad2 100644 (file)
@@ -58,7 +58,7 @@
        { 1,    TD,     sys_close,                      "close"                         }, /*   57 */
        { 0,    0,      sys_vhangup,                    "vhangup"                       }, /*   58 */
        { 2,    TD,     sys_pipe2,                      "pipe2"                         }, /*   59 */
-       { 4,    0,      sys_quotactl,                   "quotactl"                      }, /*   60 */
+       { 4,    TF,     sys_quotactl,                   "quotactl"                      }, /*   60 */
        { 3,    TD,     sys_getdents64,                 "getdents64"                    }, /*   61 */
        { 3,    TD,     sys_lseek,                      "lseek"                         }, /*   62 */
        { 3,    TD,     sys_read,                       "read"                          }, /*   63 */
index aa76a43ff65310f7ec99f3b719667b8f01c8dd82..dde701739302bccbb05f8f62e0d40a7d0ad4710b 100644 (file)
        { 2,    0,      sys_setrlimit,          "setrlimit"             }, /* 145 */
        { 5,    0,      printargs,              "osf_old_killpg"        }, /* 146, not implemented */
        { 0,    0,      sys_setsid,             "setsid"                }, /* 147 */
-       { 4,    0,      sys_quotactl,           "quotactl"              }, /* 148 */
+       { 4,    TF,     sys_quotactl,           "quotactl"              }, /* 148 */
        { 5,    0,      printargs,              "osf_oldquota"          }, /* 149, not implemented */
        { 3,    TN,     sys_getsockname,        "getsockname"           }, /* 150 */
        { 5,    0,      NULL,                   NULL                    }, /* 151 */
index 9b8da0264ce70615db9caf182f785d0d3b35b809..123b910947a33753a2f0b631aaffb230cdf6ccf7 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    0,      sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index 6076fca29a53f404489287317bd0e17e4ef8e840..b215cc17ce5dfd0129ab7cc226e153e80d2a5ef2 100644 (file)
        { 0,    TP,     sys_vfork,              "vfork"         }, /* 114 */
        { 3,    0,      sys_init_module,        "init_module"   }, /* 115 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 116 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 117 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 117 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 118 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 119 */
        { 3,    0,      sys_sysfs,              "sysfs"         }, /* 120 */
index 7a9e618b28cca67b58a219ed2b2ec0e4a297252b..05194fb584a1e1c59d66f6767e7dc53b6bc863a6 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 1,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"       }, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index f21d0c386aae558c0e46887b382e4b33c125df14..dc12299ad6b02530c864ea6b9a5a5b04fd743ae6 100644 (file)
        { 4,    0,      sys_init_module,        "init_module"           }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module"         }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"       }, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"              }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"              }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"               }, /* 132 */
        { 1,    TF,     sys_fchdir,             "fchdir"                }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"               }, /* 134 */
index dd76244c80d6e2bde212849e7b3459b2aa68bfe7..1b7feb562f866727026693b26631bf039e698835 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index bbdfc36c5c56ffb4e8852ebae10d9503df90676f..8e130ad54d69966270c4adb91f9a7f21bb43821e 100644 (file)
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 1134 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 1135 */
        { 5,    0,      sys_query_module,       "query_module"  }, /* 1136 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 1137 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 1137 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 1138 */
        { 3,    0,      sys_sysfs,              "sysfs"         }, /* 1139 */
        { 1,    0,      sys_personality,        "personality"   }, /* 1140 */
index f95cf8d081f2f1abc62e4ae0d900e84ec4732f35..184f01c8b7a762a0c840cf2d4ad1173655ff6971 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    0,      sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index 51c5e6c206b56bd07c936ffd3baffd2c23da8b97..c5a52fafbf034365cd8eaf83db9b4a27fa42b41e 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    0,      sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index 4c727631a6f089a61dfc153b11c7d0fe87ad2387..df206ec435e4321c7f239ef430f90f75dc69ad43 100644 (file)
        { 0,    TM,     printargs,              "sysv_madvise"  }, /* 1138 */
        { 0,    0,      printargs,              "sysv_pagelock" }, /* 1139 */
        { 0,    0,      printargs,              "sysv_getpagesize"      }, /* 1140 */
-       { 0,    0,      printargs,              "sysv_quotactl" }, /* 1141 */
+       { 0,    TF,     printargs,              "sysv_quotactl" }, /* 1141 */
        { 0,    0,      printargs,              "sysv_libdetach"        }, /* 1142 */
        { 0,    0,      printargs,              "sysv_BSDgetpgrp"       }, /* 1143 */
        { 0,    0,      printargs,              "sysv_BSDsetpgrp"       }, /* 1144 */
        { 0,    0,      printargs,              "bsd43_getdomainname"   }, /* 2165 */
        { 0,    0,      printargs,              "bsd43_setdomainname"   }, /* 2166 */
        { 0,    0,      printargs,              "bsd43_pcfs_mount"      }, /* 2167 */
-       { 0,    0,      printargs,              "bsd43_quotactl"        }, /* 2168 */
+       { 0,    TF,     printargs,              "bsd43_quotactl"        }, /* 2168 */
        { 0,    0,      printargs,              "bsd43_oldexportfs"     }, /* 2169 */
        { 0,    0,      printargs,              "bsd43_smount"  }, /* 2170 */
        { 0,    0,      printargs,              "bsd43_mipshwconf"      }, /* 2171 */
        { 3,    0,      sys_init_module,        "init_module"   }, /* 4128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 4129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 4130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 4131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 4131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 4132 */
        { 1,    TF,     sys_fchdir,             "fchdir"        }, /* 4133 */
        { 2,    0,      sys_bdflush,            "bdflush"       }, /* 4134 */
        { 0,    0,      printargs,              "o32_init_module"       }, /* 4128 */
        { 0,    0,      printargs,              "o32_delete_module"     }, /* 4129 */
        { 0,    0,      printargs,              "o32_get_kernel_syms"}, /* 4130 */
-       { 0,    0,      printargs,              "o32_quotactl"  }, /* 4131 */
+       { 0,    TF,     printargs,              "o32_quotactl"  }, /* 4131 */
        { 0,    0,      printargs,              "o32_getpgid"   }, /* 4132 */
        { 0,    0,      printargs,              "o32_fchdir"    }, /* 4133 */
        { 0,    0,      printargs,              "o32_bdflush"   }, /* 4134 */
        { 1,    0,      sys_delete_module,      "delete_module" }, /* 5169 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 5170 */
        { 5,    0,      sys_query_module,       "query_module"  }, /* 5171 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 5172 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 5172 */
        { 3,    0,      sys_nfsservctl,         "nfsservctl"    }, /* 5173 */
        { 5,    TN,     printargs,              "getpmsg"       }, /* 5174 */
        { 5,    TN,     printargs,              "putpmsg"       }, /* 5175 */
        { 0,    0,      printargs,              "n64_delete_module"     }, /* 5169 */
        { 0,    0,      printargs,              "n64_get_kernel_syms"   }, /* 5170 */
        { 0,    0,      printargs,              "n64_query_module"      }, /* 5171 */
-       { 0,    0,      printargs,              "n64_quotactl"          }, /* 5172 */
+       { 0,    TF,     printargs,              "n64_quotactl"          }, /* 5172 */
        { 0,    0,      printargs,              "n64_nfsservctl"        }, /* 5173 */
        { 0,    0,      printargs,              "n64_getpmsg"           }, /* 5174 */
        { 0,    0,      printargs,              "n64_putpmsg"           }, /* 5175 */
        { 1,    0,      sys_delete_module,      "delete_module" }, /* 6169 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 6170 */
        { 5,    0,      sys_query_module,       "query_module"  }, /* 6171 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 6172 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 6172 */
        { 3,    0,      sys_nfsservctl,         "nfsservctl"    }, /* 6173 */
        { 5,    TN,     printargs,              "getpmsg"       }, /* 6174 */
        { 5,    TN,     printargs,              "putpmsg"       }, /* 6175 */
        { 0,    0,      printargs,              "n32_delete_module"     }, /* 6169 */
        { 0,    0,      printargs,              "n32_get_kernel_syms"   }, /* 6170 */
        { 0,    0,      printargs,              "n32_query_module"      }, /* 6171 */
-       { 0,    0,      printargs,              "n32_quotactl"          }, /* 6172 */
+       { 0,    TF,     printargs,              "n32_quotactl"          }, /* 6172 */
        { 0,    0,      printargs,              "n32_nfsservctl"        }, /* 6173 */
        { 0,    0,      printargs,              "n32_getpmsg"           }, /* 6174 */
        { 0,    0,      printargs,              "n32_putpmsg"           }, /* 6175 */
index 3228f97c7ef2de849c05595df953d6b093d66f24..e61946e3ddfb322957f58c02060f838126e1b370 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"           }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module"         }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"       }, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"              }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"              }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"               }, /* 132 */
        { 1,    TF,     sys_fchdir,             "fchdir"                }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"               }, /* 134 */
index 1ce0fe2bb49f3bc240216cc4421eb5184d8ed7b2..94f4d25633f5ed80d2a038aae1961d3b267026c2 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index 7fa8ff55b0aa4daa9095ad95fa209f70846112f6..ebf35d48baa6f7f0f3fae86c593a2e99af4fc727 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index d9228b466520c71cca6f51d847829d36955d4ca0..1546ff692a4ff154b18955b1e25efe516f08d029 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index 39c13e01bcb92587967a4c25662d7ded763c8792..4e20c478f0f8e4c67b0f726d0726670ef98280cc 100644 (file)
        { 3,    0,      sys_init_module,        "init_module"   }, /* 128 */
        { 2,    0,      sys_delete_module,      "delete_module" }, /* 129 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"}, /* 130 */
-       { 4,    0,      sys_quotactl,           "quotactl"      }, /* 131 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      }, /* 131 */
        { 1,    0,      sys_getpgid,            "getpgid"       }, /* 132 */
        { 1,    TD,     sys_fchdir,             "fchdir"        }, /* 133 */
        { 0,    0,      sys_bdflush,            "bdflush"       }, /* 134 */
index d6b518acaaec47a9f1068e6e640ad6bfe6696208..fe3a94038bd6e02ef50ab6b62bac6d3844f6f907 100644 (file)
        { 2,    0,      printargs,      "getdomainname" },      /* 162 */
        { 2,    0,      sys_setdomainname,"setdomainname" },    /* 163 */
        { 5,    0,      printargs,      "utrap_install" },      /* 164 */
-       { 4,    0,      sys_quotactl,   "quotactl" },           /* 165 */
+       { 4,    TF,     sys_quotactl,   "quotactl" },           /* 165 */
        { 1,    0,      sys_set_tid_address,"set_tid_address" },        /* 166 */
        { 5,    TF,     sys_mount,      "mount" },              /* 167 */
        { 2,    0,      sys_ustat,      "ustat" },              /* 168 */
index 89205e301bf4c2124d6fe3de80198d70aa9ba980..3bf59ae9512a8c1fd2f31ab28ff09e0811084f87 100644 (file)
        { 3,    TS,     sys_sigprocmask,        "sigprocmask" }, /* 130 */
        { 3,    0,      sys_init_module,        "init_module" }, /* 131 */
        { 1,    0,      sys_delete_module,      "delete_module" }, /* 132 */
-       { 4,    0,      sys_quotactl,           "quotactl" }, /* 133 */
+       { 4,    TF,     sys_quotactl,           "quotactl" }, /* 133 */
        { 1,    0,      sys_getpgid,            "getpgid" }, /* 134 */
        { 1,    TD,     sys_fchdir,             "fchdir" }, /* 135 */
        { 0,    0,      sys_bdflush,            "bdflush" }, /* 136 */
index 924164e0cedac7a485dd9ab9328f27053ee27da0..cfe546c14ffd093e4acfce401bdca9323c7a8691 100644 (file)
        { 2,    0,      sys_delete_module,      "delete_module" },  /* 176 */
        { 1,    0,      printargs,              "64:get_kernel_syms"    },  /* 177 */
        { 5,    0,      printargs,              "64:query_module"       },  /* 178 */
-       { 4,    0,      sys_quotactl,           "quotactl"      },  /* 179 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      },  /* 179 */
        { 3,    0,      printargs,              "64:nfsservctl" },  /* 180 */
        { 5,    0,      sys_getpmsg,            "getpmsg"       }, /* 181 */
        { 5,    0,      sys_putpmsg,            "putpmsg"       }, /* 182 */
index 2ce663f01f036ef34427abc20bf59748748673c2..f98cd37d559bdab71efd6301c86fbdf50babd5cc 100644 (file)
        { 2,    0,      sys_delete_module,      "delete_module" },  /* 176 */
        { 1,    0,      sys_get_kernel_syms,    "get_kernel_syms"},  /* 177 */
        { 5,    0,      sys_query_module,       "query_module"  },  /* 178 */
-       { 4,    0,      sys_quotactl,           "quotactl"      },  /* 179 */
+       { 4,    TF,     sys_quotactl,           "quotactl"      },  /* 179 */
        { 3,    0,      sys_nfsservctl,         "nfsservctl"    },  /* 180 */
        { 5,    0,      sys_getpmsg,            "getpmsg"       }, /* 181 */
        { 5,    0,      sys_putpmsg,            "putpmsg"       }, /* 182 */
index c000c835f9077d7e4e7c290245d5c7bd74c4ec5b..12e47e90d766013611bf92d06828493affcca499 100644 (file)
@@ -213,6 +213,12 @@ pathtrace_match(struct tcb *tcp)
                        upathmatch(tcp, tcp->u_arg[1]);
        }
 
+       if (s->sys_func == sys_quotactl)
+       {
+               /* x, path */
+               return upathmatch(tcp, tcp->u_arg[1]);
+       }
+
        if (s->sys_func == sys_renameat ||
            s->sys_func == sys_linkat)
        {
diff --git a/quota.c b/quota.c
index a1fd92d343d3ee5ef4d2cb220192a50d47044e6c..780abf9615d25ae0c8af7ef662eb022613d34d0a 100644 (file)
--- a/quota.c
+++ b/quota.c
@@ -617,7 +617,7 @@ sys_quotactl(struct tcb *tcp)
                tprints("|");
                printxval(quotatypes, type, "???QUOTA");
                tprints(", ");
-               printstr(tcp, tcp->u_arg[1], -1);
+               printpath(tcp, tcp->u_arg[1]);
                tprints(", ");
                switch (cmd) {
                        case Q_V1_QUOTAON: