Skip to content

[action] [PR:13647] [systemd-sonic-generator] Fix overlapping strings being passed to strcpy/strcat#13892

Merged
mssonicbld merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/13647
Feb 22, 2023
Merged

[action] [PR:13647] [systemd-sonic-generator] Fix overlapping strings being passed to strcpy/strcat#13892
mssonicbld merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/13647

Conversation

@mssonicbld
Copy link
Collaborator

No description provided.

…cpy/strcat (sonic-net#13647)

#### Why I did it

Fix an issue that services do not start automatically on first boot and start only after hostcfgd enables them.
This is due to a bug in systemd-sonic-generator:

```
admin@arc-switch1004:~$ /usr/lib/systemd/system-generators/systemd-sonic-generator dir
Failed to open file /usr/lib/systemd/system/database.servcee
Error parsing targets for database.servcee
Error parsing database.servcee
Failed to open file /usr/lib/systemd/system/bgp.servcee
Error parsing targets for bgp.servcee
Error parsing bgp.servcee
Failed to open file /usr/lib/systemd/system/lldp.servcee
Error parsing targets for lldp.servcee
Error parsing lldp.servcee
Failed to open file /usr/lib/systemd/system/swss.servcee
Error parsing targets for swss.servcee
Error parsing swss.servcee
Failed to open file /usr/lib/systemd/system/teamd.servcee
Error parsing targets for teamd.servcee
Error parsing teamd.servcee
Failed to open file /usr/lib/systemd/system/syncd.servcee
Error parsing targets for syncd.servcee
Error parsing syncd.servcee
```

A wrong file name is generated (e.g database.**servcee**).

#### How I did it

Fixed overlapping strings being passed to strcpy/strcat that receive restirct* pointers (strings should not overlap).

#### How to verify it

Perform first boot and observe services start immidiatelly after boot.
@mssonicbld
Copy link
Collaborator Author

Original PR: #13647

@mssonicbld mssonicbld merged commit b51de79 into sonic-net:202205 Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants