aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-07-21 12:27:54 -0400
committerAnthony G. Basile <blueness@gentoo.org>2012-07-21 12:27:54 -0400
commit878bf8d6ea03740a8496b8dc27c5cf2e1a992239 (patch)
tree6b30261546f1ba0ae7ab64a953a0aa5d5569431d
parentscripts/paxmodule.c: add setstrstring function (diff)
downloadelfix-878bf8d6ea03740a8496b8dc27c5cf2e1a992239.tar.gz
elfix-878bf8d6ea03740a8496b8dc27c5cf2e1a992239.tar.bz2
elfix-878bf8d6ea03740a8496b8dc27c5cf2e1a992239.zip
scripts/*: rename setflags to setbinflags
-rw-r--r--scripts/paxmodule.c20
-rwxr-xr-xscripts/pypaxctl2
-rwxr-xr-xscripts/revdep-pax2
3 files changed, 13 insertions, 11 deletions
diff --git a/scripts/paxmodule.c b/scripts/paxmodule.c
index 18c64aa..ba81110 100644
--- a/scripts/paxmodule.c
+++ b/scripts/paxmodule.c
@@ -39,11 +39,13 @@
static PyObject * pax_getflags(PyObject *, PyObject *);
-static PyObject * pax_setflags(PyObject *, PyObject *);
+static PyObject * pax_setbinflags(PyObject *, PyObject *);
+static PyObject * pax_setstrflags(PyObject *, PyObject *);
static PyMethodDef PaxMethods[] = {
- {"getflags", pax_getflags, METH_VARARGS, "Get the pax flags."},
- {"setflags", pax_setflags, METH_VARARGS, "Set the pax flags."},
+ {"getflags", pax_getflags, METH_VARARGS, "Get the pax flags as a string."},
+ {"setbinflags", pax_setbinflags, METH_VARARGS, "Set the pax flags using binary."},
+ {"setstrflags", pax_setstrflags, METH_VARARGS, "Set the pax flags using string."},
{NULL, NULL, 0, NULL}
};
@@ -299,7 +301,7 @@ set_xt_flags(int fd, uint16_t xt_flags)
static PyObject *
-pax_setflags(PyObject *self, PyObject *args)
+pax_setbinflags(PyObject *self, PyObject *args)
{
const char *f_name;
int fd, iflags;
@@ -307,13 +309,13 @@ pax_setflags(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "si", &f_name, &iflags))
{
- PyErr_SetString(PaxError, "pax_setflags: PyArg_ParseTuple failed");
+ PyErr_SetString(PaxError, "pax_setbinflags: PyArg_ParseTuple failed");
return NULL;
}
if((fd = open(f_name, O_RDWR)) < 0)
{
- PyErr_SetString(PaxError, "pax_setflags: open() failed");
+ PyErr_SetString(PaxError, "pax_setbinflags: open() failed");
return NULL;
}
@@ -333,19 +335,19 @@ pax_setflags(PyObject *self, PyObject *args)
static PyObject *
pax_setstrflags(PyObject *self, PyObject *args)
{
- const char *f_name, *sflags;
+ char *f_name, *sflags;
int fd;
uint16_t flags;
if (!PyArg_ParseTuple(args, "ss", &f_name, &sflags))
{
- PyErr_SetString(PaxError, "pax_setflags: PyArg_ParseTuple failed");
+ PyErr_SetString(PaxError, "pax_setbinflags: PyArg_ParseTuple failed");
return NULL;
}
if((fd = open(f_name, O_RDWR)) < 0)
{
- PyErr_SetString(PaxError, "pax_setflags: open() failed");
+ PyErr_SetString(PaxError, "pax_setbinflags: open() failed");
return NULL;
}
diff --git a/scripts/pypaxctl b/scripts/pypaxctl
index 46fee67..5993641 100755
--- a/scripts/pypaxctl
+++ b/scripts/pypaxctl
@@ -37,7 +37,7 @@ def main():
if( do_set == 1 ):
for binary in args:
- pax.setflags(binary, flags)
+ pax.setstrflags(binary, flags)
else:
for binary in args:
( str_flags, bin_flags ) = pax.getflags(binary)
diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index 76add9c..7de3930 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -241,7 +241,7 @@ def migrate_flags(importer, exporter_str_flags, exporter_bin_flags):
if importer_str_flags[i].islower() and exporter_str_flags[i] == '-':
result_bin_flags = result_bin_flags | pf_flags[importer_str_flags[i]]
- pax.setflags(importer, result_bin_flags)
+ pax.setbinflags(importer, result_bin_flags)
def run_binary(binary, verbose, mark, allyes):