Page MenuHomeFreeBSD

Use strsep() to parse init_path in start_init().
ClosedPublic

Authored by brooks on May 17 2018, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 7 2024, 11:24 AM
Unknown Object (File)
Jan 7 2024, 11:24 AM
Unknown Object (File)
Jan 7 2024, 11:23 AM
Unknown Object (File)
Jan 7 2024, 11:19 AM
Unknown Object (File)
Jan 7 2024, 10:46 AM
Unknown Object (File)
Dec 20 2023, 7:58 AM
Unknown Object (File)
Sep 7 2023, 3:23 AM
Unknown Object (File)
Sep 7 2023, 3:21 AM
Subscribers
None

Details

Summary

This simplifies the use of the path variable by making it NUL
terminated. This is a prerequisite for further cleanups.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Developed on CheriBSD (mips64), testing in an amd64 VM including verifying that single user mode works.

Once this and D15468 are in, I have another change to remove the temporary mapping in the stack region and just construct a struct image_args here for kern_execve().

Despite a couple grumbles, this looks good to my eye.

sys/kern/init_main.c
734 ↗(On Diff #42674)

We don't have strdup?

771 ↗(On Diff #42674)

are there any alignment requirements for ucp?

805 ↗(On Diff #42674)

Kinda lame to free something just before panic :)

This revision is now accepted and ready to land.May 17 2018, 9:45 PM
sys/kern/init_main.c
734 ↗(On Diff #42674)

Hmm, I was sure we didn't, but we do. I'll switch.

771 ↗(On Diff #42674)

Nope, it's just a bunch of strings in a row.

805 ↗(On Diff #42674)

I debated this, but concluded that leak checkers would probably be happier without a path with no free.

brooks marked 4 inline comments as done.
  • Use strdup().
This revision now requires review to proceed.May 17 2018, 10:38 PM

OK. Can't find anything else to argue with :)

This revision is now accepted and ready to land.May 17 2018, 10:49 PM
This revision was automatically updated to reflect the committed changes.