Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
13a48837
Kaydet (Commit)
13a48837
authored
Şub 01, 2010
tarafından
Bahadır Kandemir
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More PolicyKit 1.0 changes
üst
9156d489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
bus.c
comar/src/bus.c
+0
-7
policy.c
comar/src/policy.c
+5
-3
No files found.
comar/src/bus.c
Dosyayı görüntüle @
13a48837
...
...
@@ -251,14 +251,11 @@ bus_execute2(DBusConnection *conn, const char *destination, const char *path, co
}
dbus_error_init
(
&
err
);
printf
(
"******* 1
\n
"
);
reply
=
dbus_connection_send_with_reply_and_block
(
conn
,
msg
,
timeout
,
&
err
);
printf
(
"******* 2
\n
"
);
dbus_message_unref
(
msg
);
// Unable to call method, raise an exception
if
(
dbus_error_is_set
(
&
err
))
{
printf
(
"******* 2.1
\n
"
);
PyErr_Format
(
PyExc_DBus
,
"Unable to call method: %s"
,
err
.
message
);
dbus_error_free
(
&
err
);
return
NULL
;
...
...
@@ -269,9 +266,7 @@ bus_execute2(DBusConnection *conn, const char *destination, const char *path, co
switch
(
dbus_message_get_type
(
reply
))
{
case
DBUS_MESSAGE_TYPE_METHOD_RETURN
:
// Method returned a reply
printf
(
"******* 3
\n
"
);
ret
=
pydbus_import
(
reply
);
printf
(
"******* 3.1
\n
"
);
if
(
ret
&&
PyTuple_Size
(
ret
)
==
1
)
{
ret
=
PyTuple_GetItem
(
ret
,
0
);
}
...
...
@@ -279,9 +274,7 @@ bus_execute2(DBusConnection *conn, const char *destination, const char *path, co
return
ret
;
case
DBUS_MESSAGE_TYPE_ERROR
:
// Method retuned an error, raise an exception
printf
(
"******* 4
\n
"
);
PyErr_SetString
(
PyExc_DBus
,
dbus_message_get_error_name
(
reply
));
printf
(
"******* 4.1
\n
"
);
dbus_message_unref
(
reply
);
return
NULL
;
}
...
...
comar/src/policy.c
Dosyayı görüntüle @
13a48837
...
...
@@ -78,12 +78,14 @@ policy_check(const char *sender, const char *action, int *result)
PyTuple_SetItem
(
obj
,
0
,
subject
);
PyTuple_SetItem
(
obj
,
1
,
PyString_FromString
(
action
));
PyTuple_SetItem
(
obj
,
2
,
details2
);
PyTuple_SetItem
(
obj
,
3
,
PyInt_FromLong
((
long
)
0
));
PyTuple_SetItem
(
obj
,
3
,
PyInt_FromLong
((
long
)
1
));
PyTuple_SetItem
(
obj
,
4
,
PyString_FromString
(
"abc"
));
printf
(
"DEB: %s
\n
"
,
PyString_AsString
(
PyObject_Repr
(
obj
)));
PyObject
*
ret
=
bus_execute2
(
conn
,
"org.freedesktop.PolicyKit1"
,
"/org/freedesktop/PolicyKit1/Authority"
,
"org.freedesktop.PolicyKit1.Authority"
,
"CheckAuthorization"
,
obj
,
25
,
"(sa{sv})sa{ss}us"
);
printf
(
"DEB: %s
\n
"
,
PyString_AsString
(
PyObject_Repr
(
ret
)));
if
(
PyTuple_GetItem
(
ret
,
0
)
==
Py_False
)
{
*
result
=
POLICY_YES
;
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment