NDR_SCALAR_PROTO(hyper, uint64_t)
NDR_SCALAR_PROTO(pointer, void *)
NDR_SCALAR_PROTO(time_t, time_t)
+NDR_SCALAR_PROTO(uid_t, uid_t)
+NDR_SCALAR_PROTO(gid_t, gid_t)
NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS)
NDR_SCALAR_PROTO(WERROR, WERROR)
NDR_SCALAR_PROTO(NTTIME, NTTIME)
}
+/*
+ push a uid_t
+*/
+_PUBLIC_ enum ndr_err_code ndr_push_uid_t(struct ndr_push *ndr, int ndr_flags, uid_t u)
+{
+ return ndr_push_udlong(ndr, NDR_SCALARS, (uint64_t)u);
+}
+
+/*
+ pull a uid_t
+*/
+_PUBLIC_ enum ndr_err_code ndr_pull_uid_t(struct ndr_pull *ndr, int ndr_flags, uid_t *u)
+{
+ uint64_t uu;
+ NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, &uu));
+ *u = (uid_t)uu;
+ if (unlikely(uu != *u)) {
+ DEBUG(0,(__location__ ": uid_t pull doesn't fit 0x%016llx\n",
+ (unsigned long long)uu));
+ return NDR_ERR_NDR64;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+
+/*
+ push a gid_t
+*/
+_PUBLIC_ enum ndr_err_code ndr_push_gid_t(struct ndr_push *ndr, int ndr_flags, gid_t g)
+{
+ return ndr_push_udlong(ndr, NDR_SCALARS, (uint64_t)g);
+}
+
+/*
+ pull a gid_t
+*/
+_PUBLIC_ enum ndr_err_code ndr_pull_gid_t(struct ndr_pull *ndr, int ndr_flags, gid_t *g)
+{
+ uint64_t gg;
+ NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, &gg));
+ *g = (gid_t)gg;
+ if (unlikely(gg != *g)) {
+ DEBUG(0,(__location__ ": gid_t pull doesn't fit 0x%016llx\n",
+ (unsigned long long)gg));
+ return NDR_ERR_NDR64;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+
/*
pull a ipv4address
*/
}
}
+_PUBLIC_ void ndr_print_uid_t(struct ndr_print *ndr, const char *name, uid_t u)
+{
+ ndr_print_dlong(ndr, name, u);
+}
+
+_PUBLIC_ void ndr_print_gid_t(struct ndr_print *ndr, const char *name, gid_t g)
+{
+ ndr_print_dlong(ndr, name, g);
+}
+
_PUBLIC_ void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type)
{
if (ndr->flags & LIBNDR_PRINT_ARRAY_HEX) {
$self->pidl("}");
return;
}
- if (expandAlias($actual_ctype->{NAME}) =~ /^(char|u?int[0-9]*|time_t)$/) {
+ if (expandAlias($actual_ctype->{NAME}) =~ /^(char|u?int[0-9]*|time_t|uid_t|gid_t)$/) {
$self->pidl("PY_CHECK_TYPE(&PyInt_Type, $cvar, $fail);");
$self->pidl("$target = PyInt_AsLong($cvar);");
return;
return "PyLong_FromLongLong($cvar)";
}
- if ($ctypename =~ /^(char|u?int[0-9]*|time_t)$/) {
+ if ($ctypename =~ /^(char|u?int[0-9]*|time_t|uid_t|gid_t)$/) {
return "PyInt_FromLong($cvar)";
}