Skip to content
This repository was archived by the owner on Oct 23, 2021. It is now read-only.

Commit ad22512

Browse files
committed
v0.23
1 parent caae660 commit ad22512

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.23 2015-11-11
2+
* A slight performance boost
3+
* Colorize output
4+
* Happy holiday
5+
16
v0.22 2015-11-07
27
* Bug fixed
38

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ sudodev - Create your special device for a none-password sudo
44

55
# SYNOPSIS
66

7-
This allows you to choose some devices (identify by [UUID][ID_UUID]),so that when any of
8-
them are connected to your computer, your sudo command no longer need password.
7+
This allows you to choose some devices (identify by [UUID][ID_UUID]), so that
8+
when any of them are connected to your computer, your sudo command
9+
no longer need password.
910

1011
[ID_UUID]: https://en.wikipedia.org/w/index.php?title=Universally_unique_identifier "Learn more about UUID"
1112

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
1. Allow users to use additional profile to perform some operations after detecting device (such as run some scripts).
12

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ add_executable (
22
sudodevd
33
sudodevd.c
44
chomp.c
5+
color.c
56
daemonize.c
67
devs.c
78
find.c

src/color.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
enum
2828
{
2929
NORMAL = 0, BLACK, RED, GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE,
30-
LENGTH = WHITE + 1,
30+
LENGTH
3131
};
3232
3333
enum
3434
{
3535
REGULAR = 0, BOLD, UNDERLINE, BACKGROUND,
36-
WIDTH = BACKGROUND + 1,
36+
WIDTH
3737
};
3838
3939
static char allColor[LENGTH][WIDTH][MAX_COLOR_STR_LEN] =

src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef __CONFIG_H__
2020
#define __CONFIG_H__
2121

22-
#define VERSION ("0.22")
22+
#define VERSION ("0.23")
2323

2424
/* Never modify this { */
2525
#define SUDODEV_GROUP ("sudodev")

src/sudodevd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "devs.h"
3636
#include "say.h"
3737
#include "sort.h"
38+
#include "color.h"
3839
#include "lockfile.h"
3940
#include "readfile.h"
4041
#include "config.h"
@@ -494,7 +495,8 @@ main (const int argc, const char * const * const argv)
494495
/* Check uid */
495496
if (getuid ())
496497
{
497-
fprintf (stderr, "You need to run this as root!\n");
498+
fprintf (stderr, "%sYou need to run this as root.%s\n",
499+
C_BRED, C_NORMAL);
498500
exit (1);
499501
}
500502

@@ -509,7 +511,8 @@ main (const int argc, const char * const * const argv)
509511

510512
if (-1 == daemonize (ident))
511513
{
512-
fprintf (stderr, "can not run as a daemon, quit");
514+
fprintf (stderr, "%scan not run as a daemon, quit%s\n",
515+
C_BGRED, C_NORMAL);
513516
exit (1);
514517
}
515518

0 commit comments

Comments
 (0)