mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
update DRIVER== changes
This commit is contained in:
parent
8f4bc5f1df
commit
915fde1738
4
TODO
4
TODO
@ -4,10 +4,6 @@ These things would be nice to have:
|
|||||||
any of the links at that time
|
any of the links at that time
|
||||||
|
|
||||||
These things will change in future udev versions:
|
These things will change in future udev versions:
|
||||||
o make DRIVER== to match only the event device
|
|
||||||
(DRIVERS must be used, we currently translate it to DRIVERS and print
|
|
||||||
a warning if DRIVER is used)
|
|
||||||
|
|
||||||
o warn if BUS, ID, SYSFS are used as keys
|
o warn if BUS, ID, SYSFS are used as keys
|
||||||
(they are SUBSYSTEMS, KERNELS, ATTRS now)
|
(they are SUBSYSTEMS, KERNELS, ATTRS now)
|
||||||
|
|
||||||
|
@ -188,7 +188,8 @@ int main(int argc, char *argv[])
|
|||||||
/* try to drop all privileges before reading disk content */
|
/* try to drop all privileges before reading disk content */
|
||||||
pw = getpwnam ("nobody");
|
pw = getpwnam ("nobody");
|
||||||
if (pw != NULL && pw->pw_uid > 0 && pw->pw_gid > 0) {
|
if (pw != NULL && pw->pw_uid > 0 && pw->pw_gid > 0) {
|
||||||
dbg("dropping privileges to %u:%u", (unsigned int)pw->pw_uid, (unsigned int)pw->pw_gid);
|
dbg("dropping privileges to %u:%u",
|
||||||
|
(unsigned int)pw->pw_uid, (unsigned int)pw->pw_gid);
|
||||||
if (setgroups(0, NULL) != 0 ||
|
if (setgroups(0, NULL) != 0 ||
|
||||||
setgid(pw->pw_gid) != 0 ||
|
setgid(pw->pw_gid) != 0 ||
|
||||||
setuid(pw->pw_uid) != 0) {
|
setuid(pw->pw_uid) != 0) {
|
||||||
|
@ -307,6 +307,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(key, "DRIVER") == 0) {
|
if (strcasecmp(key, "DRIVER") == 0) {
|
||||||
|
if (operation != KEY_OP_MATCH &&
|
||||||
|
operation != KEY_OP_NOMATCH) {
|
||||||
|
err("invalid DRIVER operation");
|
||||||
|
goto invalid;
|
||||||
|
}
|
||||||
add_rule_key(rule, &rule->driver, operation, value);
|
add_rule_key(rule, &rule->driver, operation, value);
|
||||||
valid = 1;
|
valid = 1;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user