Linux, C, DOS, Vim, networking. he/him

  • 0 Posts
  • 8 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle


  • suprjami@lemmy.sdf.orgtoLinux@lemmy.ml*Permanently Deleted*
    ·
    1 year ago

    aiui apt will compare downloads from repositories against the repository signing key, whereas downloading a deb and installing it manually with dpkg bypasses that.

    So theoretically the Debian website could get compromised and provide you a malicious deb package. That has happened to other Linux distros before so it's not entirely unrealistic.

    Practically I think that's very unlikely.

    I know apt has the --download option if you'd like to fetch deb packages on the commandline, though I'm not sure if apt compares the package with the key during this process. I hope it does. You could probably run apt in verbose mode and hopefully see this happen.

    Some references:

    • https://askubuntu.com/questions/131397/what-is-a-repository-key-under-ubuntu-and-how-do-they-work
    • https://wiki.debian.org/SecureApt



  • What you wish for is how I use make. Off the top of my head, something like this:


    EXEC = programname
    SOURCES = $(wildcard *.c)
    OBJECTS = $(SOURCES:.c=.o)
    
    all: $(EXEC)
    
    $(EXEC): $(OBJECTS)
    
    %.o: %.c %.h
    
    .PHONY: all clean
    
    clean:
            rm -f $(EXEC) $(OBJECTS)
    

    Then just run make and it compiles and links all .c files into the executable. Each .c file needs a .h with the same name. Remove the %.h if you don't like that requirement.

    From memory you might need a .c and .h file with the same name as the executable.