r = get_user_creds(&owner, &uid, NULL, NULL, NULL);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_user_creds(&owner, &uid, NULL, NULL, NULL);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_group_creds(&group, &gid);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_group_creds(&group, &gid);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
/* the offset in the rule is limited to unsigned short */
if (filename_off < USHRT_MAX)
rule_tmp.rule.rule.filename_off = filename_off;
/* the offset in the rule is limited to unsigned short */
if (filename_off < USHRT_MAX)
rule_tmp.rule.rule.filename_off = filename_off;
/* If we aren't at the end of the line, this is a parsing error.
* Make a best effort to describe where the problem is. */
/* If we aren't at the end of the line, this is a parsing error.
* Make a best effort to describe where the problem is. */
- if (*linepos != '\n') {
- char buf[2] = {linepos[1]};
+ if (!strchr(NEWLINE, *linepos)) {
+ char buf[2] = {*linepos};
filename, lineno, linepos - line + 1, tmp);
filename, lineno, linepos - line + 1, tmp);
r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
if (r < 0) {
r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
if (r < 0) {
r = get_user_creds(&ow, &event->uid, NULL, NULL, NULL);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_user_creds(&ow, &event->uid, NULL, NULL, NULL);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_group_creds(&gr, &event->gid);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
r = get_group_creds(&gr, &event->gid);
if (r < 0) {
if (r == -ENOENT || r == -ESRCH)
strscpyl(tags_dir, sizeof(tags_dir), "/run/udev/static_node-tags/", *t, "/", NULL);
r = mkdir_p(tags_dir, 0755);
strscpyl(tags_dir, sizeof(tags_dir), "/run/udev/static_node-tags/", *t, "/", NULL);
r = mkdir_p(tags_dir, 0755);
unescaped_filename = xescape(rules_str(rules, cur->key.value_off), "/.");
strscpyl(tag_symlink, sizeof(tag_symlink), tags_dir, unescaped_filename, NULL);
r = symlink(device_node, tag_symlink);
unescaped_filename = xescape(rules_str(rules, cur->key.value_off), "/.");
strscpyl(tag_symlink, sizeof(tag_symlink), tags_dir, unescaped_filename, NULL);
r = symlink(device_node, tag_symlink);
- if (r < 0 && errno != EEXIST) {
- log_error("failed to create symlink %s -> %s: %m", tag_symlink, device_node);
- return -errno;
- } else
+ if (r < 0 && errno != EEXIST)
+ return log_error_errno(errno, "failed to create symlink %s -> %s: %m",
+ tag_symlink, device_node);
+ else