[Pkg-shadow-commits] r3104 - in upstream/trunk: . lib
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Thu Mar 11 22:03:58 UTC 2010
Author: nekral-guest
Date: 2010-03-11 22:03:57 +0000 (Thu, 11 Mar 2010)
New Revision: 3104
Modified:
upstream/trunk/ChangeLog
upstream/trunk/lib/shadowio.c
Log:
* lib/shadowio.c: Re-indent.
* lib/shadowio.c: Added brackets and parenthesis.
* lib/shadowio.c: Document the sections closed by #endif
* lib/shadowio.c: Avoid negation of comparisons.
* lib/shadowio.c: Avoid implicit conversion of integer to booleans
and booleans to integers.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2010-03-11 22:03:45 UTC (rev 3103)
+++ upstream/trunk/ChangeLog 2010-03-11 22:03:57 UTC (rev 3104)
@@ -1,5 +1,14 @@
2010-03-11 Nicolas François <nicolas.francois at centraliens.net>
+ * lib/shadowio.c: Re-indent.
+ * lib/shadowio.c: Added brackets and parenthesis.
+ * lib/shadowio.c: Document the sections closed by #endif
+ * lib/shadowio.c: Avoid negation of comparisons.
+ * lib/shadowio.c: Avoid implicit conversion of integer to booleans
+ and booleans to integers.
+
+2010-03-11 Nicolas François <nicolas.francois at centraliens.net>
+
* src/useradd.c: Re-indent.
* src/useradd.c: Added brackets.
* src/useradd.c: Avoid implicit conversion of integers to
Modified: upstream/trunk/lib/shadowio.c
===================================================================
--- upstream/trunk/lib/shadowio.c 2010-03-11 22:03:45 UTC (rev 3103)
+++ upstream/trunk/lib/shadowio.c 2010-03-11 22:03:57 UTC (rev 3104)
@@ -44,7 +44,7 @@
#ifdef WITH_TCB
#include <tcb.h>
#include "tcbfuncs.h"
-#endif
+#endif /* WITH_TCB */
static /*@null@*/ /*@only@*/void *shadow_dup (const void *ent)
{
@@ -97,7 +97,7 @@
NULL, /* fp */
#ifdef WITH_SELINUX
NULL, /* scontext */
-#endif
+#endif /* WITH_SELINUX */
NULL, /* head */
NULL, /* tail */
NULL, /* cursor */
@@ -127,36 +127,41 @@
#ifdef WITH_TCB
int retval = 0;
- if (!getdef_bool("USE_TCB"))
-#endif
+ if (!getdef_bool ("USE_TCB")) {
+#endif /* WITH_TCB */
return commonio_lock (&shadow_db);
#ifdef WITH_TCB
- if (!shadowtcb_drop_priv())
+ }
+ if (shadowtcb_drop_priv () == 0) {
return 0;
- if (lckpwdf_tcb(shadow_db.filename) == 0) {
+ }
+ if (lckpwdf_tcb (shadow_db.filename) == 0) {
shadow_db.locked = 1;
retval = 1;
}
- if (!shadowtcb_gain_priv())
+ if (shadowtcb_gain_priv () == 0) {
return 0;
+ }
return retval;
-#endif
+#endif /* WITH_TCB */
}
int spw_open (int mode)
{
int retval = 0;
#ifdef WITH_TCB
- int use_tcb = getdef_bool("USE_TCB");
+ bool use_tcb = getdef_bool ("USE_TCB");
- if (use_tcb && !shadowtcb_drop_priv() != 0)
+ if (use_tcb && (shadowtcb_drop_priv () == 0)) {
return 0;
-#endif
+ }
+#endif /* WITH_TCB */
retval = commonio_open (&shadow_db, mode);
#ifdef WITH_TCB
- if (use_tcb && !shadowtcb_gain_priv() != 0)
+ if (use_tcb && (shadowtcb_gain_priv () == 0)) {
return 0;
-#endif
+ }
+#endif /* WITH_TCB */
return retval;
}
@@ -189,16 +194,18 @@
{
int retval = 0;
#ifdef WITH_TCB
- int use_tcb = getdef_bool("USE_TCB");
+ bool use_tcb = getdef_bool ("USE_TCB");
- if (use_tcb && !shadowtcb_drop_priv() != 0)
+ if (use_tcb && (shadowtcb_drop_priv () == 0)) {
return 0;
-#endif
+ }
+#endif /* WITH_TCB */
retval = commonio_close (&shadow_db);
#ifdef WITH_TCB
- if (use_tcb && !shadowtcb_gain_priv() != 0)
+ if (use_tcb && (shadowtcb_gain_priv () == 0)) {
return 0;
-#endif
+ }
+#endif /* WITH_TCB */
return retval;
}
@@ -207,20 +214,23 @@
#ifdef WITH_TCB
int retval = 0;
- if (!getdef_bool("USE_TCB"))
-#endif
+ if (!getdef_bool ("USE_TCB")) {
+#endif /* WITH_TCB */
return commonio_unlock (&shadow_db);
#ifdef WITH_TCB
- if (!shadowtcb_drop_priv())
+ }
+ if (shadowtcb_drop_priv () == 0) {
return 0;
- if (ulckpwdf_tcb() == 0) {
+ }
+ if (ulckpwdf_tcb () == 0) {
shadow_db.locked = 0;
retval = 1;
}
- if (!shadowtcb_gain_priv())
+ if (shadowtcb_gain_priv () == 0) {
return 0;
+ }
return retval;
-#endif
+#endif /* WITH_TCB */
}
struct commonio_entry *__spw_get_head (void)
@@ -237,8 +247,9 @@
int spw_sort ()
{
#ifdef WITH_TCB
- if (getdef_bool("USE_TCB"))
+ if (getdef_bool ("USE_TCB")) {
return 0;
-#endif
+ }
+#endif /* WITH_TCB */
return commonio_sort_wrt (&shadow_db, __pw_get_db ());
}
More information about the Pkg-shadow-commits
mailing list