- Timestamp:
- Aug 25, 2002, 3:02:14 PM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- c01e477
- Parents:
- 4b464a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r4b464a4 r56330ff 6 6 #include <zephyr/zephyr.h> 7 7 #include <com_err.h> 8 #include <pwd.h>9 8 #include "owl.h" 10 9 … … 259 258 int ret; 260 259 ZNotice_t notice; 261 char *ptr;262 struct passwd *pw;263 char zsigtmp[LINE];264 char *zsigexec, *zsigowlvar, *zsigzvar;265 266 zsigexec = owl_global_get_zsig_exec(&g);267 zsigowlvar = owl_global_get_zsig(&g);268 zsigzvar = ZGetVariable("zwrite-signature");269 270 if (zsig) {271 strcpy(zsigtmp, zsig);272 } else if (zsigowlvar && *zsigowlvar) {273 strncpy(zsigtmp, zsigowlvar, LINE);274 } else if (zsigexec && *zsigexec) {275 FILE *file;276 char buff[LINE];277 strcpy(zsigtmp, "");278 file=popen(zsigexec, "r");279 if (!file) {280 if (zsigzvar && *zsigzvar) {281 strncpy(zsigtmp, zsigzvar, LINE);282 }283 } else {284 while (fgets(buff, LINE, file)) { /* wrong sizing */285 strcat(zsigtmp, buff);286 }287 pclose(file);288 if (zsigtmp[strlen(zsigtmp)-1]=='\n') {289 zsigtmp[strlen(zsigtmp)-1]='\0';290 }291 }292 } else if (zsigzvar) {293 strncpy(zsigtmp, zsigzvar, LINE);294 } else if (((pw=getpwuid(getuid()))!=NULL) && (pw->pw_gecos)) {295 strncpy(zsigtmp, pw->pw_gecos, LINE);296 ptr=strchr(zsigtmp, ',');297 if (ptr) {298 ptr[0]='\0';299 }300 } else {301 strcpy(zsigtmp, "");302 }303 260 304 261 memset(¬ice, 0, sizeof(notice)); … … 317 274 if (opcode) notice.z_opcode=opcode; 318 275 319 notice.z_message_len=strlen(zsig tmp)+1+strlen(message);276 notice.z_message_len=strlen(zsig)+1+strlen(message); 320 277 notice.z_message=owl_malloc(notice.z_message_len+10); 321 strcpy(notice.z_message, zsig tmp);322 memcpy(notice.z_message+strlen(zsig tmp)+1, message, strlen(message));278 strcpy(notice.z_message, zsig); 279 memcpy(notice.z_message+strlen(zsig)+1, message, strlen(message)); 323 280 324 281 /* ret=ZSendNotice(¬ice, ZAUTH); */
Note: See TracChangeset
for help on using the changeset viewer.