Update of /cvsroot/libsysio/libsysio/include
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19643/include
Modified Files:
Tag: cray_tmp
creds.h
Log Message:
Add definition for superuser, _SYSIO_ROOT_UID, and a macro to check
credentials for superuser, _sysio_is_root().
Use same in access control routine.
Index: creds.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/creds.h,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -b -B -p -r1.1 -r1.1.6.1
--- creds.h 12 Dec 2006 00:48:58 -0000 1.1
+++ creds.h 29 Jun 2007 17:15:13 -0000 1.1.6.1
@@ -47,6 +47,11 @@
#define _CREDS_H_
/*
+ * Superuser's UID.
+ */
+#define _SYSIO_ROOT_UID 0
+
+/*
* Data structure for user credentials
*/
@@ -56,4 +61,12 @@ struct creds {
int creds_ngids;
};
+
+#ifdef _SYSIO_ROOT_UID
+/*
+ * Is caller the superuser?
+ */
+#define _sysio_is_root(_crp) \
+ ((_crp)->creds_uid == _SYSIO_ROOT_UID)
+#endif
#endif
|