EDIT: I'm rephrasing the question, as it seems the original was unsafe. If I install a light box in the ceiling (both to mount the fixture to, and to make the connections between fixture wires and extension cord wires), would it be safe to then run the cord from the junction box, through the crawl space, and the plug it into and electrical outlet? If not, how can I accomplish the task of getting a light fixture to be controlled by the switch (which controls power to one of the outlets)?
Original post below:
I'm currently in a rental unit. The bedroom is in a loft upstairs, with a vaulted ceiling, and surrounded by a crawl space. Currently, there is no light fixture in the bedroom, though a few of the wall outlets can be operated by a light switch.
I've bought a light fixture (a simple 5 pendant track light),and I'm hoping to attach it to the ceiling, run the wire down the vaulted ceiling (from my understanding, I can just find a 3-prong extension cord and cut off the one end, yeah?), then out through one of the crawlspace doors, and finally plug it in to one of the light-switch operated outlets.
My question is - is this safe? I'm sure wiring the fixture to an outlet is safe, but I'm not sure about attaching the fixture to the ceiling. the back plate would need to be screwed directly into the drywall and possibly a stud if i can find it, since there is not light box, and I don't want to cut out a large amount of drywall to add one (being so it is a rental, though 2 screws / 1 wire hole should be fine).
Is there a risk of fire from doing this? One of the ground wires is attached to the backplate I believe. Will this be a problem seeing as with no light box, the backplate wouldn't be grounded to anything metal?