home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / admin / 4323 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.9 KB  |  52 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv1!watdragon.waterloo.edu!jmsellen
  3. From: jmsellen@watdragon.waterloo.edu
  4. Subject: Re: allowing users root access to specific commands
  5. Message-ID: <BrzE3L.A1q@watdragon.waterloo.edu>
  6. Organization: DCS Software Activists Squad
  7. References: <1992Jul24.130911.6009@dragon.acadiau.ca> <Brwt1v.2pL@acsu.buffalo.edu>
  8. Date: Sun, 26 Jul 1992 05:33:17 GMT
  9. Lines: 41
  10.  
  11. In article <Brwt1v.2pL@acsu.buffalo.edu> hinkle@cs.Buffalo.EDU (Steven J. Hinkle) writes:
  12. |   We use a program called 'sudo'.  It is available via anonymous ftp from 
  13. |boulder.colorado.edu in /pub/sa-book/sudo
  14. |
  15. |   In a file (/usr/local/adm/sudoers) you can specify a username, the commands
  16. |that username can execute as root and a path that it has as root.
  17. |
  18. |   Works great.
  19.  
  20. Well, if I'm reading the code correctly, consider what happens if you have
  21. a privileged user with userid "jmsmith", and user "jms" tries the sudo
  22. command.  Check the use of strncmp() in isadoer().  Look for other strncmp()s
  23. in the program.  Do they work?
  24.  
  25. "sudo" attempts to notify "root" via mail when someone tries to use "sudo"
  26. who shouldn't be.  What happens if your nasty user has this
  27.   alias root myuserid
  28. in his/her .mailrc??
  29.  
  30. The mailmsg() routine has
  31.     char cmd[80];
  32.     (void) sprintf(cmd,
  33.         "/usr/ucb/mail -s \"*SECURITY* %s@%s tried to execute %s\" %s ",
  34.         user,hostname,*argv,ALERTMAIL);
  35. If I'm counting correctly, there are 27 bytes available to hold user, hostname,
  36. the command attempted, the ALERTMAIL userid, and the trailing '\0'.  And
  37. hostname is declared as MAXHOSTNAMELEN long.  What happens when
  38. sprintf overflows?
  39.  
  40. In create_file(), we have:
  41.     descrip = open(file, O_TRUNC | O_CREAT | O_WRONLY, 0700);
  42.     if(descrip == INVALID)
  43.     {
  44.         printf("Gag, couldn't open validation file.\en");
  45.         exit(4);
  46.     }
  47. which isn't exactly confidence inspiring.
  48.  
  49. John Sellens
  50. University of Waterloo
  51. jmsellens@watdragon.uwaterloo.ca
  52.