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

Commit d8467d4

Browse files
committed
v0.20
1 parent 19c1df2 commit d8467d4

File tree

8 files changed

+68
-28
lines changed

8 files changed

+68
-28
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v0.20 2015-11-04
2+
* Hide local device
3+
14
v0.10 2015-11-01
25
* First release
36
* Hide important data

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
3. Be a member of "sudodev" group
1010

11-
After run sudodevd(do this via service manager such as systemctl),
11+
After run sudodevd (do this via service manager such as systemctl),
1212
the "sudodev" group will be create, you should add to this group
1313
to make sudodevd take effect.
1414

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ start it via your sevice manager such as systemctl and initctl (for earlier,
3737

3838
# SAFETY
3939

40-
Do not worry, this is safe in most cases.
40+
Do not worry, this is safe.
4141

42-
For further, you can delete rule for your account in `/etc/sudoers` after create
42+
For further, you can remove rule for your account in `/etc/sudoers` after create
4343
a "special device", then only people with the following two cases can get root
4444
privilege:
4545

4646
1. He know root password (if your root account has a password)
47-
2. He have one of these special devices
47+
+ He has one of these special devices
4848

4949
# NOTICE
5050

51-
Do not repart your device, or UUID will changed, and this device
51+
**Do not repart your device**, or UUID will changed, and this device
5252
will lose effectiveness.
5353

5454
# COPYRIGHT

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ function build {
1818
function install {
1919
cd $builddir \
2020
&& sudo make install -j4
21+
22+
return $?
2123
}
2224

2325
build
@@ -26,3 +28,5 @@ if [[ 0 -eq $? && 'install' == $1 ]]; then
2628
install
2729
fi
2830

31+
return $?
32+

init/README.txt

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
This directory is init scripts for systemd, Upstart, SysVinit and BSD init.
22

3-
CMakelist.txt will not deal this directory, because there is no common way to
4-
indentify which init program you are using (not only installed), no matter via
3+
CMake will not deal this directory, because there is no common way to indentify
4+
which init program you are using (not only installed), no matter via
55
"/proc/1/exe", "/dev/initctl" or other way. So you should do that manually.
66

7-
Copy corresponding one to target directory:
7+
You should copy corresponding one to target directory:
88

99
---------------------------------------------------------------------------
1010
| init program | script file | target directory |
@@ -18,29 +18,58 @@ Copy corresponding one to target directory:
1818
If you are new to linux world, here is what you should do accroding to your
1919
init program is:
2020

21-
1. systemd
21+
1. systemd (for example, Arch Linux, Ubuntu 14.X+, Debian 6.0+, openSUSE 11.4+
22+
Fedora 16+, CentOS 6.X+ and Red Hat Enterprise Linux 6.X+)
2223

23-
sudo systemctl daemon-reload
24-
sudo systemctl enable sudodevd
25-
sudo systemctl start sudodevd
24+
Reload daemons config:
25+
sudo systemctl daemon-reload
2626

27-
2. Upstart
27+
Set start targets:
28+
sudo systemctl enable sudodevd
2829

29-
sudo initctl reload-configuration
30-
sudo initctl start sudodevd
30+
Start it now:
31+
sudo systemctl start sudodevd
3132

32-
3. SysVinit
33+
2. Upstart (for example, ealier versions of Ubuntu and Debian)
3334

34-
echo -n /etc/rc{2,3,4,5}.d/S60sudodevd | \
35-
xargs -d ' ' -I{} sudo ln -s /etc/init.d/sudodevd {}
36-
echo -n /etc/rc{0,1,6}.d/K60sudodevd | \
37-
xargs -d ' ' -I{} sudo ln -s /etc/init.d/sudodevd {}
38-
sudo chmod 755 /etc/init.d/sudodevd
39-
sudo /etc/init.d/sudodevd start
35+
Reload daemons config:
36+
sudo initctl reload-configuration
4037

41-
4. BSD init
38+
Start it now:
39+
sudo initctl start sudodevd
4240

43-
sudo sh -c 'echo sudodevd=YES >> /etc/rc.conf'
44-
sudo chmod 755 /etc/rc.d/rc.sudodevd
45-
sudo /etc/rc.d/rc.sudodevd start
41+
Start/stop runlevels has been set on sudodevd.conf, it is no need to set
42+
autostart manually.
43+
44+
3. SysVinit (for example, ealier versions of Fedora, CentOS and RHEL)
45+
46+
Set start/stop runlevels:
47+
echo -n /etc/rc{2,3,4,5}.d/S60sudodevd | \
48+
xargs -d ' ' -I{} sudo ln -s /etc/init.d/sudodevd {}
49+
echo -n /etc/rc{0,1,6}.d/K60sudodevd | \
50+
xargs -d ' ' -I{} sudo ln -s /etc/init.d/sudodevd {}
51+
52+
Set to executable:
53+
sudo chmod 755 /etc/init.d/sudodevd
54+
55+
Start it now:
56+
sudo /etc/init.d/sudodevd start
57+
58+
4. BSD init (for exmaple, Slackware Linux)
59+
60+
For BSD init, it is a bit complicated, you can not config it only by type
61+
some conmands. You have to write script in some files manually, and, have to
62+
datermind where is sutable to write.
63+
64+
Set start/stop runlevels:
65+
Write the line below to /etc/rc.d/rc.4 and /etc/rc.d/rc.M:
66+
[ -x /etc/rc.d/rc.sudodevd ] && /etc/rc.d/rc.sudodevd start
67+
Write the line below to /etc/rc.d/rc.0, /etc/rc.d/rc.6 and /etc/rc.d/rc.K:
68+
[ -x /etc/rc.d/rc.sudodevd ] && /etc/rc.d/rc.sudodevd stop
69+
70+
Set to executable:
71+
sudo chmod 755 /etc/rc.d/rc.sudodevd
72+
73+
Start it now:
74+
sudo /etc/rc.d/rc.sudodevd start
4675

src/config.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
#ifndef __CONFIG_H__
2020
#define __CONFIG_H__
2121

22-
#define VERSION ("0.10")
22+
#define VERSION ("0.20")
2323

24+
/* Never modify this { */
2425
#define SUDODEV_GROUP ("sudodev")
2526
#define SUDOERS ("/etc/sudoers")
2627
#define SUDO_CONF ("/etc/sudoers.d/sudodev")
@@ -30,6 +31,7 @@
3031
#define FSTAB ("/etc/fstab")
3132
#define SUDO_CONF_MODE (0400)
3233
#define PROFILE_MODE (0600)
34+
/* } */
3335

3436
/* For compatibility with Upstart, here can not use thread to deal with signal,
3537
* we have to use an ugly way to handle signals without to create a thread

src/readfile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ readfile (const char * const path, char ***list)
4040
if (access (path, 0))
4141
{
4242
*list = split = NULL;
43+
/* Hide error message here { *
4344
say (mode, MSG_E, "access failed: %s\n", strerror (errno));
45+
* } */
4446
return 0; /* No need to return -1 */
4547
}
4648

src/sudodev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ del (void)
370370

371371
if (access (PROFILE, 0))
372372
{
373-
say (mode, MSG_E, "Config file is not exist, run sudodev add first.\n");
373+
say (mode, MSG_E, "Config file not exist, run \"sudodev add\" first.\n");
374374
return 0;
375375
}
376376

0 commit comments

Comments
 (0)